Exchange Auth Token
POSThttps://api.immersve.com/auth/token
This endpoint can be used to request a new access token using a refresh token.
Request
Header Parameters
origin stringrequired
Origin header to specify the origin of the request.
- application/json
Bodyrequired
refreshTokenstringrequired
JWT that is used to request a new access token. (Valid for 30 days.)
Example:
eyJhbGciOiJSUzI1NiIsI...
clientApplicationIdstringrequired
Id of the client application.
Example:
29097f50d221858223a17633e36716f9
Responses
- 200
- 403
successful operation
- application/json
- Schema
- Example (auto)
Schema
accessTokenstring
The new access token that will be used for subsequent authenticated requests. This token replaces the previous access token that has expired or is about to expire.
Example:
eyJhbGciOiJSUzI1NiIsI...
refreshTokenstring
The new refresh token to request a new access token.
Example:
eyJhbGciOiJSUzI1NiIsI...
{
"accessToken": "eyJhbGciOiJSUzI1NiIsI...",
"refreshToken": "eyJhbGciOiJSUzI1NiIsI..."
}
REFRESH_TOKEN_EXPIRED The refresh token has expired.
CLIENT_APPLICATION_MISMATCH The client application does not match the refresh token.
ORIGIN_NOT_ALLOWED The origin is not allowed to access this endpoint.
- application/json
- Schema
- Example (auto)
Schema
statusCodeintegerrequired
Example:
403
statusNamestringrequired
Example:
Forbidden
errorCodestringrequired
Example:
FORBIDDEN
reasonstring
Example:
Unauthorized
{
"statusCode": 403,
"statusName": "Forbidden",
"errorCode": "FORBIDDEN",
"reason": "Unauthorized"
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.immersve.com/auth/token");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"refreshToken\": \"eyJhbGciOiJSUzI1NiIsI...\",\n \"clientApplicationId\": \"29097f50d221858223a17633e36716f9\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear