json-example tagged requests and articles

Categorized request examples and articles tagged with [json-example] keyword
JSON Comment Example
An example of including a comment in a JSON. Comments in the form // ... or / * ... * / are not allowed in JSON, but you may have a special element in your JSON, called for example, "_comment", which will contain your comment. The REST API endpoint must ignore this special JSON comment element.

JSON API Example
An example of sending JSON to the REST API endpoint that implements JSON:API. In this JSON API example, the Content-Type: application/json request header specifies the media type of the request body as JSON. The server informs the client that it has returned JSON with a Content-Type: application/json response header.

JSON Response Example
An example of receiving a JSON response from a REST API endpoint. The client tells the server that it expects JSON with the Accept: application/json request header. If the client does not send the Accept: application/json header, the server MAY choose a different media type instead of the JSON response.

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.

JSON Request Example
An example of making an request to a JSON API endpoint. In this JSON Request Example, client tells the server that it expects JSON with the Accept: application/json request header. The server indicates that it has returned JSON for this request using the Content-Type: application/json response header.

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.