I'm trying to follow the documentation here
but I'm unable to get it to work and the error messages aren't helpful.
I'm attempting to make the request listed in the documentation:
$ curl -X POST 'https://sandbox.api.visa.com/visasuppliermatchingservice/v1/search?supplierName=supplier1&supplierCountryCode=840' \ > -H 'Accept: application/json' \ > -H 'Authorization: Basic myBase64EncodedUsername:Password' \ > -H 'Content-Length: 0' \ > --cert mycert.pem \ > --key mykey.pem { "errorResponse": { "status": 400, "message": "Bad Request : Message Validation Failed", "details": [{ "message": " should be valid" }] } }
I'm sending the Content-Length: 0 as a header b/c if I don't, the server responds with a HTTP/1.1 411 Length Required
Any help on getting this working would be appreciated!
Solved! Go to Solution
Hey @mcenac,
I'm happy to help resolve your issue! For me to help, please provide the following information:
1. Endpoint
2. Request Header
3. Request Body
4. Response Header (include the x-correlation-id)
5. Response Body
Using SoapUI, you can find the x-correlation-id in the Raw Tab of the response header.
Hey @mcenac,
I've logged case number INC8883604 for the engineering team to investigate the issue. Someone will get back to you soon with an update on this. Let us know if you have other questions.
Hey @mcenac,
This seems to be caused because the required parameters are not passed in the Request payload. To resolve the issue, please enter in a Request payload with the required parameters.
2019-12-18 17:38:24,886 LL="INFO" CR="1576690704_857_1346421795_l73c018_VDP_WS" RE="1576690704857" DE="14" TR="https-jsse-nio-8444-exec-5" LN="c.v.m.c.e.HTTPEvent" XID="4d897e685dfa641096ed8d51" securityWrapperUrl="/arm/visasuppliermatchingservice/v1/search" CO="vdp_arm" TY="RESPONSE" RTY="OUT" O="vdp_arm" T="sbxvss.visa.com:8443" U="/vss/visasuppliermatchingservice/sms-record-1.0/search" QP="supplierName=supplier1&supplierCountryCode=840" MTHD="POST" H="X-CORRELATION-ID:1576690704_857_1346421795_l73c018_VDP_WS;X-SERVED-BY:l73c001;Pragma:no-cache;X-APP-STATUS:400;Strict-Transport-Security:max-age=2592000;includeSubdomains;Cache-Control:no-cache, no-store, must-revalidate;Expires:0 ,Thu, 01 Jan 1970 00:00:00 GMT;X-XSS-Protection:1; mode=block;Content-Length:245;Content-Type:application/json" D="4" S="400" XS="400" PAYLOAD="{ "errorResponse": { "status": 400, "message": "Bad Request : Message Validation Failed", "details": [{ "message": " should be valid" }] } }
2019-12-18 17:38:24,884 LL="INFO" CR="1576690704_857_1346421795_l73c018_VDP_WS" RE="1576690704857" DE="14.1" TR="https-jsse-nio-8443-exec-11" LN="c.v.v.s.s.ApiSimulatorService" MSG=Response identified [key : [ValidationInvalidBodyPayload] statusCode : [400], Headers[[Content-Type]:[application/json], ], Body [{
"errorResponse": {
"status": 400,
"message": "Bad Request : Message Validation Failed",
"details": [{
"message": "{missingBody} should be valid"
}]
}
}
]]
After some tinkering, I was able to figure out how to make this work by sending an empty JSON object in the HTTP body:
curl -X POST 'https://sandbox.api.visa.com/visasuppliermatchingservice/v1/search?supplierName=supplier1&supplierCountryCode=840' \ -d '{}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Basic myBase64EncodedUsername:Password' \ --cert mycert.pem \ --key mykey.pem
So it seems that the required URL parameters and some HTTP body payload is required to complete the request successfully.
Hey @mcenac,
Happy New Year! Good job on resolving the issue and thanks for letting us know how you resolved it! 😊