#lets check the time $datestring = strftime "%a, %e %b %Y %H:%M:%S GMT", gmtime; #set the strings $method="GET"; $appid="d6468df6c1e8419fb5ec50f62be9a28b"; $appkey="15c7a6e1a5bd73500db29dffd0e19b6c6228b044c64348a6f5d6d470c54fc208"; $path="/xxxxxxxxxxxx/xxxxxxx/api/v1/users/xxxxx/factors"; #build the hash string $step1="$method\\n$datestring\\n$appid\\n$path"; #hmac sha256hash the string $step2a= encode_base64(hmac_sha256($step1, pack("H*",$appkey))); $step4="$appid:$step2a"; #encode value from step 4 into base 64 $step5 = encode_base64($step4); #now add Basic and the value from step 5 $step6 = ("Basic $step5");