【问题标题】:square:connect - Not able to renew merchant access tokensquare:connect - 无法更新商家访问令牌
【发布时间】:2018-05-25 13:58:48
【问题描述】:

我是第一次更新商家令牌并收到此错误响应:{ message: 'invalid value for parameter \'access_token\'', type: 'not_found' }

它在 10 天前过期,所以我在 15 天内续订:

{"access_token":"sq0....","token_type":"bearer","expires_at":"2017-12-01T20:40:00Z","merchant_id": ...}

标头应该是正确的,因为错误是从 Access 标头到上面的。谢谢!

【问题讨论】:

  • 你能添加你用于请求的 url 和标题吗?

标签: square-connect


【解决方案1】:

请记住,OAuth 端点与其他端点略有不同。你需要记住你需要你的client_id作为url:https://connect.squareup.com/oauth2/clients/{{client_id}}/access-token/renew 以及授权中的oauth_secret和json正文中的access_token

在 cURL 请求中,它可能如下所示:

curl -X POST \
  https://connect.squareup.com/oauth2/clients/sq0idp-xxxxx/access-token/renew \
  -H 'authorization: Client  sq0csp-xxxxx' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
"access_token": "sq0atp-xxxxxx"
}

密切注意sq0idpsq0cspsq0atp 标记在您自己的代码中的位置。

【讨论】:

  • 谢谢,特里斯坦!原来我们使用我同事的帐户来设置这个商家,所以我使用了错误的客户 ID 和密码。现在一切就绪!
  • oauth 似乎不太可能被破坏,但并非不可能 ?
  • '客户'是什么让我。谢谢!
猜你喜欢
  • 2017-06-19
  • 2014-02-26
  • 2020-08-11
  • 1970-01-01
  • 1970-01-01
  • 2018-06-24
  • 2018-09-23
  • 1970-01-01
  • 2013-08-23
相关资源
最近更新 更多