3

I use MKM API 2.0 to get information about cards. All requests without query params work but when I try with these params, it doesn't work.

Here is the request:

https://api.cardmarket.com/ws/v2.0/products/find?search=Springleaf&idGame=1&idLanguage=1

Thanks to MKM OAuth Header tutorial, I split URL and query parameters and create the signature. Here is the requestUrl without params:

https://api.cardmarket.com/ws/v2.0/products/find

The paramString to concatenate with requestUrl:

idGame=1&idLanguage=1&oauth_consumer_key=XXXXXX&oauth_nonce=1552827037778&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1552827037&oauth_token=&oauth_version=1.0&search=SpringLeaf

Finally I got this which respects the tutorial:

GET&https%3A%2F%2Fapi.cardmarket.com%2Fws%2Fv2.0%2Fproducts%2Ffind&idGame%3D1%26idLanguage%3D1%26oauth_consumer_key%3DXXXXXXXXX%26oauth_nonce%3D1552827037778%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1552827037%26oauth_token%3D%26oauth_version%3D1.0%26search%3DSpringleaf

But I still have 401 error. Do you have any idea?

Request page: https://api.cardmarket.com/ws/documentation/API_2.0:Find_Products

Tutorial: https://api.cardmarket.com/ws/documentation/API:Auth_OAuthHeader#2._Parameters

Thank you!

Axelmov74
  • 33
  • 4
  • As far i know you need to have: App Token App Secret Access Token Access Token Secret .Those must be unique and you can get them having seller account. Code 401 suggest you dont have yours. – despi23 May 15 '19 at 01:42
  • if non-query requests work, its not a problem with the Tokens. I ran into this problem by forgetting to append the query parameters to the url when creating the http request, so make sure you do `WebRequest.CreateHttp(urlWithQueryParams)`. – h3n Dec 04 '19 at 02:32
  • 1
    from the [doc](https://api.cardmarket.com/ws/documentation/API_2.0:Response_Codes): 401 Unauthorized You get a 401 Unauthorized HTTP status, when authentication or authorization fails during your request, e.g. your Authorization (signature) is not correct. In my case I messed up with headers, however it may be something related to the sign algorithm or the signature base64 encoding – Daniele Jan 29 '20 at 15:23

0 Answers0