Search code examples
rubyjsonapioauth-2.0etsy

What Params need to be sent in with API request?


Hi am having some trouble sending my authenticated API request. I am trying to access the Etsy API. The access token has been obtained from a previous step.

access_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" #obfuscated intentionally
access_secret = "XXXXXXXXXX" #obfuscated intentionally

params = {:params => {:access_token => access_token}}
auth_result = JSON.parse(RestClient.get('https://openapi.etsy.com/v2/shops/MYSTORE/receipts', params))

It is coming back with a 400 error.

I think it is the way I am sending in the authentication. If anyone give me some guidance I would really appreciate it.


Solution

  • You can use: https://github.com/kytrinyx/etsy in order to communicate with the API.

    If you want to work with RestClient and implement everything by yourself, look at the hooks https://github.com/rest-client/rest-client#hook on how you can sign the request with the access token and secret.