Support for RAW JSON in Rest API input

Support for RAW JSON in Rest API input

Requirement

While calling the Rest API from external clients (like postman), currently the input data is sent as a parameter with key "input_data". Some of the customers came with a requirement to pass the input data in raw json format. But, the RAW JSON Format is not supported for our Rest API.

Reply from developer

The RAW JSON format is not supported in SDP Rest API. We will not support raw format in future also.

Explanation

By design, API framework accepts all the inputs as values for the parameters of predefined names such as input_data, ids. The inputs are read from request body as key-value pair in server. Server can read the data as parameters only if the input is sent as form data (x-www-form-urlencoded) or multipart data (in case of file upload)

Customers who are asking support for raw json, have considered only the APIs with only one input and the third party tool that they are using support raw json by default. But few api calls require other parameters also. For example "ids" in case of bulk edit or delete, "operations_required" in case of links api etc. Separating the ids from other data is not possible if sent as raw data. All the third party tools for external api calls will have provision to send input as parameters.

On the security aspect, Raw data can contain any data like XML, scripts which may compromise the security layer. Using parameters will completely mitigate the problem of having vulnerable content. So for security reasons and supporting multiple data like ids etc., we stick to (x-www-form-urlencoded) format.

We have plans to bring versioning to the API. For this we use the 'Accept' header as 'application/vnd.manageengine.sdp.v3+json'. But raw JSON will send the 'Accept' header as 'application/json'. this will cause problem in versioning.

                  New to ADSelfService Plus?