Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

use API to get account_id

Project: API Tutorial
Views: 282
Kernel: Python 3 (system-wide)

Get Account ID for user who owns the api_key

# import utility definitions %run ./01-utils.ipynb
# make an API call payload = {"query":{"accounts":{"account_id":None}}} response = call_api("query", payload) pp.pprint(response) ## expected result, last line contains the account id: # # {'event': 'query', # 'id': '...' # message id for the API request # 'multi_response': False, # for internal use, may be ignored # 'query': {'accounts': {'account_id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'}}} # this is the account id