REST API Success Response Example

Overview

This document provides an example of a successful response from a REST API when creating a new resource. The response follows a structured format, including essential details such as the resource ID, attributes, timestamps, and metadata.


Response Breakdown

1. Data Section

The data object contains the primary resource details.

  • ID: 1048 – A unique identifier for the newly created resource.
  • Attributes: Contains specific information about the resource.
    • Name: "minima-eaque-et" – The assigned name of the resource.
    • Title: null – No title was provided during creation.
    • Description: null – No description was provided.
    • Created At: "2022-02-22T15:05:46.855Z" – The timestamp when the resource was created.
    • Updated At: "2022-02-22T15:05:46.855Z" – The timestamp when the resource was last modified.
    • Published At: "2022-02-22T15:05:46.853Z" – The timestamp when the resource was published.

2. Meta Section

  • The meta object is included but empty ({}), indicating that no additional metadata was provided.

Full JSON Response Example

Below is the exact JSON response returned by the API:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
    "data": {
        "id": 1048,
        "attributes": {
            "name": "minima-eaque-et",
            "title": null,
            "description": null,
            "createdAt": "2022-02-22T15:05:46.855Z",
            "updatedAt": "2022-02-22T15:05:46.855Z",
            "publishedAt": "2022-02-22T15:05:46.853Z"
        }
    },
    "meta": {}
}
0%