Re: Token Validation Failed (9201) for foreignexchangerates
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Token Validation Failed (9201) for foreignexchangerates
I got this error when trying to call https://api.visa.com/forexrates/v2/foreignexchangerates API and use x-pay-token for authentication
I have tried request to HelloWorld API and it worked.
Here is my request headers
POST /forexrates/v2/foreignexchangerates?apiKey=U0ZA115Y7BUYIQXJTGUF21PwqciBWLoKc-R5p-mloS0DCI1ro HTTP/1.1
x-pay-token: xv2:1685707360:534e3b01f238247677213a07266b8d58bdb431d44a0038460d38307de9588d7f
Content-Type: application/json
User-Agent: PostmanRuntime/7.32.2
Accept: */*
Postman-Token: 7cd60b08-d07d-4bd8-8bda-82fc5a190ff8
Host: api.visa.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 102
Here is my request body
{"rateProductCode":"A","destinationCurrencyCode":840,"destinationAmount":100,"sourceCurrencyCode":764}
Here is my response
{"responseStatus":{"status":401,"code":"9201","severity":"ERROR","message":"Token Validation Failed","info":""}}
Here is my postman pre-request script
Here is my credential page
Please help.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Token Validation Failed (9201) for foreignexchangerates
Thank you for reaching out, @TTBBANK. An agent will get back to you as soon as possible. In the meantime, if any community member knows the solution, please reply to this thread!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Token Validation Failed (9201) for foreignexchangerates
Hi @TTBBANK
The 401 Token Validation Failed error you're getting will be seen when the x-pay-token sent in the header is invalid.
A couple of things I'd like you to note while generating the token:
- For starters, please follow the getting started documentation to generate a valid token. https://developer.visa.com/pages/working-with-visa-apis#get-started-overview
- APIkey in the url query param should be the same as the one used to generate xpayToken
- “resourcePath” sent in the xpaytoken has to be as per the documentation (eg: v2/payments?apikey={apikey}).
- Payload sent in the request payload should exactly match along with spaces to the “requestBody” value used in xpaytoken.
Also, could you check to see if you're passing a correct value for URI. For example, make sure it’s defined correctly in the beginning of your code, and use the same value for the URI in the middle of your code.
Thanks,
Illana
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Token Validation Failed (9201) for foreignexchangerates
Were you able to resolve the issue? I'm trying to resolve the same problem.
-AB
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Token Validation Failed (9201) for foreignexchangerates
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content