API

Accessing the API Documentation

Navigate to your SELMA Settings and down to API at the bottom to view the API docs

Authentication

  1. Make a request to retrieve a ‘token’ from https://subdomain.selmasis.com/api/auth
    1. curl:
      1. curl --location --request POST 'https://subdomain.selmasis.com/api/auth' --header 'Authorization: Basic' --header 'Content-Type: application/json' --data-raw '{"username":"Production1","secret":"kU2YKi4fNUBDdi1Vzu4deQ1ljurhaS0Fv179hwbuv4pcx1Bs68R9sJLtFjF4u9ao"}'
    2. HTTP/REST
      1. POST https://subdomain.selmasis.com/api/auth Authorization: Basic Content-Type: application/json {"username":"Production1","secret":"kU2YKi4fNUBDdi1Vzu4deQ1ljurhaS0Fv179hwbuv4pcx1Bs68R9sJLtFjF4u9ao"}
  2. The token will be returned as a response.

Requests

To use the bearer token in API requests outside of the docs page make sure to add the bearer token to the header in all requests, these tokens are valid for 30 minutes.

curl:

curl --location 'https://subdomain.selmasis.com/api/example' \ --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1....'

HTTP/REST:

GET /api/exmaple HTTP/1.1 Host: subdomain.selmasis.com Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc…