AuthenticationObtain access token

Obtain access token

Získa access token cez OAuth 2.0 client_credentials.

curl -X POST "https://einvoice-v1-ynyiur6quq-ey.a.run.app/v1/sapi/auth/token" \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "example_string",
  "client_secret": "example_string",
  "grant_type": "client_credentials",
  "scope": "document:send document:receive"
}'
{
  "access_token": "example_string",
  "token_type": "Bearer",
  "expires_in": 900,
  "scope": "example_string",
  "refresh_token": "example_string"
}
POST
/v1/sapi/auth/token
POST
Base URLstring

Target server for requests. Edit to use your own host.

Content-Typestring
Required

The media type of the request body

Options: application/json
Request Preview
Response

Response will appear here after sending the request

Body

application/json
grant_typestring
Required
Allowed values:client_credentials
scopestring
Example:
document:send document:receive

Responses

access_tokenstring
token_typestring
Allowed values:Bearer
expires_ininteger

Životnosť tokenu v sekundách.

scopestring
refresh_tokenstring

Voliteľné, iba ak je obnova podporovaná.