Request

Response

    REST API Code Snippets

    Retrieve OIDC-compliant user information using the REST API /userinfo endpoint.

    Request

    Modern APS (Recommended):

    GET /userinfo HTTP/1.1
    Host: api.aps.autodesk.com
    Authorization: Bearer <ACCESS_TOKEN>
    

    Legacy (Still Supported):

    GET /userinfo HTTP/1.1
    Host: developer.api.autodesk.com
    Authorization: Bearer <ACCESS_TOKEN>
    

    Example Response

    {
      "sub": "ABCDEFGH",
      "name": "John Doe",
      "given_name": "John",
      "family_name": "Doe",
      "preferred_username": "johndoe",
      "email": "john.doe@example.com",
      "email_verified": true,
      "picture": "https://images.profile.autodesk.com/<hash>/x120.jpg?t=<generated-token>",
      "locale": "en-US",
      "updated_at": 1662583480,
      "country_code": "US",
      "job_title": "Software Engineer",
      "company": "Acme Corp",
      "language": "en"
    }
    
    Show More

    Note: The response includes standard OIDC claims plus Autodesk-specific fields. See GET OIDC User Info for the complete field reference.

    Error Response

    REST API errors return standard HTTP status codes. See REST API Error Handling for details.

    Code Snippets

    NodeJS (Axios)

    Modern APS (Recommended):

    const axios = require('axios');
    
    axios.get('https://api.aps.autodesk.com/userinfo', {
      headers: {
        'Authorization': 'Bearer <ACCESS_TOKEN>'
      }
    })
    .then(response => console.log(JSON.stringify(response.data, null, 2)))
    .catch(error => {
      if (error.response) {
        console.error('Error:', error.response.status, error.response.data);
      } else {
        console.error('Error:', error.message);
      }
    });
    
    Show More

    Legacy (Still Supported):

    const axios = require('axios');
    
    axios.get('https://developer.api.autodesk.com/userinfo', {
      headers: {
        'Authorization': 'Bearer <ACCESS_TOKEN>'
      }
    })
    .then(response => console.log(JSON.stringify(response.data, null, 2)))
    .catch(error => {
      if (error.response) {
        console.error('Error:', error.response.status, error.response.data);
      } else {
        console.error('Error:', error.message);
      }
    });
    
    Show More

    Java (Unirest)

    Modern APS (Recommended):

    HttpResponse<String> response = Unirest
        .get("https://api.aps.autodesk.com/userinfo")
        .header("Authorization", "Bearer <ACCESS_TOKEN>")
        .asString();
    
    System.out.println(response.getBody());
    

    Legacy (Still Supported):

    HttpResponse<String> response = Unirest
        .get("https://developer.api.autodesk.com/userinfo")
        .header("Authorization", "Bearer <ACCESS_TOKEN>")
        .asString();
    
    System.out.println(response.getBody());