Authorization
Every API call needs to be authenticated using a so calles "Bearer Token". This token is passed along as header field in the HTTP request. Details on how to get this token are covered in this section. Besides the token these header fields are mandatory:
header name | example | description |
---|---|---|
Authorization | Bearer eyJhbGciOiJ...dQssw5c | Bearer token issued in OAuth workflow |
X-Version | CAD System/1.0 | name of product along with version |
X-Instance | srv-prod-01 | hostname |
Example request
- Request
- Response
POST /graphql HTTP/1.1
Authorization: Bearer eyJhbGciOiJ...dQssw5c
Accept: application/json
Content-Type: application/json
X-Version: CAD System/1.0
X-Instance: srv-prod-01
...
query {
missonResources {
nodes {
name
id
}
}
}
HTTP/1.1 200 Ok
Content-Type: application/json;charset=UTF-8
Content-Length: 226
...
{
"data": {
"missonResources": {
"nodes": [
{
"name": "Unit 1",
"id": "UIUGEUYZ5ZP"
},
{
"name": "Unit 2",
"id": "UIUGEUYZ5ZH"
}
}
}