I am using the Python sample app for connecting to the VTC APIs. I am receiving 401 unauthorized response when attempting to delete a document by account id. Seeing a return code of 9122, but not exactly sure what that indicates. Any help is appreciated.
Product Name: Visa Transaction Controls
Api Name: Customer Rules API
Request Body: "{\"primaryAccountNumber\":\"<Card Number Removed>\"}"
Headers:
header key: Content-Type - header val:application/json
header key: Authorization - header val:Basic Qlk4VlQ3WDRGU01JQTMwQVI5OUEyMVhNc0VELWZ2ZEZ5U3RiVnQ3UUIycDc3VVJRRTpQYkw2NklnUDBZU3FGMmZMdDRRdDR2NXlSUE1RZTVsQjU3TjF5TQ==
header key: Accept - header val:application/json
header key: User-Agent - header val:VDP_SampleCode_Python
src.rest.ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Content-Length': '110', 'X-SERVED-BY': 'l55p023', 'X-Content-Type-Options': 'nosniff', 'x-vdp-authn-api-visa-id': 'PMC.100', 'Strict-Transport-Security': 'max-age=2592000;includeSubdomains', 'Akamai-Age-Ms': '1588191259161', 'X-CORRELATION-ID': '1588191259_139_484820382_l55p023_VDP_WS', 'Connection': 'keep-alive', 'X-XSS-Protection': '1; mode=block', 'x-vdp-normalized-url': '/vctc/customerrules/v1/consumertransactioncontrols/accounts/accountupdate', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Date': 'Wed, 29 Apr 2020 20:14:19 GMT', 'X-APP-STATUS': '401', 'X-Frame-Options': 'SAMEORIGIN', 'Server': 'nginx', 'Content-Type': 'application/json;charset=UTF-8', 'Expires': '-1'})
HTTP response body: {"responseStatus":{"status":401,"code":"9122","severity":"ERROR","message":"Authentication failed","info":""}}
Solved! Go to Solution
Hey @Roland,
We recommend you to test using the following tools. You can use Postman , SOAP UI or VDP Playground tool to test the APIs. Please see user guides below for respective tools.
VDP Playground – https://community.developer.visa.com/t5/Developer-Tools/How-to-test-and-troubleshoot-APIs-with-the-V...
Please test with one of these tools and share your results with us.
Im getting the same response using Insomnia client.
{
"responseStatus": {
"status": 401,
"code": "9122",
"severity": "ERROR",
"message": "Authentication failed",
"info": ""
}
}
I believe my cert setup is correct but im not exactly sure how to verify. When I submit without my certs I do get a different error.
Problem solved! Mixed up certs, and private keys in my different environments, sandbox, cert, etc. Had a working JKS previously set up in my QA environment, and was able to extract the private key and re-download my project cert. I believe the error was indicating that I was presenting a valid cert/private key combo, but it didnt match up with my cert project settings.
Hey @Roland,
Thanks for sharing with us that the issue is resolved and how you successfully resolved the issue. I'm happy to help you with any other questions that you may have.