Api Tokens - Get
Get an API token by ID.
GET https://{subdomain}.{baseDomain}/api/apiTokens/{tokenId}?api-version=2022-07-31
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
base
|
path | True |
string |
The base domain for all Azure IoT Central service requests. |
subdomain
|
path | True |
string |
The application subdomain. |
token
|
path | True |
string |
Unique ID for the API token. |
api-version
|
query | True |
string |
The version of the API being called. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
An error response received from the IoT Central Service. Headers x-ms-error-code: string |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Get API token by ID
Sample request
GET https://appsubdomain.azureiotcentral.com/api/apiTokens/testtoken?api-version=2022-07-31
Sample response
{
"id": "testtoken",
"roles": [
{
"role": "c495eb57-eb18-489e-9802-62c474e5645c",
"organization": "seattle"
}
],
"expiry": "2020-10-18T18:30:40.227Z"
}
Definitions
Name | Description |
---|---|
Api |
The API access token definition. |
Error |
The response error definition. |
Error |
The detail information of the error. |
Role |
The role assignment definition. |
ApiToken
The API access token definition.
Name | Type | Description |
---|---|---|
expiry |
string |
String-formatted date representing the time when the token expires. |
id |
string |
Unique ID of the API token. |
roles |
List of role assignments that specify the permissions to access the application. |
|
token |
string |
Value of the API token. |
Error
The response error definition.
Name | Type | Description |
---|---|---|
error |
Error details for current request. |
ErrorDetails
The detail information of the error.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
message |
string |
Error message details. |
requestId |
string |
Correlation Id for current request. |
time |
string |
The time that error request failed. |
RoleAssignment
The role assignment definition.
Name | Type | Description |
---|---|---|
organization |
string |
ID of the organization for this role assignment. |
role |
string |
ID of the role for this role assignment. |