Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
515 B
6
Indexable
Never
if "access_token" in result:
    # Calling graph using the access token
    url=config["endpoint"]
    data=[]
    while url:
        try:   
            graph_data = requests.get(  # Use token to call downstream service
                url,
                headers={'Authorization': 'Bearer ' + result['access_token']}, ).json()
            data.extend(graph_data['value'])
            url=graph_data['@odata.nextLink']
        except Exception as error:
            print("error : "+ str(error))
            break
Leave a Comment