Skip to content

Instantly share code, notes, and snippets.

@isaacharrisholt
Created April 23, 2022 15:10
Show Gist options
  • Save isaacharrisholt/bbb063d339a2e799724acf9432fc84a5 to your computer and use it in GitHub Desktop.
Save isaacharrisholt/bbb063d339a2e799724acf9432fc84a5 to your computer and use it in GitHub Desktop.
def get_connections_for_workspace(workspace_id: str) -> List[str]:
response = requests.post(
f'{API_ROOT}/connections/list',
json={'workspaceId': workspace_id},
)
response.raise_for_status()
return [
connection['connectionId']
for connection in response.json()['connections']
if connection['status'] == 'active' # So we can still disable connections in the UI
]
def trigger_connection_sync(connection_id: str) -> dict:
response = requests.post(
f'{API_ROOT}/connections/sync',
json={'connectionId': connection_id},
)
response.raise_for_status()
return response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment