Request

Response

    API Authentication

    The Vault Data API supports the following authentication mechanisms:

    • Vault Account
    • Windows Account
    • Autodesk Account

    Authenticating using Vault Account

    Vault Account is a user account that is created and managed within the Vault server. To create a session using Vault Account credentials, you need to provide the username and password associated with the account.

    Request

    curl -v 'https://test.vg.autodesk.com/AutodeskDM/Services/api/vault/v2/sessions' \
      -X 'POST' \
      -H 'Content-Type: application/json'\
      -H 'Accept: application/json'\
      -d '{
        "input": {
          "vault": "Vault",
          "userName": "TestAccount",
          "password": "Test123456!",
          "appCode": "TC"
        }
      }'
    
    Show More

    Response

    {
      "id": "aac1705d-8956-4fba-962c-4d2b6bfaf398",
      "accessToken": "V:aac1705d-8956-4fba-962c-4d2b6bfaf398",
      "createDate": "2024-10-21T07:56:45.2277149Z",
      "vaultInformation": {
        "id": "117",
        "name": "Vault",
        "url": "/AutodeskDM/Services/api/vault/v2/vaults/117"
      },
      "userInformation": {
        "id": "65",
        "name": "TestAccount",
        "email": "VaultAPITest@outlook.com",
        "authTypes": "Vault, Autodesk",
        "createDate": "2024-06-27T06:29:20.183Z",
        "isActive": true,
        "url": "/AutodeskDM/Services/api/vault/v2/users/65"
      },
      "url": "/AutodeskDM/Services/api/vault/v2/sessions/aac1705d-8956-4fba-962c-4d2b6bfaf398"
    }
    
    Show More

    Note the accessToken value in the response — V:aac1705d-8956-4fba-962c-4d2b6bfaf398. Pass this token in the Authorization header for any endpoint that requires authentication.

    The following example shows how to call an endpoint that requires authentication using the accessToken:

    Request

    curl -v 'https://test.vg.autodesk.com/AutodeskDM/Services/api/vault/v2/users?limit=2' \
      -X 'GET' \
      -H 'Accept: application/json'\
      -H 'Authorization: Bearer V:aac1705d-8956-4fba-962c-4d2b6bfaf398'
    

    Response

    {
      "pagination": {
        "limit": 2,
        "totalResults": 159,
        "nextUrl": "/AutodeskDM/Services/api/vault/v2/users?limit=2&cursorState=SQBkAEMAdQByAHMAbwByAC0AdgAxADoAMwA_",
        "indexingStatus": "NA"
      },
      "results": [
        {
          "id": "2",
          "name": "Administrator",
          "systemName": "Administrator",
          "email": "",
          "authTypes": "Vault",
          "createDate": "2013-10-17T20:18:13.19Z",
          "isActive": true,
          "url": "/AutodeskDM/Services/api/vault/v2/users/2"
        },
        {
          "id": "3",
          "name": "Guest",
          "systemName": "Guest",
          "email": "",
          "authTypes": "Vault",
          "createDate": "2013-10-17T20:18:13.313Z",
          "isActive": true,
          "url": "/AutodeskDM/Services/api/vault/v2/users/3"
        }
      ]
    }
    
    Show More

    Authenticating using Windows Account

    A Vault user account can be linked with a Windows Active Directory account, allowing you to authenticate using your Windows credentials.

    Unlike Vault Account authentication, your credentials are not sent in the request payload. Instead, when you call this endpoint, the server issues an NTLM authentication challenge that your client must handle — for example, a browser may prompt you to enter your Windows credentials.

    Once the server validates your credentials and confirms that Windows authentication is enabled for your account, it issues an accessToken. You can then use this token in any API call that requires an Authorization header.

    Request

    curl -v 'https://test.vg.autodesk.com/AutodeskDM/Services/api/vault/v2/sessions/win-auth' \
      -X 'POST' \
      -H 'Content-Type: application/json'\
      -H 'Accept: application/json'\
      --ntlm\
      -u '<domain>\<user>:<password>' \
      -d '{
        "input": {
          "vault": "Vault",
          "appCode": "TC"
        }
      }'
    
    Show More

    Response

    {
      "id": "aac1705d-8956-4fba-962c-4d2b6bfaf398",
      "accessToken": "V:aac1705d-8956-4fba-962c-4d2b6bfaf398",
      "createDate": "2024-10-21T07:56:45.2277149Z",
      "vaultInformation": {
        "id": "117",
        "name": "Vault",
        "url": "/AutodeskDM/Services/api/vault/v2/vaults/117"
      },
      "userInformation": {
        "id": "65",
        "name": "TestAccount",
        "email": "VaultAPITest@outlook.com",
        "authTypes": "Vault, Autodesk",
        "createDate": "2024-06-27T06:29:20.183Z",
        "isActive": true,
        "url": "/AutodeskDM/Services/api/vault/v2/users/65"
      },
      "url": "/AutodeskDM/Services/api/vault/v2/sessions/aac1705d-8956-4fba-962c-4d2b6bfaf398"
    }
    
    Show More

    For more information, see:

    Authenticating using Autodesk Account

    An Autodesk Account is a user account created and managed by Autodesk. In Vault Server, you can add an Autodesk account mapping for a new or existing user. See Add an Authentication Account to a User Profile for details.

    The Vault Data API supports implicit Autodesk Account authentication. Pass your three-legged token in the Authorization header for any endpoint that requires authentication.

    Assuming Autodesk Account Mapping is configured for your account, first generate a token using the three-legged OAuth flow.

    The following example shows how to call an endpoint that requires authentication, using <your-3-legged-token> as the token:

    Request

    curl -v 'https://test.vg.autodesk.com/AutodeskDM/Services/api/vault/v2/users?limit=2' \
      -X 'GET' \
      -H 'Accept: application/json'\
      -H 'Authorization: Bearer <your-3-legged-token>'
    

    Response

    {
      "pagination": {
        "limit": 2,
        "totalResults": 159,
        "nextUrl": "/AutodeskDM/Services/api/vault/v2/users?limit=2&cursorState=SQBkAEMAdQByAHMAbwByAC0AdgAxADoAMwA_",
        "indexingStatus": "NA"
      },
      "results": [
        {
          "id": "2",
          "name": "Administrator",
          "systemName": "Administrator",
          "email": "",
          "authTypes": "Vault",
          "createDate": "2013-10-17T20:18:13.19Z",
          "isActive": true,
          "url": "/AutodeskDM/Services/api/vault/v2/users/2"
        },
        {
          "id": "3",
          "name": "Guest",
          "systemName": "Guest",
          "email": "",
          "authTypes": "Vault",
          "createDate": "2013-10-17T20:18:13.313Z",
          "isActive": true,
          "url": "/AutodeskDM/Services/api/vault/v2/users/3"
        }
      ]
    }
    
    Show More