Issue with supplier matching service

Solved! Go to solution
mcenac
Regular Visitor

Issue with supplier matching service

I'm trying to follow the documentation here

https://developer.visa.com/capabilities/suppliermatchingservice/reference#suppliermatchingservice__s...

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!

6 REPLIES 6
API_Products
Visa Developer Support Specialist

Re: Issue with supplier matching service

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.

 




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

mcenac
Regular Visitor

Re: Issue with supplier matching service

  1. https://sandbox.api.visa.com/visasuppliermatchingservice/v1/search?supplierName=supplier1&supplierCo...
  2. Headers with my authorization redacted
    1. > Host: sandbox.api.visa.com
      > User-Agent: curl/7.54.0
      > Accept: application/json
      > Authorization: Basic myBase64EncodedUsername:Password
      > Content-Length: 0
  3. No request body sent
  4. Response headers including x-correlation-id
    1. < Server: nginx
      < Content-Type: application/json
      < Content-Length: 245
      < X-SERVED-BY: l73c018
      < X-CORRELATION-ID: 1576690704_857_1346421795_l73c018_VDP_WS
      < X-APP-STATUS: 400
      < Cache-Control: no-cache, no-store, must-revalidate
      < Pragma: no-cache
      < Expires: 0 ,Thu, 01 Jan 1970 00:00:00 GMT ,-1
      < X-Frame-Options: SAMEORIGIN
      < X-XSS-Protection: 1; mode=block
      < X-Content-Type-Options: nosniff
      < Strict-Transport-Security: max-age=2592000;includeSubdomains
      < X-Cnection: close
      < Date: Wed, 18 Dec 2019 17:38:24 GMT
  5. Response body
    1. {
      "errorResponse": {
      "status": 400,
      "message": "Bad Request : Message Validation Failed",
      "details": [{
      "message": " should be valid"
      }]
      }
      }

API_Products
Visa Developer Support Specialist

Re: Issue with supplier matching service

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.

 




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: Issue with supplier matching service

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"
}]
}
}
]]

 

 




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

mcenac
Regular Visitor

Re: Issue with supplier matching service

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.  

API_Products
Visa Developer Support Specialist

Re: Issue with supplier matching service

Hey @mcenac,

 

Happy New Year! Good job on resolving the issue and thanks for letting us know how you resolved it! 😊

 

 




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.