Endpoints

Uanataca expose its API on urls composed as follows:

https://{uanatacahost}/api/{version}/{resource}/

The {uanatacahost} changes according to the environment:

  • access.bit4id.org:13035 if the environment is test
  • api.uanataca.com if the environment is production

{version} is the api version (currently v1) and {resource} is the name of the resource of our interest.

In test environment you need to trust the certificate Bit4idCA.crt

Each resource can also have path parameters and sub-resources:

https://{uanatacahost}/api/{version}/{resource}/{param}/{sub-resources}/

Make sure the URL always ends with a forward slash ("/")

These are some examples of endpoints exposed by Uanataca:

https://api.uanataca.com/api/v1/requests/
https://api.uanataca.com/api/v1/requests/123/
https://api.uanataca.com/api/v1/requests/123/cloud_enroll/

Authentication

The API authentication is perfomed providing to the server the certificate and the key of an enabled User.

This is an example HTTP POST request perfomed with curl:

curl --key key.pem --cert cert.pem -H "Content-Type: application/json" -d @params.json -X POST https://api.uanataca.com/api/v1/requests/

and a Python with requests package example:

import requests
requests.get(
    'https://api.uanataca.com/api/v1/scratchcards/',
    cert = ('/path/to/cert.pem', '/path/to/key.pem')
)

Methods Allowed

The Uanataca API is based on a REST architecture. Each endpoint is accessed through HTTPS and when possible accept these HTTP verbs:

Method Action
GET Retrieves objects
POST Creates objects
PUT Changes objects

These are some examples using curl:

curl -X GET https://api.uanataca.com/api/v1/requests/
curl -d @params.json -X POST https://api.uanataca.com/api/v1/requests/123/approve/
curl -d @params.json -X PUT https://api.uanataca.com/api/v1/requests/123/