Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST Agent sending token invalid #3357

Open
bionic-bill opened this issue Feb 19, 2024 · 0 comments
Open

POST Agent sending token invalid #3357

bionic-bill opened this issue Feb 19, 2024 · 0 comments

Comments

@bionic-bill
Copy link

Hello! I'm having a problem where my POST Agent set up seems to be sending my info out incorrectly. More likely I'm missing something but my curl request of the same data goes through no problem. Basically I'm setting up an ebay agent and with their new API i gotta use an oauth request to get a token refresh every two hours. I have the refresh token but running it through Huginn it comes back that the refresh token i'm sending is invalid. Here's my post agent:

{
  "post_url": "https://api.ebay.com/identity/v1/oauth2/token",
  "expected_receive_period_in_days": "1",
  "method": "post",
  "payload": {
    "grant_type": "refresh_token",
    " refresh_token": "{refresh_token}"
  },
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Basic {base64 encode of clientid and secret without brackets}"
  },
  "emit_events": "true"
}

which returns

[
  {
    "body": "{\"error\":\"invalid_grant\",\"error_description\":\"the provided authorization refresh token is invalid or was issued to another client\"}",
    "status": 400,
    "headers": {
      "X-Ebay-C-Request-Id": "ri=jp6eCs4cXLPj,rci=ba57f2ebd772d028",
      "Rlogid": "t6ldssk67%3D9iptldssk67*santo%28rbpv6762-18dc2c53012-0x15f",
      "X-Ebay-C-Version": "1.0.0",
      "X-Ebay-Client-Tls-Version": "TLSv1.2",
      "X-Frame-Options": "SAMEORIGIN",
      "X-Content-Type-Options": "nosniff",
      "X-Xss-Protection": "1; mode=block",
      "Content-Type": "application/json",
      "Server": "ebay-proxy-server",
      "X-Envoy-Upstream-Service-Time": "46",
      "X-Ebay-Pop-Id": "UFES2-LVSAZ01-api",
      "Content-Length": 131,
      "Expires": "Mon, 19 Feb 2024 19:08:39 GMT",
      "Cache-Control": "max-age=0, no-cache, no-store",
      "Pragma": "no-cache",
      "Date": "Mon, 19 Feb 2024 19:08:39 GMT",
      "Vary": "Accept-Encoding",
      "Set-Cookie": "ebay=%5Esbf%3D%23%5E;Domain=.ebay.com;Path=/; Secure, dp1=bu1p/QEBfX0BAX19AQA**69960e37^;Domain=.ebay.com;Expires=Wed, 18-Feb-2026 19:08:39 GMT;Path=/; Secure",
      "X-Cdn": "AKAMAI",
      "Strict-Transport-Security": "max-age=31536000"
    }
  }
]

and my curl request of the same data

.\curl.exe -X POST 'https://api.ebay.com/identity/v1/oauth2/token' -H 'Authorization: Basic {base64 encode of clientid and secret without brackets}' -d 'grant_type=refresh_token&refresh_token={refresh_token}'

which returns the refreshed access_token.

I've parsed down as much superfluous stuff as i can from both the curl and the agent but it still seems to not like it. Is there something i'm missing? maybe another way to put the token in so it's passed exactly? Any help would be appreciated. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant