@@ -191,20 +191,24 @@ def find_aog_item_by_grant_id(grant_id):
191191 Returns the item ID if found, None otherwise.
192192 """
193193 try :
194- api_key = os .getenv ('KISSFLOW_API_KEY' )
194+ subdomain = os .getenv ('KISSFLOW_SUBDOMAIN' , 'ethereum' )
195+ access_key_id = os .getenv ('KISSFLOW_ACCESS_KEY_ID' )
196+ access_key_secret = os .getenv ('KISSFLOW_ACCESS_KEY_SECRET' )
195197 account_id = os .getenv ('KISSFLOW_ACCOUNT_ID' )
196198 process_id = os .getenv ('KISSFLOW_PROCESS_ID' )
197199
198- if not all ([api_key , account_id , process_id ]):
200+ if not all ([access_key_id , access_key_secret , account_id , process_id ]):
199201 logging .error ("Missing Kissflow configuration" )
200202 return None
201203
202204 # Kissflow API endpoint to search for items
203- url = f"https://api .kissflow.com/api/v1/accounts/ { account_id } /processes /{ process_id } /items"
205+ url = f"https://{ subdomain } .kissflow.com/process/2/ { account_id } /{ process_id } /items"
204206
205207 headers = {
206- 'Authorization' : f'Bearer { api_key } ' ,
207- 'Content-Type' : 'application/json'
208+ 'Accept' : 'application/json' ,
209+ 'Content-Type' : 'application/json' ,
210+ 'X-Access-Key-Id' : access_key_id ,
211+ 'X-Access-Key-Secret' : access_key_secret
208212 }
209213
210214 # Search for items with matching Grant ID in Request_number field
@@ -233,20 +237,24 @@ def update_aog_kyc_comments(item_id, legal_identifier):
233237 Updates the KYC_Comments field in a Kissflow AOG item with the legal identifier.
234238 """
235239 try :
236- api_key = os .getenv ('KISSFLOW_API_KEY' )
240+ subdomain = os .getenv ('KISSFLOW_SUBDOMAIN' , 'ethereum' )
241+ access_key_id = os .getenv ('KISSFLOW_ACCESS_KEY_ID' )
242+ access_key_secret = os .getenv ('KISSFLOW_ACCESS_KEY_SECRET' )
237243 account_id = os .getenv ('KISSFLOW_ACCOUNT_ID' )
238244 process_id = os .getenv ('KISSFLOW_PROCESS_ID' )
239245
240- if not all ([api_key , account_id , process_id ]):
246+ if not all ([access_key_id , access_key_secret , account_id , process_id ]):
241247 logging .error ("Missing Kissflow configuration" )
242248 return False
243249
244250 # Kissflow API endpoint to update an item
245- url = f"https://api .kissflow.com/api/v1/accounts/ { account_id } /processes /{ process_id } /items/{ item_id } "
251+ url = f"https://{ subdomain } .kissflow.com/process/2/ { account_id } /{ process_id } /items/{ item_id } "
246252
247253 headers = {
248- 'Authorization' : f'Bearer { api_key } ' ,
249- 'Content-Type' : 'application/json'
254+ 'Accept' : 'application/json' ,
255+ 'Content-Type' : 'application/json' ,
256+ 'X-Access-Key-Id' : access_key_id ,
257+ 'X-Access-Key-Secret' : access_key_secret
250258 }
251259
252260 # Update the KYC_Comments field
0 commit comments