python-snippets/api-client/main.py
2024-07-20 00:54:31 +01:00

24 lines
539 B
Python

import json
from config import get_cfg
from client import api_client
from oauth_helper import get_legacy_token
ENV = 'qa'
cfg = get_cfg(ENV)
if __name__ == "__main__":
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": cfg["api_url"] + '/data-delivery/role',
"headers": {'Content-Type': 'application/json'},
"body": {"application_id": 1}
}
api_response = api_client(api_call)
print(json.dumps(api_response, indent=4))