Generate Access Token
Implementation Examples of Access Token Generation in Various Programming Languages
Create access token by using HMAC-SHA256
An access token can be generated by combining the api_key and timestamp string with the provided api_secret.
Attribute
Description
api_key
Get it from your PAVE Developer dashboard
api_secret
Get it from your PAVE Developer dashboard
timestamp
UTC Datetime string, example: 2021-05-30T12:49:19Z
Examples in Different Languages:
$token = hash_hmac('sha256', '<username>:<api_key>@<timestamp>', '<api_secret');
// https://www.php.net/manual/en/function.hash-hmac.phpconst crypto = require('crypto');
const apiKey = 'your_api_key';
const apiSecret = 'your_api_secret';
const username = 'your_username';
const timestamp = Math.floor(Date.now() / 1000); // current Unix timestamp in seconds
const message = `${username}:${apiKey}@${timestamp}`;
const accessToken = crypto.createHmac('sha256', apiSecret).update(message).digest('hex');import hashlib
import hmac
import time
api_key = 'your_api_key'
api_secret = 'your_api_secret'
username = 'your_username'
timestamp = str(int(time.time())) # current Unix timestamp in seconds
message = f'{username}:{api_key}@{timestamp}'
access_token = hmac.new(api_secret.encode('utf-8'), msg=message.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()Last updated
