GuglielmoTor commited on
Commit
a2fb9ee
·
verified ·
1 Parent(s): 051bb8d

Update apis/Bubble_API_Calls.py

Browse files
Files changed (1) hide show
  1. apis/Bubble_API_Calls.py +3 -1
apis/Bubble_API_Calls.py CHANGED
@@ -91,7 +91,7 @@ def fetch_linkedin_token_from_bubble(url_user_token_str: str):
91
  print(status_message) # Log the final status message
92
  return parsed_token_dict
93
 
94
- def fetch_linkedin_posts_data_from_bubble(org_urn: str, data_type:str, constraint_key:str):
95
  bubble_api_key = os.environ.get("Bubble_API")
96
  if not bubble_api_key:
97
  error_msg = "❌ Bubble API Error: The 'Bubble_API' environment variable is not set."
@@ -100,6 +100,8 @@ def fetch_linkedin_posts_data_from_bubble(org_urn: str, data_type:str, constrain
100
 
101
  base_url = f"https://app.ingaze.ai/version-test/api/1.1/obj/{data_type}"
102
  constraints = [{"key": constraint_key, "constraint_type": "equals", "value": org_urn}]
 
 
103
  params = {'constraints': json.dumps(constraints)}
104
  headers = {"Authorization": f"Bearer {bubble_api_key}"}
105
 
 
91
  print(status_message) # Log the final status message
92
  return parsed_token_dict
93
 
94
+ def fetch_linkedin_posts_data_from_bubble(org_urn: str, data_type:str, constraint_key:str, additional_constraints: list = None):
95
  bubble_api_key = os.environ.get("Bubble_API")
96
  if not bubble_api_key:
97
  error_msg = "❌ Bubble API Error: The 'Bubble_API' environment variable is not set."
 
100
 
101
  base_url = f"https://app.ingaze.ai/version-test/api/1.1/obj/{data_type}"
102
  constraints = [{"key": constraint_key, "constraint_type": "equals", "value": org_urn}]
103
+ if additional_constraints:
104
+ constraints.extend(additional_constraints)
105
  params = {'constraints': json.dumps(constraints)}
106
  headers = {"Authorization": f"Bearer {bubble_api_key}"}
107