Page creation

Step-by-step guide on how to create an Page

A Page is the entity in Ubidots that will hold the custom code, and will provide a reference to it that can be loaded from a Dashboard page.

Currently, all the CRUD process (Create, Read, Update and Delete) for pages is done through the API. You can check our API Reference for additional information.

Create

Make the below HTTP request:

curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/pages' \
-H 'X-Auth-Token: <YOUR_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{"name": "My First Page"}'

The response will be as follows:

{
  "id": "66fc141609164d000e1e0fab",
  "url": "https://industrial.api.ubidots.com/api/v2.0/pages/66fc141609164d000e1e0fab",
  "label": "my-first-page",
  "name": "My First Page",
  "isActive": true,
  "createdAt": "2024-10-01T15:24:06.863703Z",
  "settings": {}
}

Note that the name was used to create the Page label by lowercasing and replacing spaces with dashes.

List

List all your pages with the below HTTP request:

curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/pages' \
-H 'X-Auth-Token: <YOUR_TOKEN>'

The response is:

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "66fc141609164d000e1e0fab",
      "url": "https://industrial.api.ubidots.com/api/v2.0/pages/66fc141609164d000e1e0fab",
      "label": "my-first-page",
      "name": "My First Page",
      "isActive": true,
     "createdAt": "2024-10-01T15:24:06.863703Z",
     "settings": {}
    }
  ]
}

Get

Get a specific page with the below HTTP request:

curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/pages/<pageId>' \
-H 'X-Auth-Token: <YOUR_TOKEN>'

The response is:

{
  "id": "66fc141609164d000e1e0fab",
  "url": "https://industrial.api.ubidots.com/api/v2.0/pages/66fc141609164d000e1e0fab",
  "label": "my-first-page",
  "name": "My First Page",
  "isActive": true,
  "createdAt": "2024-10-01T15:24:06.863703Z",
  "settings": {}
}

Last updated