Mint Service Token
POST
/api/v1/services/token
const url = 'https://api.spartanauth.com/api/v1/services/token';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.spartanauth.com/api/v1/services/tokenExchanges an X-Service-Secret header for a one-hour JWT that names the service. Public. The secret is not a user credential and cannot call other SpartanAuth APIs.
Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
token
string
expiresIn
string format: int64
serviceID
string
serviceName
string
sectorID
string
Example generated
{ "token": "example", "expiresIn": "example", "serviceID": "example", "serviceName": "example", "sectorID": "example"}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}