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.

  1. Create a page
  2. Create page collections
  3. 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

See it in your language

See this sample request in Java, Python.
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

See it in your language

See this sample request in Java, Python.
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

Step 3: Share page with users or groups

When you share a page with a user, the page itself is added to the page tab row in the user's personalized Domo view, and the name of the page is added to the user's Pages listing in the People tab.

When you share a page with a group, the page is added to the Domo view of every member of that group, and the name of the page is added to the group's Content Accessible by this Group listing in the Groups tab. Users you've shared with have access to the page and all of the cards in it (unless you restrict access to specific cards in the page using the Share dialog).

In order to share a page with either a group or user, the visibility object needs to be added as a parameter with either an array of group_ids or user_ids you wish to grant access.

Sample Request

See it in your language

See this sample request in Java, Python.
PUT https://api.domo.com/v1/pages/3242
Content-Type: application/json
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>

{
  "name": "Supply Chain Management",
   "parentId": 84,
   "locked": FALSE,
   "collectionIds": [2,4,3,1],
   "cardIds": [2535,233,12,9932,694], 
   "visibility": {
        "userIds": [993,19234],
        "groupIds": [2,28,17,24]
    }
}

Domo will then return a 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 our documentation, answers to frequently asked questions, or join other developers in Domo's Developer Forum.  For further help, feel free to email us or contact our sales team.