API - introduction

Opprettet av Mikael Fidjeland, Endret Mon, 26 Aug, 2024 ved 3:56 PM av Mikael Fidjeland


Documentation

The REST API is documented with OpenAPI/Swagger here: https://test-api.sirktek.com/assets/v1/q/swagger-ui/#



Authentication and authorization

Access to the API is granted by Oauth2 Client Credentials flow. You need a machine-to-machine authentication client set up, please contact support@sirktek.com for further information.


Once this client is set up, you will receive a client id and a client secret. To exchange your credentials (ie. client id and client secret) with an access token, perform a HTTP request like this:


curl --request POST \
  --url <auth endpoint> \
  --header 'content-type: application/json' \
  --data '{"client_id":"<client id>","client_secret":"<client secret>","audience":"<audience>","grant_type":"client_credentials"}'


The response will be a JSON with an access token:

{"access_token":"eyJhbGc...","expires_in":86400,"token_type":"Bearer"}


There are quotas restricting number of tokens that can be issued, so you must store the token and reuse it as long as it is not expired.



This token can then be used when invoking the API:

curl --request GET  --url http://path_to_your_api/  --header 'authorization: Bearer <access token>'


All resources that are created will be owned by the organization the user (or integrating system) belongs to. If the user belongs to multiple organizations and a new resource is created, the 

X-auth-owner

HTTP header must be set on the request (typically POST requests).


Endpoints

EnvironmentRoot URLAuth audienceAuth endpoint
Staging
https://test-api.sirktek.com/

https://test-api.sirktek.com/assets
https://test-auth.sirktek.com/oauth/token













Var denne artikkelen nyttig?

Så bra!

Takk for din tilbakemelding

Beklager at vi ikke kunne være mer til hjelp

Takk for din tilbakemelding

Fortell oss hvordan vi kan forbedre denne artikkelen.

Velg minst én av grunnene
CAPTCHA-verifisering er obligatorisk.

Tilbakemeldingen er sendt inn

Vi setter pris på tilbakemeldingen din og vil prøve å rette på artikkelen