Get an access token
AI translated from the German original
Exchange tenant ID, key ID and secret for a bearer token.
POST https://sml-api.io/tokenEvery API call needs an access token. You get it with an API key.
Parameters
Section titled “Parameters”| Field | Type | Description |
|---|---|---|
| tenantId | Text | ID of your Microsoft 365 tenant. It is also in the Admin Center address: https://manage.seamlesswork.com/{tenantId}/... |
| keyId | Text | ID of your key under Settings → API keys |
| secret | Text | Secret you stored when creating the key |
Request
Section titled “Request”curl -X POST https://sml-api.io/token \ -H "Content-Type: application/json" \ -d '{"tenantId":"00000000-0000-0000-0000-000000000000","keyId":"e37e2481-7892-4808-8b07-f0a81bb50c11","secret":"<secret>"}'$body = @{ tenantId = '00000000-0000-0000-0000-000000000000' keyId = 'e37e2481-7892-4808-8b07-f0a81bb50c11' secret = '<secret>'} | ConvertTo-Json
$token = (Invoke-RestMethod -Method Post -Uri 'https://sml-api.io/token' ` -ContentType 'application/json' -Body $body).accessToken$headers = @{ Authorization = "Bearer $token" }using System.Net.Http.Headers;using System.Net.Http.Json;using System.Text.Json;
var http = new HttpClient { BaseAddress = new Uri("https://sml-api.io") };var res = await http.PostAsJsonAsync("/token", new { tenantId = "00000000-0000-0000-0000-000000000000", keyId = "e37e2481-7892-4808-8b07-f0a81bb50c11", secret = "<secret>"});var json = await res.Content.ReadFromJsonAsync<JsonElement>();var token = json.GetProperty("accessToken").GetString();http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);Response
Section titled “Response”{ "accessToken": "eyJ0eXAiOiJKV1Qi...", "tenantId": "00000000-0000-0000-0000-000000000000", "expiresAt": "2026-10-22T10:27:27.7458568Z"}| Field | Description |
|---|---|
| accessToken | Token for all further calls |
| tenantId | ID of your tenant |
| expiresAt | Expiry of the token |