Estimated reading time: < 1 min

How to generate an Autochartist security token

When embedding Autochartist content, you will be required to generate a security token. The token is of the form:

MD5([UserID]|[AccountType]|[Expiry][SecretKey])

UserID – unique identifier of the user for which you are generating the token
AccountType – 0 = LIVE, 1 = DEMO
Expiry – Unix timestamp of when this token will expire
SecretKey – the secret key provided to you during your onboarding process

Notes:

  1. The value of the UserID, AccountType and Expiry parameters need to match the values used in the URL in which the token is being used
  2. Note the ‘|’ (Pipe) character before and after the AccountType parameter

Here is some example code in PHP code:

<?php

   $expiryDate = time() + (3 * 24 * 60 * 60);
$userid = “userid”;
$accountType = “0”;
$secretKey = “secretkey”;
$token = md5(“${userid}|${accountType}|${expiryDate}${secretKey }”);
echo $token;

?>

Was this article helpful?
Dislike 0
Views: 20