Get Current Session
GET
sessions/{id}
Retrieves the user session tied to Bearer token. Pass @current to retrieve the current active user session.
Resource Information
| Method and URI | GET /AutodeskDM/Services/api/vault/v2/sessions/{id} |
| Authentication Context | User context required |
| Required OAuth Scopes | No scopes required |
| Data Format | JSON |
Request
Headers
| Authorization* string | Must be Bearer <token>, where <token> is a three-legged access token obtained via an Authorization Code flow or a Secure Service Account (SSA) flow.
The SSA flow is designed for headless server-to-server operations. While it functions like a two-legged flow (no user interaction), it is classified as three-legged because it preserves user context. |
* Required
Request
URI Parameters
| id string | The unique identifier of a login session. |
Response
HTTP Status Code Summary
| 200 OK | The session was successfully retrieved. |
| 401 Unauthorized | The supplied authorization header was not valid or the supplied token scope was not acceptable. Verify authentication and try again. |
| 403 Forbidden | The request was successfully validated but lacking the required permissions. Verify your credentials and permissions before you send this request again. |
Response
Body Structure (200)
Expand all
| id string | The unique identifier of the session. |
| accessToken string | The access token issued for this session. Pass this value in the Authorization header on subsequent requests. |
| vaultInformation object | Contains identifying metadata for a Knowledge Vault. |
| name string | The name of the Knowledge Vault. This is also the name of the database. |
| id string | A unique identifier for the Knowledge Vault. |
| url string | The relative URL to access this object. |
| userInformation object | Contains core Vault account metadata returned for directory operations. |
| id string | A unique number that the Vault uses to reference the user. |
| name string | The login name of the user. |
| email string | The email address of the user. |
| authTypes enum:string | Specifies which account directory backs the sign-in record. Possible values:
|
| systemName string | The internal system name of the user. |
| createDate datetime: ISO 8601 | The date that the user was created. |
| isActive boolean | Indicates whether this user is active.
|
| url string | The relative URL to access this object. |
Example
This example illustrates how to get current session.
Note: {VaultServerAddress} is used as a placeholder in the example(s) and could represent one of the following:
- Vault Server IP address or hostname. Ex: http://10.41.110.49.
- Vault Gateway URL if gateway is configured. Ex: https://test.vg.autodesk.com.
Request
curl -v '{VaultServerAddress}/AutodeskDM/Services/api/vault/v2/sessions/@current' \
-X 'GET' \
-H 'Accept: application/json'\
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a...'
Response
{
"id": "cae23e71-697f-411f-b404-3c235ba82c55",
"accessToken": "V:cae23e71-697f-411f-b404-3c235ba82c55",
"createDate": "2024-10-21T09:01:37.9817775Z",
"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/cae23e71-697f-411f-b404-3c235ba82c55"
}
Show More