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.
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!
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:
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