Page API
Quickstart
Creating a new page in Domo, updating the page layout by adding collections for cards, and then sharing the new page with users and groups requires three steps.
- Create a page
- Create page collections
- Share a page with users or groups
Once a page is created, you can continue to programatically update it’s content and access.
NOTE: In order to utilize this Quickstart you will need to obtain an access token or you can leverage any of Domo’s SDKs which will also handle authentication.
Step 1: Create a page
The first step to managing content in Domo is to create a page. When initially creating a new page, you can automatically add existing cards and grant access to users and groups within the initial request.
This code creates a page via the Page API:
Sample Request
POST https://api.domo.com/v1/pages
Content-Type: application/json
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
{
"name": "Supply Chain",
"parentId": 23,
"locked": "TRUE",
"cardIds": [12,2535,233,694],
"visibility": {
"userIds": [793,20,993,19234],
"groupIds": [32,25,17,74]
}
}
Domo will then return a page object when successful.
Sample Response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
{
"id": 3242,
"parentId": 23,
"ownerId": 88,
"name": "Supply Chain",
"locked": TRUE,
"cardIds": [12,2535,233,694],
"visibility": {
"userIds": [793,20,993,19234],
"groupIds": [32,25,17,74]
}
}
Once you create the page, store the page_id
value to page name in your own database to utilize when creating page collections or making updates to the page's content.
Step 2: Create a page collection
Now that you've create a page and added cards, you can now organized the page's content into page collections.
NOTE: In order to add cards to a page collection, the cards must already exist on the page. To add a card to the page, you may either add cards when you create or update the Page via the API.
Sample Request
POST https://api.domo.com/v1/pages/3242/collections
Content-Type: application/json
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
{
"title": "East Sales",
"description": "East Region team includes all Eastern states.",
"cardIds": [2535,233,694],
}
Returns
Returns the parameter of success or error based on the page ID being valid.
Sample Response
HTTP/1.1 200 OK
Next steps
You’ve just created a new page and shared it with other users!
You may want to learn how to manage pages in more detail or explore these other topics:
Need additional help?
No problem, we'd love to help. Explore additional guides and articles or join other developers in Domo's Developer Forum. For further help, feel free to email us or contact our sales team.