constcrypto=require('crypto');constapiKey='your_api_key';constapiSecret='your_api_secret';constusername='your_username';consttimestamp=Math.floor(Date.now() /1000); // current Unix timestamp in secondsconstmessage=`${username}:${apiKey}@${timestamp}`;constaccessToken=crypto.createHmac('sha256', apiSecret).update(message).digest('hex');
import hashlibimport hmacimport timeapi_key ='your_api_key'api_secret ='your_api_secret'username ='your_username'timestamp =str(int(time.time()))# current Unix timestamp in secondsmessage =f'{username}:{api_key}@{timestamp}'access_token = hmac.new(api_secret.encode('utf-8'), msg=message.encode('utf-8'), digestmod=hashlib.sha256).hexdigest()
To generate the correct token, please make sure the combination string you are using with the 1) api_key, 2) timestamp and 3) api_secret are arranged in this order.
To generate the correct token, please ensure your timestamp is using UTC Datetime. And use the matching timestamp to the one included in your header when generating your token.
Replace
<username>
with the primary account name that your representative initially provided. Do not set this as one of the user names you created in your dashboard.