7.2.56 /api/v1/layouts

This API endpoint allows reading and writing the layouts in the layouts database.

Supported HTTP methods: GET, POST, PATCH, DELETE

GET /api/v1/layouts

Gets all saved layouts from the database.

Parameters: none

Expected Payload: none.

Replied Payload: The list of stored layouts as an array of Layouts data objects.

Return Codes:

Code Description
200 OK, returns a JSON document.
401 not logged in. In this case an ApiError document is returned,describing details of the error.

GET /api/v1/layouts/{layoutId} Gets single saved layouts from database with the given layout id.

Parameters:

Parameter Description
layoutId The Layout ID of the layout to retrieve

Expected Payload: none.

Replied Payload: The layout as a single Layout data object.

Return Codes:

Code Description
200 OK, returns the Layout containing the saved layout.
401 not logged in. In this case a ApiError document is returned, describing details of the error.
404 no layout with the given layout ID exists. In this case a ApiError document is returned, describing details of the error.

POST /api/v1/layouts

Creates a new layout with the given attributes. The unique layoutId is generated by the database backend and returned in the response document.

Parameters: none

Expected Payload: A Layout data object to store.

Replied Payload: The created Layout Layout data object returned by the database.

Return Codes:

Code Description
201 Created, the created Layout data object is replied as payload
401 not logged in. In this case an ApiError document is returned,describing details of the error.
400 Bad Request. If layoutName is not given.
500 DB is not writable. In this case an ApiError document is returned,describing details of the error.

PATCH /api/v1/layouts/{layoutId}

Updates an existing layout name with the given layout ID.

NOTE: Only layoutName can be modified.

Parameter Description
layoutId The layout ID of the layout to update

Expected Payload: A Layout data object containing the new name.

Replied Payload: The updated Layout data object returned by the database.

Return Codes:

Code Description
200 OK, updated Layout data object is returned
400 Bad Request. If layoutName is not given.
401 not logged in. In this case an ApiError document is returned,describing details of the error.
404 the layout is not found with given layoutId.
500 DB is not writable. In this case an ApiError document is returned,describing details of the error.

DELETE /api/v1/layouts/{layoutId}

Remove a layout from the database

Parameter Description
layoutId The layout ID of the layout to delete

Parameters: none

Expected Payload: none

Replied Payload: none

Return Codes:

Code Description
204 NO CONTENT, the layout has been deleted.
400 Bad Request. In case validation failed on payload
401 not logged in. In this case an ApiError document is returned,describing details of the error.
404 the layout is not found with given layoutId.
500 DB is not writable. In this case an ApiError document is returned,describing details of the error.