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?

                    • Related Articles

                    • 10.5 API - How APIs can be used in the version 10.5 and above ?

                      Introduction: REST API acts as a bridge between ServiceDesk Plus MSP and other applications. The communication of information happens via HTTP Request. The REST API authenticates users using Technician Key, thus eliminating the need for the users to ...
                    • API to GET Requests in POSTMAN when trying to input data

                      When you're using GET method and trying to input data, the JSON data has to be encoded like below: %7B%22operation%22%3A%7B%22details%22%3A%7B%22from%22%3A%220%22%2C%22limit%22%3A%2250%22%2C%22filterby%22%3A%22All_Requests%22%7D%7D%7D The same can be ...
                    • Online API documentation

                      Dear Users You can refer to the latest API document from our online demo page available here. (Login as administrator to view the same) Once login -> Goto Admin -> API -. Documentation to refer the same. or once login done -> click the below link to ...
                    • How to automatically create multiple tasks in a change request with a configurable JSON file.

                      Note:  Attached script will not work beyond 11138 SDP Version. ​ This is a sample Python script  to automatically  create multiple tasks within a change request  with a configurable JSON file. This is achieved  using an API call to create a task in ...
                    • API -Listing Requesters with E-mail Address

                      1. Encode the below mentioned and change the highlighted as per yours: { "list_info": { "sort_field": "name", "start_index": 1, "sort_order": "asc", "row_count": "100", "get_total_count": true, "search_fields": { "email_id": "req1@msp.com" } }, ...