### Response example for access token request Source: https://docs.validis.com/docs/validis-api/4f258390ecab9-get-access-token-and-client-id Example response from the token endpoint. It contains the JWT access_token, token_type, expiry time, resellerId, clientId, permissions, userId, username, vconnectClientId, and jti. The clientId is required for subsequent API requests. ```json { "access_token": "eyJhbGciOiJIUzI1NiIs213213123vdssds.eyJyZXNlbGxlcklkIjoiN2NjMGMyZjUtODkwOC00N2U1LThhMjMtZTI3NTc1ZDQ4NGM2IiwiY2xpZW50SWQiOiIxNzEzMTJjYy01YjgyLTQ5YTUtYWJlOC0wM2M5ZDZiOTIwZjciLCJwZXJtaXNzaW9ucyI6WyJCQjNBQjAiLCJGRDY1MjgiLCI3Rk1LTlYiLCJBTEpQNDQiLCJMRjZVWDQiLCI4RjI0UFAiLCI5QzJET1AiLCIzRjk5NzIiLCI2UEdETTIiLCIzOUFLRE8iLCJCOTA5QzIiLCJaVVFSWDAiLCJHNjBOM0siLCJGRjc0NTEiLCJGMzlSVDEiLCIyUzNKTTciLCIxQkU2NjQiLCJETDM3UFoiLCJFR0RFNjQiLCI0NUVCMEEiLCI0Q0FBMUIiLCJGMzhOM0YiLCJQRDVMODgiLCJMQklGSDkiLCJUNzlTR1IiLCJOMEc1TEoiLCJZQTBWSzUiLCJZOEtSM1EiLCJYQk9TMUoiLCIxNEFCNTMiXSwicm9sZXMiOlsiY2xpZW50LmFwaSJdLCJleHAiOjE2OTYyOTQwNDQsInVzZXJJZCI6MTE3MTAsImp0aSI6ImMzNjRmMGVjLTA5ODYtNDJiOS04MWI4LTQ2OTViYmVjZWExMSIsImNsaWVudF9pZCI6InZhcGkiLCJ1c2VybmFtZSI6ImFwaUBleGFtcGxlLmNvbSIsInZjb25uZWN0Q2xpZW50SWQiOiIxNzEzMTJjYy01YjgyLTQ5YTUtYWJlOC0wM2M5ZDZiOTIwZjcifQ.DOSgcud9D7S9z1SqioBaCAlXzs3CsFXkz8MG8iGXAKs", "token_type": "bearer", "expires_in": 2344, "resellerId": "3rt6gj57-4078-9o70-2t78-e275759u87c6", "clientId": "171312cc-5b82-49a5-abe8-03c9d6b920f7", "permissions": [ "6P1DM2", "39A6DO", "B109C2", "ZUQAS0", "G10N3K", "FF0351", "F11RY2", "2S3JM7", "1BE333", "DL31QZ" ], "userId": 12310, "username": "api@example.com", "vconnectClientId": "d2c5961e-e54c-409e-860a-dc345342c3a9", "jti": "c364f0ec-0986-42b9-81b8-4695bbecea11" } ``` -------------------------------- ### Get access token and clientId with cURL Source: https://docs.validis.com/docs/validis-api/4f258390ecab9-get-access-token-and-client-id Use this cURL command to request an access token and client ID from the Validis sandbox API. It requires a valid API key in the Ocp-Apim-Subscription-Key header and the grant_type vapi_key. The response includes the JWT and clientId needed for subsequent API requests. ```shell curl --request POST \ --url https://api.sandbox.validis.com/v1/oauth/token \ --header 'Accept: application/vnd.api+json, text/plain' \ --header 'Content-Type: multipart/form-data' \ --header 'Ocp-Apim-Subscription-Key: 123' \ --form key= \ --form grant_type=vapi_key ``` -------------------------------- ### POST /auth/token Source: https://docs.validis.com/docs/validis-api/6027c61e2eae8-authentication-api Endpoint to request a JWT for authenticating API requests and retrieving the Client ID. ```APIDOC ## [POST] /auth/token ### Description Request a JSON Web Token (JWT) to authenticate API requests and retrieve the Client ID required for subsequent API calls. ### Method POST ### Endpoint /auth/token ### Parameters #### Request Body - **client_id** (string) - Required - The client identifier. - **client_secret** (string) - Required - The client secret. ### Request Example { "client_id": "your-client-id", "client_secret": "your-client-secret" } ### Response #### Success Response (200) - **access_token** (string) - The JWT used for authentication. - **token_type** (string) - The type of token (e.g., Bearer). - **expires_in** (integer) - Token expiration time in seconds. #### Response Example { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600 } ``` -------------------------------- ### POST /v1/oauth/token Source: https://docs.validis.com/docs/validis-api/4f258390ecab9-get-access-token-and-client-id Requests a JSON Web Token (JWT) for authentication and retrieves the Client ID. Requires an API key and grant type in multipart/form-data. ```APIDOC ## POST /v1/oauth/token ### Description Allows you to request a JSON Web Token (JWT) which can be used to authenticate API requests. Allows you to retrieve the Client ID that will be required for subsequent API requests. ### Method POST ### Endpoint https://api.sandbox.validis.com/v1/oauth/token ### Parameters #### Request Body (multipart/form-data) - **key** (string) - Required - API Key from Validis admin portal - **grant_type** (string) - Required - Default: vapi_key, Example: vapi_key ### Request Example ``` curl --request POST \ --url https://api.sandbox.validis.com/v1/oauth/token \ --header 'Accept: application/vnd.api+json, text/plain' \ --header 'Content-Type: multipart/form-data' \ --header 'Ocp-Apim-Subscription-Key: 123' \ --form key= \ --form grant_type=vapi_key ``` ### Response #### Success Response (200) - **access_token** (string) - JSON Web Token (JWT). - **token_type** (string) - The JWT grant type. Default: bearer - **expires_in** (integer) - Time in seconds until the access token expires. - **resellerId** (string) - The unique identifier of your reseller within the Validis system. - **clientId** (string) - The unique identifier of your organisation within the Validis system. - **permissions** (array[string]) - An obfuscated list of permissions granted by the token. - **userId** (integer) - The unique identifier of the user. - **username** (string) - The username of the user. - **vconnectClientId** (string) - The unique identifier of your Validis system, as provided by the Authentication endpoint. - **jti** (string) - JSON Web Token Id. #### Response Example ``` { "access_token": "eyJhbGciOiJIUzI1NiIs213213123vdssds.eyJyZXNlbGxlcklkIjoiN2NjMGMyZjUtODkwOC00N2U1LThhMjMtZTI3NTc1ZDQ4NGM2IiwiY2xpZW50SWQiOiIxNzEzMTJjYy01YjgyLTQ5YTUtYWJlOC0wM2M5ZDZiOTIwZjciLCJwZXJtaXNzaW9ucyI6WyJCQjNBQjAiLCJGRDY1MjgiLCI3Rk1LTlYiLCJBTEpQNDQiLCJMRjZVWDQiLCI4RjI0UFAiLCI5QzJET1AiLCIzRjk5NzIiLCI2UEdETTIiLCIzOUFLRE8iLCJCOTA5QzIiLCJaVVFSWDAiLCJHNjBOM0siLCJGRjc0NTEiLCJGMzlSVDEiLCIyUzNKTTciLCIxQkU2NjQiLCJETDM3UFoiLCJFR0RFNjQiLCI0NUVCMEEiLCI0Q0FBMUIiLCJGMzhOM0YiLCJQRDVMODgiLCJMQklGSDkiLCJUNzlTR1IiLCJOMEc1TEoiLCJZQTBWSzUiLCJZOEtSM1EiLCJYQk9TMUoiLCIxNEFCNTMiXSwicm9sZXMiOlsiY2xpZW50LmFwaSJdLCJleHAiOjE2OTYyOTQwNDQsInVzZXJJZCI6MTE3MTAsImp0aSI6ImMzNjRmMGVjLTA5ODYtNDJiOS04MWI4LTQ2OTViYmVjZWExMSIsImNsaWVudF9pZCI6InZhcGkiLCJ1c2VybmFtZSI6ImFwaUBleGFtcGxlLmNvbSIsInZjb25uZWN0Q2xpZW50SWQiOiIxNzEzMTJjYy01YjgyLTQ5YTUtYWJlOC0wM2M5ZDZiOTIwZjcifQ.DOSgcud9D7S9z1SqioBaCAlXzs3CsFXkz8MG8iGXAKs", "token_type": "bearer", "expires_in": 2344, "resellerId": "3rt6gj57-4078-9o70-2t78-e275759u87c6", "clientId": "171312cc-5b82-49a5-abe8-03c9d6b920f7", "permissions": [ "6P1DM2", "39A6DO", "B109C2", "ZUQAS0", "G10N3K", "FF0351", "F11RY2", "2S3JM7", "1BE333", "DL31QZ" ], "userId": 12310, "username": "api@example.com", "vconnectClientId": "d2c5961e-e54c-409e-860a-dc345342c3a9", "jti": "c364f0ec-0986-42b9-81b8-4695bbecea11" } ``` ### Error Handling - **400** - Bad Request (e.g., when using mock servers) - **401** - Unauthorized - **406** - Not Acceptable - **429** - Too Many Requests - **500** - Internal Server Error ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.