Request

Response

    About GraphQL

    GraphQL is an open-source query language for APIs, developed by Facebook as an alternative to REST API. It was publicly released in 2015 and is hosted by the Linux Foundation at GraphQL.org.

    With GraphQL, you can perform various operations such as querying, creating, updating, and deleting data using mutations. Both queries and mutations follow the same syntax. Below are examples from GraphQL.org that demonstrate how queries and mutations are sent to a GraphQL server hosting information about Star Wars.

    Examples

    Example 1 - Query

    Query

    query HeroNameAndFriends {
      hero {
        name
        friends {
          name
        }
      }
    }
    
    Show More

    Result

    {
      "data":{
        "hero":{
          "name":"R2-D2",
          "friends":[
            {
              "name":"Luke Skywalker"
            },
            {
              "name":"Han Solo"
            },
            {
              "name":"Leia Organa"
            }
          ]
        }
      }
    }
    
    Show More

    See this Tutorial on GraphQL queries for more information on queries.

    Example 2 - Mutation

    Mutation

    mutation CreateReviewForEpisode($ep: Episode!, $review: ReviewInput!) {
      createReview(episode: $ep, review: $review) {
        stars
        commentary
      }
    }
    
    Variables:
    {
      "ep":"JEDI",
      "review":{
        "stars":5,
        "commentary":"This is a great movie!"
      }
    }
    
    Show More

    Result

    {
      "data":{
        "createReview":{
          "stars":5,
          "commentary":"This is a great movie!"
        }
      }
    }
    
    Show More

    See this Tutorial on GraphQL mutations for more information on mutations.

    When the schema of the data is known, you can query for and change the information in the exact shape the data is organized. Moreover, you will only fetch the data you need. In contrast, REST APIs respond with a predefined payload, regardless of whether you need all the information or not.

    For more information on GraphQL, see:

    The Manufacturing Data Model API provides a unified interface by federating multiple services. For example; to deal with Hubs, Projects and Folders, you typically would have to deal with the Data Management REST API. Manufacturing Data Model API, based on GraphQL service handles the interaction with Data Management, providing you with a unified API experience.

    How to use the Manufacturing Data Model API

    To use the Manufacturing Data Model API:

    1. Follow the instructions in the tutorial Create an App . When specifying details of the app:

      • Specify https://mfgdatamodel-explorer.autodesk.io/callback/oauth for the Callback URL.
    2. Obtain a 3-legged access token. See Before you begin for instructions on how to use Postman to obtain a 3-legged access token. Make sure that you specify the following scopes:

      data:read data:create data:write data:search
      
    3. Send a POST request to https://developer-stg.api.autodesk.com/mfg/v3/graphql/public, using the query as the request payload. Each request must contain an Authorization header, which must be set to Bearer YOUR_ACCESS_TOKEN, For example;

      Request:

      curl -v 'https://developer.api.autodesk.com/mfg/graphql' \
      -X 'POST' \
      -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
      -H 'Content-Type: application/json' \
      -d '{
      "query": "query GetHubs {
        hubs{
            pagination {
                cursor
                pageSize
            }
            results {
                id
                name
            }
        }
      }"
      "variables": {}
      }'
      
      Show More

      Response

      {
      "data": {
          "hubs": {
          "pagination": {
              "cursor": null,
              "pageSize": 3
          },
          "results": [
              {
              "id": "a.YnVzaW5lc3M6YXV0b2Rlc2syNDQ3",
              "name": "UATTestingLinkHub"
              },
              {
              "id": "a.YnVzaW5lc3M6YXV0b2Rlc2syMDA2",
              "name": "L2-Forge-Data-Team"
              },
              {
              "id": "a.YnVzaW5lc3M6YXV0b2Rlc2syMzk4",
              "name": "stg-hds-test-hub"
              }
          ]
          }
      }
      }
      
      Show More


     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.