/

Authentication

Get the access token to make API calls.


Introduction

Authentication is a mandatory process of verifying your identity as an UP42 user. Access to UP42 services is allowed or denied based on the identity of the requester.

The UP42 platform works based on the following structure: Project > Workflow > Block > Job. The access token is associated with a single project created by the UP42 user and it is also defined as a project token. The project token is created using 2 values: the project ID and project API key.

Requirements

For the API calls, we recommend using several third party tools (see table below).

ToolDescription
cURLcommand-line HTTP client for getting or sending data using URL syntax.
jqlightweight command-line tool for processing the JSON syntax.
jwt-clicommand-line tool for decoding the project token. This token is based
on JSON Web Tokens and uses a Hashed Message Authentication Code
(HMAC) based on SHA-512.

Get project credentials

To generate the project ID and project API key, please follow the steps below:

  1. If you do not have an UP42 account, register here.
  2. After registering, create a project on the console and locate the project credentials here.
  3. Create the project variables PROJ (project ID) and PKEY (project API key) using the following commands:
PROJ=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Get project token

After the project variables have been created, get the project token:

PTOKEN=$(curl -sX POST "https://$PROJ:$PKEY@api.up42.com/oauth/token" -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=client_credentials' | jq -r '.data.accessToken')

Please note that the token is valid for 5 minutes. To get a new token, recall the command by typing !PTOKEN.

Now that you have access to the UP42 services, you can proceed with the API calls.