--{gateway-url}} = /v2/
-- {{gateway-host}} = api-worldcheck.refinitiv.com
--{{currentDate}} = DateTime.Now.ToString("r")
-- {{content}} = application/json
@{
string dataToSign = "(request-target): post " + (string)context.Variables["url"] + "cases" + "\nhost: " + (string)context.Variables["host"] + "\ndate: " + (string)context.Variables["date"] + "\ncontent-type: " + (string)context.Variables["content"] + "\ncontent-length: " + (string)context.Variables["bodySize"] + "\n" + (string)context.Variables["body"];
var hash = new System.Security.Cryptography.HMACSHA256(Encoding.UTF8.GetBytes("{{api-secret}}")).ComputeHash(Encoding.UTF8.GetBytes(dataToSign));
var hmac = System.Convert.ToBase64String(hash);
var authorisation = "Signature keyId=\"{{api-key}}\",algorithm=\"hmac-sha256\",headers=\"(request-target) host date content-type content-length\",signature=\"" + hmac + "\"";
return authorisation;
}
@((string)context.Variables["date"])
@((string)context.Variables["content"])
{{api-key}} and {{api-secret}} are access details provided for pilot account