- sha1: documentation ( source)
- base64_encode: documentation ( source)
- gmdate: documentation ( source)
- json_encode: documentation ( source)
- md5: documentation ( source)
<?php
$username = "robstark@winterfell.com";
$secretKey = sha1("L1v3rp00@");
$verb = ‘POST’;
$body = json_encode("{\"Request\":{\"satn\":\"213456\"},\"emailAddress\":\"robstark@winterfell.com\"}");
$contentmd5 = base64_encode(md5($body, true));
$contentType = "application/json";
$dateNow = gmdate("c");
$authCode = base64_encode(hmac-sha1($secretKey, $verb . ‘\n’ . $contentmd5 . ‘\n’ . $contentType . ‘\n’ . $dateNow));