Apps can install dashboard cards that provide information about the app to the Site Dashboard. For example, an analytics app might install a dashboard card that displays page visits. Find out more about dashboard cards here.

You update dashboard cards whenever the site owner visits the Site Dashboard page and the dashboard.card.update webhook is sent.

Fields

The following table shows all fields that exist for this API, those that are returned when you retrieve a list, and those that are changeable using PATCH. All fields are returned when you retrieve a single item.

Name Description Type List Changeable
user_id The unique ID of the authenticated user string X
site_id ID of a Weebly site, unique to the currently authenticated user​ string X
card_id The unique id that represents a card instance on the user's Site Dashboard page string X
name Name given to the card in the manifest. string X
hidden Whether the card should be hidden on the Site Dashboard page. Valid values:
  • true
  • false
boolean X X
data ​The data displayed on the card. The array includes the property values for each component on the card. array of dashboard components X X

GET
Retrieve a List of Dashboard Cards for an App on a Site

GET /v1/user/sites/{SITE_ID}/cards

Returns all dashboard cards for the app making the call on the given site. Only list fields are returned.


scope: no scope required

Example CURL request returning all cards:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/cards \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

[
    {
        "card_id":"12345",
        "name": "Statistics",
        "hidden": false,
        "data":[
            {
                "type": "text",
                "value": "Recent Thing 2",
                "link": "https://myawesomeapp.com/:jwt/recents/2"
            },
            {
                "type": "stat",
                "value": "Recent Stat 1",
                "primary_value": "25%",
                "primary_label": "of users approved"
            }
        ]
    }
    {
        "card_id":"12578",
        "name": "Welcome",
        "hidden": true,
        "data":[
            {
                "type": "text",
                "value": "Welcome",
                "link": "https://myawesomeapp.com/:jwt/welcome"
            }
        ]
    }
]

GET
Retrieve Details for a Dashboard Card

GET /v1/user/sites/{SITE_ID}/cards/{CARD_ID}

Returns all fields for the given dashboard card.


scope: no scope required

Example CURL request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/cards/12345 \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

See Fields table. All fields for the dashboard card are returned.

{
    "card_id":"12345",
    "name": "Statistics",
    "hidden": false,
    "card_data":[
        {
            "type": "text",
            "value": "Recent Thing 2",
            "link": "https://myawesomeapp.com/:jwt/recents/2"
        },
        {
            "type": "stat",
            "value": "Recent Stat 1",
            "primary_value": "25%",
            "primary_label": "of users approved"
        }
    ]
}

PATCH
Update a Dashboard Card

PATCH /v1/user/sites/{SITE_ID}/cards/{CARD_ID}

Updates the given dashboard card.


scope: no scope required

These fields can be updated:

Name Description Type
hidden Whether the card should be hidden on the Site Dashboard page. Valid values:
  • true
  • false
boolean
data ​The data displayed on the card. The array includes the property values for each component on the card. array of dashboard components

Example CURL request:

curl --request PATCH \
--url https://api.weebly.com/v1/user/sites/987654321/cards/12345 \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"
--data '{
            "hidden": false,
            "card_data":[
                {
                    "type": "text",
                    "value": "Recent Thing 2",
                    "link": "https://myawesomeapp.com/:jwt/recents/2"
                },
                {
                    "type": "stat",
                    "value": "Recent Stat 2",
                    "primary_value": "35%",
                    "primary_label": "of users approved"
                }
            ]
        }'

Example response:

See Fields table. All fields for the dashboard card are returned.

{
    "card_id":"12345",
    "name": "Statistics",
    "hidden": false,
    "card_data":[
        {
            "type": "text",
            "value": "Recent Thing 2",
            "link": "https://myawesomeapp.com/:jwt/recents/2"
        },
        {
            "type": "stat",
            "value": "Recent Stat 2",
            "primary_value": "35%",
            "primary_label": "of users approved"
        }
    ]
}

Help make these docs better!









Tags:
elements apis