Publish

Publish your code as a ZIP file

Upload code

The last step, after developing the page code and creating the entity in Ubidots, is to upload the code to the Page, in ZIP format, so it is publicly available and it can be served from Ubidots.

Follow the below steps:

  1. Compress the files from the Development section, in ZIP format, from the root of the file structure, not the parent folder.

  2. Make the below HTTP request. Be sure to replace <page_id>, <YOUR_TOKEN> and <path_to_zip> as needed.

curl -X POST 'https://industrial.api.ubidots.com/api/-/pages/<page_id>/code' \
-H 'X-Auth-Token: <YOUR_TOKEN>' \
-F "zipFile=@<path_to_zip>.zip;type=application/zip"

You should get this response:

{
  "message": "File successfully uploaded."
}

Load code

Once the page is created and the code uploaded to it, it's only a matter to serving the Page from and ubidots Dashboard. To do so:

  1. Create a dashboard whose type is set to Custom

  2. In the "Custom page URL" field, enter the following URL after replacing <page_id> with your respective Page id https://industrial.ubidots.com/app/pages/public/<page_id> This URL is Ubidots format to expose your custom code through an URL that can be loaded from a Dashboard.

Last updated