Authenticating with the UNL API

You can interact with the UNL apis using oauth2 client_credentials flow.

To obtain a set of credentials for use in the hackathon send email to hi@unl.global

Once you have your client id and secret, you may generate an access token by making a POST request to https://unl-dev.eu.auth0.com/oauth/token with the following body.

{
"client_id":"$YOUR_CLIENT_ID",
"client_secret":"$YOUR_CLIENT_SECRET",
"audience":"api.unl.global/v1",
"grant_type":"client_credentials"
}

In the response you will receive a temporary token. Add this token as a Bearer authentication header in all subsequent requests. For example to convert a UNL cell id to a set of coordinates use the location api

curl --location --request GET 'https://uae-hackathon.api.unl.global/v1/location/words/somewhat.resorting.shipborne' \
--header 'Authorization: Bearer $YOUR_AUTHENTICATION_TOKEN'
{
"words": "somewhat.resorting.shipborne",
"geohash": "thrq94sbv",
"coordinates": {
"lat": 25.062712,
"lon": 55.246017,
"elevation": 0,
"elevationType": "floor"
},
"httpStatusCode": 200
}

The complete reference documentation can be viewed on the documentation page. https://documenter.getpostman.com/view/8302701/SWEB2bfj?version=latest