Management API Tokens
The Xporter REST API supports token authorisation using a custom bearer style Authorization
header.
Example authorization header
Authorization: Idaas {STSToken}
Generating a Management API Token
To generate a token, a POST is made to the Xporter STS and an object is returned containing the token
POST Object Fields
Field | Type | Example | Description |
---|---|---|---|
estab | String | 3281102 | School establishment number you are generating a token for |
relyingParty | String | app.example.dev | Your application Id |
password | String | b9aef7a6-3ee4-4935-98ff-6afe46447213 | Your application management or school secret |
thirdpartyid | String | XporterOnDemand | The service for which you are authenticating (Always "XporterOnDemand" ) |
Generate Management API Token
Ommit or send "estab":""
and pass your managementSecret
:
curl --request POST \
--url https://xporter.groupcall.com/api/oauth/GetToken \
--header 'Content-Type: application/json'
--data '
{
"relyingParty":"{applicationId}",
"password":"{managementSecret}",
"thirdpartyid":"XporterOnDemand"
}
'
Important
The management token generated by this request will not grant access to school data API endpoints.
Token Responses
Example Successful Response
{
"token": "JhS0X....esMbPoHUOY=",
"expires": "2021-04-17T09:34:46.402555Z",
"Message": null,
"ExceptionType": null,
"ExceptionMessage": null,
"InnerException": null
}
You will want to save/store the token with its expiry
value so you can refresh the token ahead of time.
Example Failed Response
{
"token": null,
"expires": "0001-01-01T00:00:00",
"Message": null,
"ExceptionType": null,
"ExceptionMessage": "Relying Party not found for estab or secret not correct",
"InnerException": null
}
Example AuthorisationPaused Response
{
"token": null,
"expires": "0001-01-01T00:00:00",
"Message": null,
"ExceptionType": null,
"ExceptionMessage": "Authorisation is currently paused while the school finalises the selection of people they wish to include in this feed.",
"InnerException": null
}
``