I am trying to test Digital Signatures for APIs and I'm having trouble with the signature header (https://developer.ebay.com/develop/guides/digital-signatures-for-apis#sig). In this example, I am using Excel VBA:
http.setRequestHeader "x-ebay-signature-key", jwe
http.setRequestHeader "signature", privateKey
http.setRequestHeader "signature-input", "sig1=(""x-ebay-signature-key"" ""@method"" ""@path"" ""@authority"");created=1666253648295"
jwe, privateKey and created time were acquired using the Management API createSigningKey call. I have noted that the creationTime in the API response has 13 digits instead of 10 like in the eBay example.
I receive the following response:
{
"errors": [
{
"errorId": 215114,
"domain": "ACCESS",
"category": "REQUEST",
"message": "The create time of signature parameters is not in right range",
"longMessage": "The create time of signature parameters is not in right range to fulfill the request."
}
]
}
I have tried using the 13 digit and 10 digits of the Unix timestamp, but get the same error with both. I presume that I am missing something, but am not sure what.
The Unix timestamp function I was using did not take into account daylight saving time in UK, so was 1 hour in the future. Having corrected this the timestamp is accepted.