Authentication
Get started
Oppna uses API keys to allow access to the API. You can register a new Oppna API token at our developer mail.
Oppna expects for the Basic Auth mechanism and API token to be included in all API requests to the server in a header that looks like the following:
Token: API_TOKEN Authorization: Basic <CREDENTIALS>
To authorize, use this code:
Code Implementation
Ruby
require 'Athletics'
api = Athletics::APIClient.authorize!('API_TOKEN')Python
API_TOKEN = "API_TOKEN"
header = {
"Accept": "*/*",
"Content-Type": "application/json",
"Authorization": "Basic <CREDENTIALS>"
"Token": API_TOKEN
}Curl
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
-H "Token: API_TOKEN" \
-H "Authorization: Basic <CREDENTIALS>"JS
const Header = new Headers();
Header.append("Content-Type", "application/json");
Header.append("Accept", "*/*");
Header.append("Authorization", "Basic <CREDENTIALS>");
Header.append("Token", API_TOKEN);Golang
const Athletics = go('Athletics');
let api = Athletics.authorize('API_TOKEN');Warning You must replace API_TOKEN with your personal API token and CREDENTIALS with Basic Auth Header, can refer to this link.
Last updated
Was this helpful?