GraphQL Endpoint
POST
flow/data/v1/graphql
Sends GraphQL requests to the Media and Entertainment (M&E) Data Model cloud and returns responses in the JSON format.
Resource Information
| Method and URI | |
| Authentication Context | user context required |
| Required OAuth Scopes | data:read data:search |
| Data Format | JSON |
Request
Headers
| Authorization* string | Must be Bearer <TOKEN>, where <TOKEN> is an access token obtained by a three-legged OAuth flow. |
| Content-Type string | Must be application/json. |
* Required
Request
Body Structure
| query* object | Contains the GraphQL query or mutation to send to the M&E Data Model cloud. |
| variables object | Contains a set of key-value pairs, where the keys correspond to the names of the variables defined in your GraphQL query, and the values represent the values of those variables. |
* Required
Example 1
This example demonstrates how to send a GraphQL query to the M&E Data Model cloud.
Request
curl -v 'https://developer.api.autodesk.com/flow/data/v1/graphql' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a...' \
-H 'Content-Type: application/json' \
-d '{
"query": "query projects($hubId: ID!) {
projects(hubId: $hubId) {
results {
id
name
}
}
}",
"variables": {
"hubId": "a.YnVzaW5lc3M6YXV0b2Rlc2syMzk4IzIwMjQwMTI1Njk4NjE1NTE"
}
}'
Show More
const axios = require('axios');
axios({
method: 'POST',
url: 'https://developer.api.autodesk.com/flow/data/v1/graphql',
headers: {
'Authorization': 'Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a...'
},
data: {
query: `query projects($hubId: ID!) {
projects(hubId: $hubId) {
results {
id
name
}
}
}`,
variables: {
hubId: "a.YnVzaW5lc3M6YXV0b2Rlc2syMzk4IzIwMjQwMTI1Njk4NjE1NTE"
}
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
Show More
Note: Axios automatically sets the Content-Type header to application/json.
Response
{
"data": {
"projects": {
"results": [
{
"id": "a.YnVzaW5lc3M6YXV0b2Rlc2syMzk4IzIwMjQwMTI1Njk4NjE1NTE",
"name": "DOCS_STG"
}
]
}
}
}
Show More