In this article you will be going to know about:
- How to investigate the reason that caused this error?
- Reason #1: Sending an invalid format within the request payload
- Reason #2: Sending an invalid format in the request header
How to investigate the reason that caused this error?
You can investigate the reason for such an error from the "API debug log" by navigating to your desired profile > Developers > Testing > API Debug Logs.
From there you can navigate to the request payload (API request body) from icon (i) (view request body) in the API debug logs.
Reason #1: Sending an invalid format within the request payload
This means the sent request payload contains an invalid format like (missing comma, missing curly bracket, missing colon, missing square bracket, etc). In other words, the request payload format (which should be in JSON) is invalid. You need to recheck the request payload again to find out what is the issue in its format.
You can use this website (https://onlinejsontools.com), to check your request payload for the invalid format.
- An example for invalid format data from the website (https://onlinejsontools.com).
Reason #2: Sending an invalid format in the request header
This means the sent request and the header of the request contains an invalid format like (space in the key, hashtag in the key, missing one or many characters, etc). You need to recheck the request and the header looking for any wrong data in the client and server keys.
- An example represents invalid format data shown on the merchant’s endpoint code. The issue here is the additional space at the first.