Get token:
import httpx
QUERY = """mutation {
tokenAuth(
username: "user",
password: "password"
) {
token
}
}"""
r = httpx.post("https://intranet.crhbp.pl/graphql_public/", json={"query": QUERY})
print(r.status_code)
print(r.text)
Service authorization
import httpx
AUTH = {
"data": {
"tokenAuth": {
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
r = httpx.get(
"https://intranet.crhbp.pl/app/table/TableName/-/form/list/",
headers={"Authorization": "JWT " + AUTH["data"]["tokenAuth"]["token"]},
)
print(r.status_code)
print(r.text)