helloworld sample java code is working but payment authorization api is not working url
/acs/v3/payments/authorizations
giving {"responseStatus":{"status":401,"code":"9159","severity":"ERROR","message":"Token Validation Failed","info":""}}
Hi @kiranp,
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:
Can you please provide the request payload of this API call? It's possible that you're missing a field or have an inaccurate format. I'd like to see screenshot attachments of the error provided, if possible.
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. In general, for cases like this (i.e. “helloworld works, but the API XX doesn’t”) I'd like to ask of you, if you could, to please extend your SOAPUI project, and make sure that you can call a particular API from SOAPUI project first.
Thanks,
Illana
url : https://sandbox.api.visa.com/acs/v3/payments/authorizations?apiKey={key}
String queryString = "apiKey=" + apiKey;
String resourcePath = "v3/payments/authorizations?" + queryString;
headers: con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("x-pay-token", xPayToken);
payload: