By default, Weebly blogs allow comments and use a native commenting system that allows moderation - comments need approval before displaying on the site. Site owners can elect to use Disqus or Facebook instead. Owners can also add custom code to the header and/or footer of their blog.

Use the Blog API to retrieve a list of blogs on the site or details about a given blog. For information about blog posts, use the Blog Post API.

Fields

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

Name Description Type List
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
blog_id Unique ID for this blog.
string X
page_id ​​The unique ID of the page that the blog is on. string X
title The blog's title
string X
allow_comments Whether or not the blog allows comments. Valid values are:
  • yes
  • no​​
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 Time format used for the blog. Valid values are:
  • 12
  • 24
string
page_blog_num ​The page number for pagination of the blog. string
blog_link A link to the blog, without the site URL. (example: blog.html)
string
blog_slug ​​​The unique (within the site) slug for the blog. string
require_approval Whether or not comments require approval. Valid values:
  • true
  • false
boolean

post_header_code ​​​The HTML code that goes in the post header. string
post_footer_code ​​​​The HTML code that goes in the post footer. string
time_zone Time zone of the blog. ​Valid values can be found here. string
commenting_system How blog comments are selected. default uses Weebly. Valid values are:
  • default (uses Weebly)
  • disqus
  • facebook
string
updated_date ​​Date the blog was last updated. ​​Unix timestamp in GMT

GET
Retrieve a List of Blogs

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

Returns all blogs for the given site. Only list fields are returned.

scope: read:blog

Example CURL request returning all blogs:

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

Example response:

[
    {
        "site_id": "987654321",
        "user_id": "123456",
        "blog_id": "442134315209084655",
        "page_id": "697954564875544555",
        "title": "My Personal Blog"
    }
    {
        "site_id": "987654321",
        "user_id": "123456",
        "blog_id": "546579684213136568",
        "page_id": "697954564875544557",
        "title": "My Work Blog"
    }
]

GET
Retrieve Details for a Blog

GET /v1/user/sites/{SITE_ID}/blogs/{BLOG_ID}

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

Example CURL request:

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

{
    "site_id": "987654321",
    "user_id": "123456",
    "blog_id": "1234567890",
    "page_id": "87654321098",
    "allow_comments": "yes",
    "date_format": "us",
    "time_format": "n/j/y",
    "page_blog_num": "1",
    "blog_link": "blog.html",
    "blog_slug": "blog",
    "require_approval": false,
    "post_header_code": null,
    "post_footer_code": null,
    "time_zone": "America\/Los_Angeles",
    "commenting_system": "default",
    "title": "My Work Blog",
    "updated_date": 1415318319
}


Help make these docs better!









Tags: