Api Tokens - List
Get the list of API tokens in an application. The token value will never be returned for security reasons.
GET https://{subdomain}.{baseDomain}/api/apiTokens?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. |
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
List API tokens
Sample Request
GET https://appsubdomain.azureiotcentral.com/api/apiTokens?api-version=2022-07-31
Sample Response
{
"value": [
{
"id": "testtoken",
"roles": [
{
"role": "ca310b8d-2f4a-44e0-a36e-957c202cd8d4"
},
{
"role": "c495eb57-eb18-489e-9802-62c474e5645c",
"organization": "seattle"
}
],
"expiry": "2020-10-18T18:30:40.227Z"
}
]
}
Definitions
Name | Description |
---|---|
Api |
The API access token definition. |
Api |
The paged results of API tokens. |
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. |
ApiTokenCollection
The paged results of API tokens.
Name | Type | Description |
---|---|---|
nextLink |
string |
URL to get the next page of API tokens. |
value |
Api |
The collection of API tokens. |
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. |