How do I format the hashed values for the Get Token Request?

When requesting to Get a Token, there are four data fields required:

  • UserName
  • Timestamp
  • PasswordHash
  • UserNameHash

UserName: This is your Site UserName, available from your Test API Keys.

Timestamp: This is the current Timestamp in UTC, in the format yyyy-MM-ddTHH:mm:ss.fffZ. See https://trustev.zendesk.com/hc/en-gb/articles/202881529-What-format-is-accepted-for-the-Timestamp-, for more information.

PasswordHash: This is a hashed value, and there are two steps to it's formation:

Part 1: Create a SHA256Hash of a String in the format {0}.{1}, where {0} is the Timestamp as above, and {1} your Site Password, which is available from your Test API Keys.

Part 2: Create a SHA256Hash of a String in the format {0}.{1}, where {0} is the result of Part 1, and {1} is your Shared Secret which is available from your Test API Keys.

UserNameHash: This is a hashed value, and there are two steps to it's formation:

Part 1: Create a SHA256Hash of a String in the format {0}.{1}, where {0} is the Timestamp above, and {1} is your Site UserName which is available from your Test API Keys.

Part 2: Create a SHA256Hash of a String in the format of {0}.{1}, where {0} is the result of Part 1, and {1} is your Shared Secret which is available from your Test API Keys.

Please take note of the '.' (dot) required when forming the hashed values.

See PHP Code example of the hashed formation:

$passwordHash = $this->Get256Hash($timestamp . "." . $password);
$passwordHash = $this->Get256Hash($passwordHash . "." . $secret);
$usernameHash = $this->Get256Hash($timestamp . "." . $username);
$usernameHash = $this->Get256Hash($usernameHash . "." . $secret);

 

 

Have more questions? Submit a request

Comments

+1-917-336-7076
Facebook Linkedin Twitter
Powered by Zendesk