Pages API Example Usage

Pages API Endpoints

The Pages API allows you to manage content pages in your store. This guide provides examples for each endpoint with sample requests and responses.

Base URL: https://www.venddor.com.br/api/2.0
GET /pages

Retrieves a list of pages with their properties.

Example Request

curl -X GET 'https://www.venddor.com.br/api/2.0/pages'
Note: This endpoint returns all pages in your store. Use pagination parameters to limit the number of results.
GET /pages/:id

Retrieves details of a specific page by its ID.

Path Parameters

Parameter Type Description
id* integer The unique identifier of the page

Example Request

curl -X GET 'https://www.venddor.com.br/api/2.0/pages/1'
Info: This example retrieves the properties of the page with page_id=1.
POST /pages

Creates a new page in the system.

Request Fields

Required fields: page_type*, page*

Available fields: page_type, page, parent_id, status, position, usergroup_ids, localization, new window (for links only), use_avail_period, avail_from_timestamp, avail_till_timestamp, description, meta_keywords, meta_description, page_title, link (only for links), seo_name

Response Status Codes

Status Code Description
201 Created Page created successfully
400 Bad Request Invalid request parameters

Example Request

curl --header 'Content-type: text/plain' -X POST 'https://www.venddor.com.br/api/2.0/pages' --data-binary 'page_type=T&page=Test Page&status=H&description=<p>This is a test page to see how the API works.</p>'

This example creates a new hidden page called Test Page with the following content: "This is a test page to see how the API works.". The content uses HTML <p></p> tags.

Example Response

{
  "page_id": 226
}
Tip: The response includes the ID of the newly created page, which you can use to reference this page in future API calls.
PUT /pages/:id

Updates an existing page with new properties.

Path Parameters

Parameter Type Description
id* integer The unique identifier of the page to update

Available Fields

page, parent_id, status, position, timestamp, usergroup_ids, localization, new window (for links only), use_avail_period, avail_from_timestamp, avail_till_timestamp, description, meta_keywords, meta_description, page_title, link (only for links), seo_name

Example Request

curl --header 'Content-type: text/plain' -X PUT 'https://www.venddor.com.br/api/2.0/pages/226' --data-binary 'status=A'

This example updates the status of the page with page_id=226 to Active.

Example Response

{
  "page_id": 226
}
DELETE /pages/:id

Deletes a specific page from the system.

Path Parameters

Parameter Type Description
id* integer The unique identifier of the page to delete

Response Status Codes

Status Code Description
204 No Content Page deleted successfully
400 Bad Request Page couldn't be deleted
404 Not Found Page doesn't exist

Example Request

curl -X DELETE 'https://www.venddor.com.br/api/2.0/pages/226'

This example deletes the page with page_id=226.

Warning: Deleting a page is permanent and cannot be undone. Make sure to backup any important content before deletion.