Since this topic comes up every once in a while, I decided to write a quick guide aimed at the beginner level on how to set the Logging Level of an Exposed or Consumed REST API to aid in debugging. This can be useful in case you need to see what's going on when e.g. the server reports an unhelpful "500 Internal Server Error", and you need to see what's going on.
1. Increase Logging Level
- Open Service Center of your server and log in.
- Chose "Factory" and "eSpaces" from the menu, and search for the right eSpace (the one consuming or exposing the REST API).
- Click the "Integrations" tab.
- Click on the name of the REST API below "Consumed REST APIs" or "Exposed REST APIs".
- Set "Logging Level" to "Full" (there's also "Troubleshoot", but I'm not sure about the differences with "Full").
2. Check the logging
- After you have consumed the REST API (either by running the application that consumes it, or running an application (or e.g. Postman) that consumes your REST API, again open Service Center (if it's not already open), en chose "Monitoring" and "Integrations" from the menu.
- Optionally filter for the eSpace that consumed or exposed the REST API.
- Click "Detail" (the very last column) after the entry you're interested in (note that "Detail" will not appear if you haven't increased the Logging Level).
- On the page that appears you can see what has been sent, and what has been replied. If there's more than about a page it's cut off, and you can press the "Download HTTP Trace" button to get a text file with the full trace. Note that in case of binary content, it will be encoded in Base64; to decode it google for "decode base64" and you'll find online tools to decode the data.
That's about it. In case of errors, look for signs that there's something wrong, e.g. missing data, missing authentication headers, malformatted data, etc. Note that by default, the Platform doesn't send data that has the default value, so be aware that depending on the values of the data you send, not everything may appear (which could also be the source of a problem if an external REST API expects this data anyway).