PHP Token Generator Code
Example PHP code to generate an API Token
<?php
/*
The secret that should already have been provided
*/
$tokenConfig['secret'] = 'testtoken';
/*
IP address of the user making the request
*/
$tokenConfig['ipaddress'] = '1.2.3.4';
/*
Timestamp in milliseconds - use date('U')*1000 to get current time
*/
$tokenConfig['timestamp'] = "1385554442935"; //date('U')*1000;
/*
Generated token
*/
$token = hash_hmac('md5', implode(':', $tokenConfig), $tokenConfig['secret']);
?>Example
Last updated
Was this helpful?