Blogs

A Blog object contains metadata for a blog. Use the blog id to fetch and manipulate entries belonging to a blog.

Profile image

All blogs have a profile image which the user can upload on the web service. It can be accessed on http://<blogurl>/profile.jpg.


Remove favblog

POST https://api.publishme.se/1/blogs/favblogs/remove

Description
Remove a blog from favourite blogs for authenticated account.

GET PARAMETERS
access_token String, the account authentication token. required

POST PARAMETERS
blog_id ID of blog to be removed, in hex format. required

RETURNS
{success: Boolean} if protocol is set to JSON, else OK as string
Add favblog

POST https://api.publishme.se/1/blogs/favblogs/add

Description
Add a blog to favourite blogs for authenticated account.

GET PARAMETERS
access_token String, the user authentication token. required

POST PARAMETERS
blog_id ID of blog to be added, in hex format. optional or
blog_url URL of blog to be added (for example api.blogg.se">http:api.blogg.se). optional

RETURNS
{success: Boolean}
Favblogs

GET https://api.publishme.se/1/blogs/favblogs

Description
Get favorited blogs and latest entry for each of them if availble.

GET PARAMETERS
access_token String, the user authentication token. required

RETURNS
{success: Boolean, blogs: [Object] entries: [Object]}

EXAMPLE OUTPUT
{
  "blogs": [
    {
      "blog_id": "51a84568ddf2b3208abb3667",
      "description": "",
      "title": "api.blogg.se",
      "url": "http://api.blogg.se/"
    }
  ],
  "entries": [
    {
      "blog_id": "51a84568ddf2b3208abb3667",
      "comments": 0,
      "excerpt": "",
      "thumbnail_url": null,
      "title": "",
      "user_entered_date": "2024-04-26T13:38:21+02:00"
    }
  ],
  "success": true
}
List blogs

GET https://api.publishme.se/1/blogs

Description
Get all blogs for current logged on account.

GET PARAMETERS
access_token String, the user authentication token. required

RETURNS
{success: Boolean, blogs: Array[Blog]}

EXAMPLE OUTPUT
{
  "blogs": [
    {
      "account": "51a84568ddf2b3208abb3666",
      "default_image_width": 600,
      "description": "A demo blog for the API",
      "id": "51a84568ddf2b3208abb3667",
      "moderated": true,
      "number_of_drafts": 1,
      "number_of_unseen_comments": 1,
      "site_id": 4171920,
      "title": "api.blogg.se",
      "url": "http://api.blogg.se/"
    }
  ],
  "success": true
}
Create image

POST https://api.publishme.se/1/blogs/<blogid>/images/new

Description
Upload a new image for blog with ID blog_id.

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required

POST PARAMETERS
name A friendly name for the image (doesn't have to be filename).
width The expected width of the image. If this is a smaller value than the image, the image will be rescaled server side. If not, no scaling is applied.
image Append the image like you would to a regular file upload request.

RETURNS
{success: Boolean, image: Image}
Category list

GET https://api.publishme.se/1/blogs/<blogid>/categories

Description
List categories for blog with ID blog_id

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required

RETURNS
{success: Boolean, category: Array[Category], default: String}

EXAMPLE OUTPUT
{
  "categories": [
    {
      "name": "Allm\u00e4nt",
      "permalink": "http://api.blogg.se/category/allmant.html"
    },
    {
      "name": "API",
      "permalink": "http://api.blogg.se/category/api.html"
    }
  ],
  "default": "Allm\u00e4nt",
  "success": true
}
List deferred entries

GET https://api.publishme.se/1/blogs/<blogid>/deferred

Description
List entries with a future publishdate for blog with ID blog_id

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required
limit Number, limit the response to limit elements. optional
skip Number, skip to item #skip. optional

RETURNS
{success: Boolean, entries: Array[Entry], entries_count: Number}

EXAMPLE OUTPUT
{
  "entries": [],
  "entries_count": 0,
  "success": true
}
Blog update

POST https://api.publishme.se/1/blogs/<blogid>/update

Description
Update info for blog with ID blog_id.

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required

POST PARAMETERS
title String, blog name
description String, blog description
moderated Boolean, wether to hold comments for moderation.

RETURNS
{success: Boolean, blog: <blog>}
List images

GET https://api.publishme.se/1/blogs/<blogid>/images

Description
Get images for blog with ID blog_id.

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required
limit Number, limit the response to limit elements. optional
skip Number, skip to item #skip. optional

RETURNS
{success: Boolean, images: Array[Image], images_count: Number}

EXAMPLE OUTPUT
{
  "images": [
    {
      "account": "51a84568ddf2b3208abb3666",
      "blog": "51a84568ddf2b3208abb3667",
      "description": "",
      "id": "51acb99cddf2b306046cd453",
      "name": "bacon1.jpg",
      "thumb_url": "https://cdn3.cdnme.se/4171920/6-3/bacon1_51acb99cddf2b306046cd453_thumb.jpg",
      "url": "https://cdn3.cdnme.se/4171920/6-3/bacon1_51acb99cddf2b306046cd453.jpg"
    },
    {
      "account": "51a84568ddf2b3208abb3666",
      "blog": "51a84568ddf2b3208abb3667",
      "description": "",
      "id": "51a845eaddf2b321772aa05c",
      "name": "lipsum07.gif",
      "thumb_url": "https://cdn2.cdnme.se/4171920/6-3/lipsum07_51a845eaddf2b321772aa05c_thumb.gif",
      "url": "https://cdn2.cdnme.se/4171920/6-3/lipsum07_51a845eaddf2b321772aa05c.gif"
    }
  ],
  "images_count": 2,
  "success": true
}
Tag list

GET https://api.publishme.se/1/blogs/<blogid>/tags

Description
List used tags for blog with ID blog_id

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required

RETURNS
{success: Boolean, tags: Array[<String>]}

EXAMPLE OUTPUT
{
  "success": true,
  "tags": [
    "api",
    "demo",
    "test"
  ]
}
Get blog

GET https://api.publishme.se/1/blogs/<blogid>

Description
Get info for blog with ID blog_id.

URL PARAMETERS
blog_id ID of blog desired, in hex format. required

GET PARAMETERS
access_token String, the user authentication token. required

RETURNS
{success: Boolean, blog: <blog>, entries: Array[Entry]}

EXAMPLE OUTPUT
{
  "blog": {
    "account": "51a84568ddf2b3208abb3666",
    "default_image_width": 600,
    "description": "A demo blog for the API",
    "id": "51a84568ddf2b3208abb3667",
    "moderated": true,
    "number_of_drafts": 1,
    "number_of_unseen_comments": 1,
    "site_id": 4171920,
    "title": "api.blogg.se",
    "url": "http://api.blogg.se/"
  },
  "success": true
}