连接到 Revolut 沙箱

Connecting to Revolut sandbox

我正在尝试创建到 Revolut 的客户端连接。我正在关注他们的 tutorial,但我卡在了 交换授权码

到目前为止我做了什么:

  1. 在他们的 sanbox
  2. 上创建了企业帐户
  3. 在此处添加了我的 public 密钥 https://sandbox-business.revolut.com/settings/api
  4. 通过 启用 API 访问您的帐户 激活了我的 API 证书(我完成了所有步骤并获得了现在已启用访问的信息) ,但是我仍然可以在我的 API 证书上看到 Access is not enabled
  5. 创建了 JWT 令牌并使用我的私钥对其进行了签名(使用 https://jwt.io/ 对其进行了验证)
  6. 像这样发送访问令牌请求(通过邮递员完成):

    curl --request POST \
      --url https://sandbox-b2b.revolut.com/api/1.0/auth/token \
      --header 'Accept: */*' \
      --header 'Accept-Encoding: gzip, deflate' \
      --header 'Cache-Control: no-cache' \
      --header 'Connection: keep-alive' \
      --header 'Content-Length: 596' \
      --header 'Content-Type: application/x-www-form-urlencoded' \
      --header 'Host: sandbox-b2b.revolut.com' \
      --header 'User-Agent: PostmanRuntime/7.20.1' \
      --header 'cache-control: no-cache' \
      --data 'grant_type=authorization_code&code=oa_sand_xxx&client_id=xxx&client_assertion_type=xxx&client_assertion=xxx
    

然而响应是:

{
    "error": "unauthorized_client",
    "error_description": "Incorrect request token"
}

现在我不确定是不是我在请求访问令牌时做错了什么,还是由于第 3 步,我的 API 证书似乎激活正常,但后来我发现它不是活性。您能否验证我的步骤以帮助我确定问题出在哪里?

原来授权码只有2分钟有效,过了那段时间你就得再申请一个。