Create
Creates new personal access key.
POST https://api.tedee.com/api/v1.30/my/personalaccesskey
Body Parameters
Name |
Type |
Description |
---|---|---|
name |
string |
name of the personal access key |
validTo |
datetime |
date when key expires (max 5 years) |
scopes |
string[] |
table of scopes that is assigned to key |
Responses
Name |
Type |
Description |
---|---|---|
201 Created |
successful operation |
Scopes
Name |
Description |
---|---|
Account.ReadWrite |
Grants user possibility to read and write data connected with account |
Examples
Sample request
curl -X POST "https://api.tedee.com/api/v1.30/my/personalaccesskey" -H "accept: application/json" -H "Content-Type: application/json-patch+json" -H "Authorization: Bearer <<access token>>" -d "<<body>>"
Body:
{
"name": "SomeExampleKeyName",
"validTo": "2021-04-26T06:02:04.197Z",
"scopes": [
"Device.Read",
"Organization.ReadWrite"
]
}
Sample response
HTTP status code: 201
{
"result": {
"id": "bcc1fdc9-13ee-43b3-a13e-eaba8eaf7996",
"key": "smnxaz.IWA6u00VLQmA8tlfioDXcH+bSiI6u8LgTG9cv3Evh/E"
}
"success": true,
"errorMessages": [],
"statusCode": 201
}
Your Personal Access Key is “smnxaz.IWA6u00VLQmA8tlfioDXcH+bSiI6u8LgTG9cv3Evh/E”. You can use it to authenticate.
Warning
Keep your Personal Access Key safe!
Note
Personal Access Key cannot be read in any other way.