Authentication

Using your clientKey and clientSecret you can request for a token by calling the dedicated method (note: replace asterisks with your clientKey and clinetSecret)

/curl -X POST \
 https://explore.cloud4wi.com/v1/sts/login/services \
 -H 'Cache-Control: no-cache' \
 -H 'Content-Type: application/json' \
 -H 'accept: application/json' \
 -d '{
 "clientKey":"ck-********-****-****-****-************",
 "clientSecret":"********************************"
}'/curl -X POST \

If the client key and secret are correct, then the API will return a JWT token.

{"token":[[JWT_TOKEN]]"}
curl -X GET \
 'https://explore.cloud4wi.com/v2/customers/organizations/[[CID]]?sortBy=created_absolute&sortReverse=false' \
 -H 'Authorization: Bearer [[JWT_TOKEN]]' \
 -H 'Cache-Control: no-cache' \
 -H 'accept: application/json'

The JWT token expires after one day; to get a new one, restart and call again /v1/sts/login/services.

AuthN/AuthZ Flow

Endpoints

Use your client key and client secret to retrieve a valid authentication token

Get authentication token

Returns a JWT token inside the body and in the Authorization Header of the response

POSThttps://explore.cloud4wi.com//v1/sts/login/services
Body
clientKeystring
clientSecretstring
Response

User authenticated

Body
tokenstring

JWT token

Request
const response = await fetch('https://explore.cloud4wi.com//v1/sts/login/services', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "token": "text"
}

You can manually revoke a token using the following end-point:

Revoke authetnication Token

It revokes the JWT token passed in the header.

POSThttps://explore.cloud4wi.com//v1/sts/logout
Response

The token has been revoked

Request
const response = await fetch('https://explore.cloud4wi.com//v1/sts/logout', {
    method: 'POST',
    headers: {},
});
const data = await response.json();

Last updated