GraphQL Endpoint
POST
fusiondata/2022-04/graphql
Sends GraphQL requests to the 2022-04
version of the Manufacturing Data Model GraphQL service and returns responses in the JSON format.
Resource Information
Method and URI | |
Authentication Context | user context required |
Required OAuth Scopes | data:create data:read data:write |
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
Request body to send a GraphQL query.
query* object | Contains the GraphQL query or mutation to send to the Manufacturing Data Model service. |
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 use cURL to send a GraphQL query to the Manufacturing Data Model service.
Request
curl -v 'https://developer.api.autodesk.com/fusiondata/2022-04/graphql' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a...' \
-H 'Content-Type: application/json' \
-d '{
"query":"query GetProjects($hubId: String!) {
projects(hubId: $hubId) {
results {
id
name
rootFolder
id
name
objectCount
}
}
}",
"variables":{
"hubId":"a.YnVzaW5lc3M6YXV0b2Rlc2syMDA2"
}
}'
Show More
Response
{
"data":{
"projects":{
"results":[
{
"id":"a.YnVzaW5lc3M6YXV0b2Rlc2syMDM5I0QyMDIyMDEzMTUwMzg3NDE5",
"name":"Default Project",
"rootFolder":{
"id":"urn:adsk.wipstg:fs.folder:co.ey_M0BCsSbOfU4C89MaUSw",
"name":"Default Project"
}
},
{
"id":"a.YnVzaW5lc3M6YXV0b2Rlc2syMDM5I0QyMDIyMDEzMTUwMzg3NDQ0",
"name":"Admin Project",
"rootFolder":{
"id":"urn:adsk.wipstg:fs.folder:co.BZM3RAccSUaNyFciRiC9rQ",
"name":"Admin Project"
}
},
{
"id":"a.YnVzaW5lc3M6YXV0b2Rlc2syMDM5I0QyMDIyMDEzMTUwMzg3NDY5",
"name":"Assets",
"rootFolder":{
"id":"urn:adsk.wipstg:fs.folder:co.mvXjlzNYS2GhslTRol9vfw",
"name":"Assets"
}
}
]
}
}
}
Show More
Example 2
This example demonstrates how to use Axios in JavaScript to send a GraphQL query to the Manufacturing Data Model service.
Request
axios({
method: 'POST',
url: 'https://developer.api.autodesk.com/fusiondata/2022-04/graphql',
data: {
query: `{
hubs {
results {
name
}
}
}`
}
})
Show More
Note: Axios automatically sets the Content-Type
header to application/json
.
Response
{
"data":{
"hubs":{
"results":[
{
"id":"a.YnVzaW5lc3M6YXV0b2Rlc2s2MTA0",
"name":"L2-Forge-Data-Team"
},
{
"id":"a.YnVzaW5lc3M6YXV0b2Rlc2s0NTA5",
"name":"Michelangelo’s Playground"
}
]
}
}
}
Show More