...
Paste code macro |
---|
language | python |
---|
title | GET Authorisations (Python) |
---|
|
import requests
client_id = "3430986450301641"
client_secret = "change_me"
host = "https://fi.trivoreid.com"
endpoint = "/api/rest/v1/authorisation"
url = host + endpoint
# look only for items that are owned by the organisation with code "root"
params = {"filter": "nsCode eq \"root\"" }
response = requests.get(url, params = params, auth = (client_id, client_secret))
print(response.status_code)
print(response.json()) |
Paste code macro |
---|
language | bash |
---|
title | GET Authorisations (curl) |
---|
|
curl -X 'GET' \
'https://fi.trivoreid.com/api/rest/v1/authorisation?filter=nsCode%20eq%20%22root%22' \
-H 'accept: application/json' \
-H 'Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=' |
To fetch the contents of a single Authorisation, simply append the internal id of the Authorisation to the request URL. The example below demonstrates this practice.
...