Every web site is given a title. It normally displays at the top of pages, however the site owner can choose to not display it, or display a logo in its place.

Sites can display a title or a logo

​ Sites are associated with a Weebly plan that determines the level of functionality available to the site. For example, only sites on the Performance plan can use the Real Time Shipping feature. ​ The Sites API returns information about Weebly sites owned by the currently authenticated user. You can use the API to update a site’s title.

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
site_title Title given to the site. string X X
domain The fully qualified domain name of the site, if it is published, for example, www.samplesite.com` string
is_published Whether or not the site has been published.
Valid values are:
  • true
  • false
boolean
plan_level The current Weebly plan assigned to this site.
Valid values are:​​
  • 0: free
  • 5: starter
  • 10: pro
  • 15: business
  • 20: performance
string
date_format Format used for dates on this site.
Valid values are:
  • n/j/Y: month/day/year
  • j/n/Y: day/month/year
string
time_format ​Format used for time on this site.
Valid values are:
  • 12
  • 24
string
time_zone Timezone used on this site. Valid values can be found here string
language Two letter language code representing the default language of this site. ​Valid values are:
  • da: Danish
  • de: German
  • en: English
  • es: Spanish
  • fr: French
  • it: Italian
  • ja: Japanese
  • nl: Dutch
  • no: Norwegian
  • pl: Polish
  • pt: Portuguese
  • ru: Russian
  • sv: Swedish
  • tr: Turkish
  • ​zh: Chinese (simplified)
string

GET
Retrieve a List of Sites Owned by this User

GET /v1/user/sites

Returns all sitess for the given user. Only list fields are returned.
scope: read:site

Query Parameters

Returned values are paginated. You can further filter results using these parameters:

Parameter Description Type
page Which page of results to return. Start is 1. integer
limit Number of results per page to return. Default is 25.
Max is 200.
integer
sortby Field name to sort by. You can only sort on site_id string
sortdir Sort direction. Valid values are:
  • asc
  • desc
string

Example CURL request returning all sites:

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

Example filtered request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/?sortby=site_id&sortdir=desc \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

[
    {
        "user_id": "123456",
        "site_id": "987654321",
        "site_title": "My Site"
    },
    {
        "user_id": "123456",
        "site_id": "876543210",
        "site_title": "Amazing Site"
    },
    {
        "user_id": "123456",
        "site_id": "765432198",
        "site_title": "Another Site"
    }
]

GET
Retrieve Details for a Site

GET /v1/user/sites/{SITE_ID}

Returns all fields for the given site.
scope: read:site

Example CURL request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321 \
--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 site are returned.

{
    "user_id": "123456",
    "site_id": "987654321",
    "site_title": "My Site",
    "domain": "mysite.weebly.com",
    "is_published": true,
    "plan_level": "15",
    "time_zone": "America/Los_Angeles",
    "time_format": "12",
    "date_format": "n/j/Y",
    "language": "en"
}

PATCH
Update a Site

PATCH /v1/user/sites/{SITE_ID}

Updates the given site.
scope: write:site

These fields can be updated:

Name Description Type
site_title The title of the given site string

Example CURL request:

curl --request PATCH \
--url https://api.weebly.com/v1/user/sites/987654321 \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"
--data '{
            "site_title": "My New Site Title"
        }'

Example response:

See Fields table. All fields for the site are returned.

{
    "user_id": "123456",
    "site_id": "987654321",
    "site_title": "My New Site Title",
    "domain": "mysite.weebly.com",
    "is_published": true,
    "plan_level": "15",
    "time_zone": "America/Los_Angeles",
    "time_format": "12",
    "date_format": "n/j/Y",
    "language": "en"
}

Help make these docs better!









Tags: