post-assets resource endpoint

URL: /blogs/<id>/post-assets.<format>

This endpoint represents the set of all posts in a particular blog. Via this endpoint and its filter endpoints a client can retrieve a subset of the posts in this blog by various criteria.

This endpoint also allows clients to create new posts in a particular blog by submitting a POST request. Such requests must at the very least contain a content property giving the post's body content, which will be assumed to be HTML encoded unless a specific encoding is set via the textFormat property.





Supported Methods

POST Add a new post to a blog
GET Get a list of posts associated with the selected blog.

Query String Arguments

start-index
Index of the first item to return. The first item in the list has index 1.
max-results
Maximum number of items to return in the list response.

Resource Type

This endpoint returns an object of type List<Post>.

entries (array<Post>)
The items within the selected range.
totalResults (integer)
The total number of items in the whole list of which this object is a chunk.

POST Request Object Type

This endpoint expects POST requests to contain objects of type Post.

author (User)
(Read Only) The user who created the selected asset.
categories (array<string>)
A list of categories associated with the post.
commentCount (integer)
(Read Only) The number of comments that have been posted in reply to this asset. This number includes comments that have been posted in response to other comments.
container (ContainerRef)
(Read Only) An object describing the group or blog to which this asset belongs.
content (string)
The raw post content. The textFormat property defines what format this data is in.
crosspostAccounts (set<string>)
(Write Only) A set of identifiers for Account objects to which to crosspost this asset when it's posted. This property is omitted when retrieving existing assets.
description (string)
The description of the post.
embeddedAudioLinks (array<AudioLink>)
(Read Only) A list of links to the audio streams that are embedded within the content of this post.
embeddedImageLinks (array<ImageLink>)
(Read Only) A list of links to the images that are embedded within the content of this post.
embeddedVideoLinks (array<VideoLink>)
(Read Only) A list of links to the videos that are embedded within the content of this post.
excerpt (string)
(Read Only) A short, plain-text excerpt of the entry content. This is currently available only for Post assets.
favoriteCount (integer)
(Read Only) The number of distinct users who have added this asset as a favorite.
feedbackStatus (FeedbackStatus)
An object describing the comment and trackback behavior for this post.
filename (string)
The base name of the post to use when creating its permalinkUrl.
groups (array<string>)
(Read Only) (Deprecated) An array of strings containing the id URI of the Group object that this asset is mapped into, if any. This property has been superseded by the container property.
hasExtendedContent (boolean)
(Read Only) true if this asset has the extended content. This is currently supported only for Post assets that are posted within a blog.
id (string)
(Read Only) A URI that serves as a globally unique identifier for the user.
isFavoriteForCurrentUser (boolean)
(Read Only) true if this asset is a favorite for the currently authenticated user, or false otherwise. This property is omitted from responses to anonymous requests.
negativeVoteCount (integer)
(Read Only) The total number of negative votes this asset has received via the /assets/<id>/cast-negative-vote endpoint.
objectType (string)
(Read Only) The keyword identifying the type of asset this is.
objectTypes (set<string>)
(Read Only) (Deprecated) An array of object type identifier URIs identifying the type of this asset. Only the one object type URI for the particular type of asset this asset is will be present.
permalinkUrl (string)
(Read Only) The URL that is this asset's permalink. This will be omitted if the asset does not have a permalink of its own (for example, if it's embedded in another asset) or if TypePad does not know its permalink.
positiveVoteCount (integer)
(Read Only) The total number of positive votes this asset has received via the /assets/<id>/cast-positive-vote endpoint.
publicationStatus (PublicationStatus)
An object describing the draft status and publication date for this post.
published (datetime)
(Read Only) The time at which the asset was created, as a W3CDTF timestamp.
reblogCount (integer)
(Read Only) The number of times this post has been reblogged by other people.
reblogOf (AssetRef)
(Fixed After Creation) A reference to a post of which this post is a reblog.
reblogOfUrl (string)
(Read Only) (Deprecated) If this asset was created by 'reblogging' another asset or some other arbitrary web page, this property contains the URL of the item that was reblogged.
renderedContent (string)
(Read Only) The content of this asset rendered to HTML. This is currently available only for Post and Page assets.
shortUrl (string)
(Read Only) The short version of the URL that is this asset's permalink. This is currently available only for Post assetes.
source (AssetSource)
(Read Only) An object describing the site from which this asset was retrieved, if the asset was obtained from an external source.
suppressEvents (boolean)
(Write Only) An optional, write-only flag indicating that asset creation should not trigger notification events such as emails or dashboard entries. Not available to all applications.
textFormat (string)
A keyword that indicates what formatting mode to use for the content of this post. This can be html for assets the content of which is HTML, html_convert_linebreaks for assets the content of which is HTML but where paragraph tags should be added automatically, or markdown for assets the content of which is Markdown source. Other formatting modes may be added in future. Applications that present assets for editing should use this property to present an appropriate editor.
title (string)
The title of the post.
urlId (string)
(Read Only) A string containing the canonical identifier that can be used to identify this object in URLs. This can be used to recognise where the same user is returned in response to different requests, and as a mapping key for an application's local data store.

Client Library Methods for PHP

Get a list of posts associated with the selected blog.
$tp->blogs->getPostAssets(array(

    # Required Parameters
    "id" => $id,

    # Optional Parameters
    "limit" => $limit,
    "offset" => $offset,

))
Add a new post to a blog
$tp->blogs->postToPostAssets(array(

    # Required Parameters
    "id" => $id,
    "payload" => $payload,

))

Filter Endpoints

The following endpoints provide filtered views of this collection:

published
by-category Get all visibile posts in the selected blog that have been assigned to the given category.
by-month Get all visible posts in the selected blog that have a publication date within the selected month, specified as a string of the form "YYYY-MM".
by-filename Get zero or one posts matching the given year, month and filename.
recent Get the most recent 50 posts in the selected blog, including draft and scheduled posts.

Example Request

GET /blogs/6a012877b13de7970c012877b13df1970c/post-assets.json?max-results=4 HTTP/1.1
Host: api.typepad.com

HTTP/1.0 200 OK
Content-type: application/json
Content-length: 5283

{
   "entries": [
      {
         "excerpt": "I've started this blog to share interesting law facts and information about cases I find interesting. Information in this blog is not legal advice.",
         "embeddedAudioLinks": [],
         "content": "<p>I've started this blog to share interesting law facts and information about cases I find interesting.</p>\r\n<p>Information in this blog is not legal advice.</p>",
         "reblogCount": 0,
         "favoriteCount": 2,
         "author": {
            "urlId": "6p012877b13de7970c",
            "location": null,
            "interests": [],
            "objectTypes": [
               "tag:api.typepad.com,2009:User"
            ],
            "profilePageUrl": "http://profile.typepad.com/loblawatlaw",
            "aboutMe": null,
            "objectType": "User",
            "preferredUsername": "loblawatlaw",
            "id": "tag:api.typepad.com,2009:6p012877b13de7970c",
            "avatarLink": {
               "width": 250,
               "url": "https://static.typepad.com/.shared/default-userpics/11-250si.gif",
               "height": 250
            },
            "displayName": "Bob Loblaw"
         },
         "renderedContent": "<p>I've started this blog to share interesting law facts and information about cases I find interesting.</p>\r\n<p>Information in this blog is not legal advice.</p>",
         "hasExtendedContent": false,
         "objectType": "Post",
         "groups": [],
         "id": "tag:api.typepad.com,2009:6a012877b13de7970c012877b143d0970c",
         "embeddedVideoLinks": [],
         "urlId": "6a012877b13de7970c012877b143d0970c",
         "objectTypes": [
            "tag:api.typepad.com,2009:Post"
         ],
         "categories": [],
         "container": {
            "urlId": "6a012877b13de7970c012877b13df1970c",
            "objectType": "Blog",
            "id": "tag:api.typepad.com,2009:6a012877b13de7970c012877b13df1970c",
            "homeUrl": "https://bobloblaw.typepad.com/blog/",
            "displayName": "Bob Loblaw Law Blog"
         },
         "description": "",
         "commentCount": 2,
         "published": "2010-02-18T00:02:56Z",
         "textFormat": "html",
         "permalinkUrl": "https://bobloblaw.typepad.com/blog/2010/02/welcome-t.html",
         "embeddedImageLinks": [],
         "filename": "welcome-t",
         "shortUrl": "https://bit.ly/aj4Deb",
         "title": "Welcome to my Blog"
      },
      {
         "excerpt": "Welcome to TypePad! This is a sample post you can edit or delete later.",
         "embeddedAudioLinks": [],
         "content": "<p style=\"text-align: center;\"><img src=\"http://www.typepad.com/images/home/typepad-2.jpg\" /></p>\n<p style=\"font-size: 14px;\"><strong>Welcome to TypePad!</strong> This is a sample post you can edit or delete later.</p>\n<!-- typepad-default-post -->\n",
         "reblogCount": 0,
         "favoriteCount": 0,
         "author": {
            "urlId": "6p012877b13de7970c",
            "location": null,
            "interests": [],
            "objectTypes": [
               "tag:api.typepad.com,2009:User"
            ],
            "profilePageUrl": "http://profile.typepad.com/loblawatlaw",
            "aboutMe": null,
            "objectType": "User",
            "preferredUsername": "loblawatlaw",
            "id": "tag:api.typepad.com,2009:6p012877b13de7970c",
            "avatarLink": {
               "width": 250,
               "url": "https://static.typepad.com/.shared/default-userpics/11-250si.gif",
               "height": 250
            },
            "displayName": "Bob Loblaw"
         },
         "renderedContent": "<p style=\"text-align: center;\"><img src=\"http://www.typepad.com/images/home/typepad-2.jpg\" /></p>\n<p style=\"font-size: 14px;\"><strong>Welcome to TypePad!</strong> This is a sample post you can edit or delete later.</p>\n<!-- typepad-default-post -->\n",
         "hasExtendedContent": false,
         "objectType": "Post",
         "groups": [],
         "id": "tag:api.typepad.com,2009:6a012877b13de7970c012877b13e1d970c",
         "embeddedVideoLinks": [],
         "urlId": "6a012877b13de7970c012877b13e1d970c",
         "objectTypes": [
            "tag:api.typepad.com,2009:Post"
         ],
         "categories": [],
         "container": {
            "urlId": "6a012877b13de7970c012877b13df1970c",
            "objectType": "Blog",
            "id": "tag:api.typepad.com,2009:6a012877b13de7970c012877b13df1970c",
            "homeUrl": "https://bobloblaw.typepad.com/blog/",
            "displayName": "Bob Loblaw Law Blog"
         },
         "description": null,
         "commentCount": 0,
         "published": "2010-02-17T23:54:58Z",
         "textFormat": "html",
         "permalinkUrl": "https://bobloblaw.typepad.com/blog/2010/02/bob-loblaw.html",
         "embeddedImageLinks": [
            {
               "width": null,
               "url": "http://www.typepad.com/images/home/typepad-2.jpg",
               "height": null
            }
         ],
         "filename": "bob-loblaw",
         "shortUrl": "https://bit.ly/crQrFs",
         "title": "Bob Loblaw"
      }
   ],
   "totalResults": 2
}