Re: Got error Token validation failed - foreignexchangerates

Kimsong
Occasional Visitor

Got error Token validation failed - foreignexchangerates

https://sandbox.api.visa.com/forexrates/v2/foreignexchangerates

Req:
{
    "initiatingPartyId"1002,
    "rateProductCode""BANK",
    "destinationCurrencyCode""USD",
    "sourceCurrencyCode""EUR",
    "quoteIdRequired"true
}
Resp:
{
    "responseStatus": {
        "status"401,
        "code""9209",
        "severity""ERROR",
        "message""Token validation failed",
        "info"""
    }
}

I already put correct username/password.

2 REPLIES 2
jenn_kh
Community Moderator

Re: Got error Token validation failed - foreignexchangerates

Thank you for reaching out, @Kimsong. An agent will look into this and get back to you as soon as possible. Until then, if any community member knows a solution, feel free to reply here.

I_Doroteo3
Visa Developer Support Specialist

Re: Got error Token validation failed - foreignexchangerates

Hi @Kimsong

 

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: 

  1. 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  
  2. APIkey in the url query param should be the same as the one used to generate xpayToken 
  3. “resourcePath” sent in the xpaytoken has to be as per the documentation (eg: v2/payments?apikey={apikey}). 
  4. Payload sent in the request payload should exactly match along with spaces to the “requestBody” value used in xpaytoken. 

 

Please double check these items to ensure your x-pay-token was set up correctly.

 

Thanks, 

Illana