json-example tagged requests and articles

Categorized request examples and articles tagged with [json-example] keyword
How to Add Comments to JSON?
Comments in the form // ... or / * ... * / are not allowed in JSON, but you can have a special element in your JSON file called "_comment", for example, that will contain your comment. The JSON API endpoint must ignore this special JSON comment element. See an example of including comments in JSON below on the Content tab.

JSON Payload Example
An example of sending JSON message payload to the REST API endpoint. In this JSON Payload Example, the Content-Type: application/json request header indicates the media type of the request body as JSON. The Accept: application/json header tells the server that the client expects JSON.

How do I return JSON in HTTP response?
To return JSON from the server, you must include the JSON data in the body of the HTTP response message and provide a Content-Type: application/json response header. The Content-Type response header allows the client to correctly interpret the data in the response body. In this JSON response example, we send a request to the ReqBin echo URL and provide the Accept: application/json request header to tell the server that the client is expecting JSON.

JSON Pagination Example
An example of JSON pagination support for a RESTful API. In this JSON Pagination Example, the pagination is implemented via custom X-Page-Number and X-Page-Size request headers.

JSON Data Example
An example of sending JSON data to the REST API endpoint. In this JSON Data Example, the example JSON contains a JSON Number (Id), JSON String (Customer), JSON Array (OrderIds) and JSON Object (Details) JSON data types. The Content-Type: application/json request header specifies the media type of the request body, and the Accept: application/json request header tells the server that the client is expecting JSON.

JSON Response Format Example
An example of the JSON response format. The "status": "success" indicates a successful request. The JSON response data is returned as a "data": {...} JSON object. In case of an error, "status": "error" indicates a failed request, and the error description is returned in the "message": "Error description" field.

JSON Example
This page contains several examples of JSON (JavaScript Object Notation) objects.