cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Digital Signature doesnt work with query parameters

Hello,

I'm trying to work with Digital Signature for Financing API. Followed the documentation on 'Creating a payload signature' page and everything seems to be well regarding GET requests. I get successfull response from 'sell/finances/v1/transaction' endpoint. The problem is that If I did limit or any other parameter, I keep getting error 215122. Is there a way to include more details in these errors, whats wrong exactly?

My original successfull signature Base:

var signatureParams = "(\"x-ebay-signature-key\" \"@authority\" \"@method\" \"@path\" );created=" + tenCharTimestamp;


string signatureBase =
$"\"x-ebay-signature-key\": {keyResponse.Jwe}\n" +
$"\"@authority\": apiz.ebay.com\n" +
$"\"@method\": GET\n" +
$"\"@path\": {endpoint}\n" +
$"\"@signature-params\": {signatureParams}";

 

While adding query parameters I get error:

                string signatureParams = "(\"x-ebay-signature-key\" \"@authority\" \"@method\" \"@path\" \"@query\" );created=" + tenCharTimestamp;

"@query" added to signatureParams.

 string signatureBase =
$"\"x-ebay-signature-key\": {keyResponse.Jwe}\n" +
$"\"@authority\": apiz.ebay.com\n" +
$"\"@method\": GET\n" +
$"\"@path\": {endpoint}\n" +
$"\"@query\": ?limit=200\n" +
$"\"@signature-params\": {signatureParams}";


@query with '?limit=200' added to signatureBase. as per documentation of 'limit=integer&'.


Looking at rfc9421 documentation I can't see any difference if I should be using it in any different manner?

Any help would be appreciated.

Message 1 of 3
latest reply
1 BEST ANSWER

Accepted Solutions

Digital Signature doesnt work with query parameters

Hi, thank you for your reponse.

After multiple failures I found out that signatureBase doesn't require @query to be added.. which was really annoying as this is what documentation expects and thats what I was trying to complete. 

 

The resolution was basically to add parameters to http request, so even so you are calling for example:
https://apiz.ebay.com/sell/finances/v1/transaction?limit=200

 

your signatureBase stays unchanged like this:

 

 

var signatureParams = "(\"x-ebay-signature-key\" \"@authority\" \"@method\" \"@path\" );created=" + timeStamp;

string signatureBase =
$"\"x-ebay-signature-key\": {keyResponse.Jwe}\n" +
$"\"@authority\": apiz.ebay.com\n" +
$"\"@method\": GET\n" +
$"\"@path\": /sell/finances/v1/transaction\n" +
$"\"@signature-params\": {signatureParams}";

 

As you can see, no @query is added to the signature base. 

I hope this helps anyone looking for this in the future.

View Best Answer in original post

Message 3 of 3
latest reply
2 REPLIES 2

Digital Signature doesnt work with query parameters

Hello,

This can be tricky to debug, but let's see if we can narrow it down.

Here are a few things to check:

  1. Signature Base Format: Ensure that your signature base is correctly formatted. Double-check that there are no extra spaces or incorrect line breaks. The signature base should look like this:

     "x-ebay-signature-key": {keyResponse.Jwe}
    "@authority": apiz.ebay.com
    "@method": GET
    "@path": {endpoint}
    "@query": ?limit=200
    "@signature-params": ("x-ebay-signature-key" "@authority" "@method" "@path" "@query" );created=timestamp

  2. Query Parameter Format: Make sure the query parameters are correctly formatted. For example, ?limit=200 should be part of the @query field.

  3. Timestamp: Verify that the timestamp is correctly formatted and matches the required format.

  4. Signature Calculation: Ensure that the signature is correctly calculated using the private key. You might want to use an SDK or a tool provided by eBay to generate the signature

Message 2 of 3
latest reply

Digital Signature doesnt work with query parameters

Hi, thank you for your reponse.

After multiple failures I found out that signatureBase doesn't require @query to be added.. which was really annoying as this is what documentation expects and thats what I was trying to complete. 

 

The resolution was basically to add parameters to http request, so even so you are calling for example:
https://apiz.ebay.com/sell/finances/v1/transaction?limit=200

 

your signatureBase stays unchanged like this:

 

 

var signatureParams = "(\"x-ebay-signature-key\" \"@authority\" \"@method\" \"@path\" );created=" + timeStamp;

string signatureBase =
$"\"x-ebay-signature-key\": {keyResponse.Jwe}\n" +
$"\"@authority\": apiz.ebay.com\n" +
$"\"@method\": GET\n" +
$"\"@path\": /sell/finances/v1/transaction\n" +
$"\"@signature-params\": {signatureParams}";

 

As you can see, no @query is added to the signature base. 

I hope this helps anyone looking for this in the future.

Message 3 of 3
latest reply