Re: Card-On-File Data Service API

edak223
Regular Visitor

Card-On-File Data Service API

Body and header
#!/usr/bin/env python import requests import json # Sandbox Server address url = 'https://sandbox.api.visa.com/cofds-web/v1/datainfo' # Sample data request: This is the payload that we will send to the Sandbox Server payload = { "requestHeader": { "requestMessageId": "6da6b8b024532a2e0eacb1af58581", "messageDateTime": "2019-02-35 05:25:12.327" }, "requestData": { "pANs": [ 4072208010000000 ], "group": "STANDARD" } } # Load configuration data config_path = 'config.json' with open(config_path) as config_file: config = json.load(config_file) user_id = config["user_id"] password = config["password"] cert_path = config["cert_path"] key_path = config["key_path"] timeout = 10 # Send request to server try: response = requests.post(url, cert=(cert_path, key_path), auth=(user_id, password), json = payload, timeout=timeout) # Print response data print(response.headers) print(response.content) except Exception as e: print(e)

Responds Header:
{'Server': 'nginx', 'Date': 'Sat, 30 Jul 2022 05:05:41 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '130', 'Connection': 'keep-alive', 'X-SERVED-BY': '-56467c7', 'X-CORRELATION-ID': '1659157541_133_606344647_-56467c7_VDP_WS', 'X-ERROR-ORIGIN': '9200', 'X-APP-STATUS': '400', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '0', 'X-Content-Type-Options': 'nosniff', 'Strict-Transport-Security': 'max-age=31536000;includeSubdomains', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '-1'}
responds body:
b'{"responseStatus":{"status":400,"code":"9125","severity":"ERROR","message":"Expected input credential was not present","info":""}}'
1 REPLY 1
I_Doroteo3
Visa Developer Support Specialist

Re: Card-On-File Data Service API

Hi @edak223

 

This error is commonly due to having used the wrong credentials or no credentials at all.

 

The Card-On-File Data Inquiry API authentication method requires Two-Way SSL and Message Level Encryption (MLE).

 

Please ensure your project is using the necessary and correct credentials. For more information, please use the following links:

Two-Way SSL

Message Level Encryption (MLE)

 

Thanks, 

Illana