Trying to update connections in Open AI Modules in scenarios. Have the below code. What should the connection ID be - Where can I find them.
import requests
Constants
API_BASE_URL = “https://eu1.make.com/api/v2”
API_TOKEN = “abcdefab-1234-5678-abcd-112233445566”
NEW_CONNECTION_ID = “new_connection_id” # Replace with your new connection ID
OLD_CONNECTION_ID = “old_connection_id” # Replace with your old connection ID
Function to get all scenarios
def get_scenarios():
url = f"{API_BASE_URL}/scenarios"
headers = {
“Authorization”: f"Token {API_TOKEN}"
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Check for HTTP errors
return response.json()
Function to update a module in a scenario
def update_module(scenario_id, module_id, update_data):
url = f"{API_BASE_URL}/scenarios/{scenario_id}/modules/{module_id}"
headers = {
“Authorization”: f"Token {API_TOKEN}",
“Content-Type”: “application/json”
}
response = requests.patch(url, headers=headers, json=update_data)
response.raise_for_status() # Check for HTTP errors
return response.json()