Connecting to Revolut sandbox

吃可爱长大的小学妹 提交于 2020-08-24 10:42:28

问题


I'm trying to create a client connection to Revolut. I'm following their tutorial, however im'm stuck at Exchange Authorisation Code.

What i have done so far:

  1. Created business account on their sanbox
  2. Added my public key here https://sandbox-business.revolut.com/settings/api
  3. Activated my API Certificate via Enable API access to your account(i went through all the steps and got information that access is now enabled), however i can still see Access is not enabled on my API certificate
  4. created JWT token and signed it with my private key (verified it with https://jwt.io/)
  5. send request for access token like this (done via postman):

    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
    

however the response is:

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

Now im not sure it there is something im doing wrong with requesting access token or is it due to step 3, where it seems that activation of my API Certificates went fine but then i see it as not activated. Could you verify my steps to help me determine where the issue is?


回答1:


Turns out Authorisation Code is valid 2 min only, after that time you have to request another one.



来源:https://stackoverflow.com/questions/59823619/connecting-to-revolut-sandbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!