Access Tokens
Get and use access tokens to make API calls
Last updated
Was this helpful?
Was this helpful?
import requests
from urllib.parse import urljoin
access_token = <ACCESS_TOKEN>
api_endpoint = <API_ENDPOINT>
headers = {
'Authorization': f'{access_token}',
'Content-Type': 'application/json'
}
GET_RUNS = '''
{
runs(first: 10) {
edges {
node { id title
steps {
id
title
}
}
}
}
}
'''
query = {
'query': GET_RUNS
}
res = requests.post(urljoin(api_endpoint, 'graphql'), headers=headers, json=query)
print(res.json())