Operation Summary:
Create a new post or edit an existing post.
Resource URL:
https://api.compendiumblog.com/app/post
HTTP Status Codes:
200 OK
201 Created
403 Forbidden
HTTP Status Code Details:
Overview
Because this endpoint is used for both creating and updating posts, you will get back an HTTP 200 or 201 status code depending on what operation actually occurred (create vs update).
200 OK
If your post is saved successfully you will get back a 200 response code.
201 Created
If your post is created successfully you will get back a 201 response code.
403 Forbidden
You have tried to edit a post that does not belong to you.
Response Representations:
Required Parameters:
- Body
- A post body. Even if unchanged this must be specified. The theoretical maximum limit of a post body is 4GB
- Title
- A title for the post. Even if unchanged this must be specified. Maximum length of 255 eight-bit characters.
- Slug
- Post Url Slug value. Slug is a character string between 1 and 255 characters.
Optional Parameters:
- Draft
- Boolean flag (value of 'true' or 'false') indicating whether the post should be saved without submission for approval to the Network Administrator.
- PostId
- For updating (editing) a post this parameter is required. If unspecified a new post will be created. PostId is a 36 character system assigned GUID.
- PublishDate
- ISO8601 formatted date/time. Posts that have a future PublishDate will not show up on blogs until that date and time.
- Sticky
- Boolean flag (value of 'true' or 'false') indicating whether or not the post should always be displayed at the top of the users blog or not. Defaults to false. If set to true, this post will not show up under any compended blogs.
- UserId
- UserId of the account the new post should be associated with.
- BlogIds
- Array listing of blogs to publish this post to. The blogs specified MUST be manual blogs.
Response Values:
- Success
- The post was saved successfully.
- Error
- The post was not successfully saved.
Response Structure:
JSON
Responses are single-member objects which have a property name based on the type of result.
The Success result will look like:
{ 'Success' : string}
Where the string is the system assigned unique identifier for the newly created post, or the newly saved post.
The Error result will be a flat array of objects, which have keys for the message name and explanatory text.
{
'Error' : [
{ 'Name' : string, 'Message' : string },
{ 'Name' : string, 'Message' : string },
...
]
}
Error Types:
- Body
- Validation of Body failed. Body must be between 1 and 4,294,967,296 characters.
- Draft
- Validation of Draft failed. Draft must have a value of either true or false.
- PostId
- Validation of PostId failed. PostId was either empty or that of a post which does not exist.
- PublishDate
- Validation of PublishDate failed. PublishDate was either empty or could not be parsed.
- Save
- An error occurred while saving the post. You should probably try again.
- Security
- Requestor does not have permission to to edit the specified post. Results in a 403.
- Status
- No known status could be found for the post.
- Sticky
- Validation of Sticky failed. Sticky must have a value of either true or false.
- Title
- Validation of Title failed. Title must be between 1 and 255 characters.
Additional Notes:
- For initial saves, the post is saved to the individual blog associated with the authenticated user.
- For updates, the post must already belong to the individual blog associated with the authenticated user.
Command Line Example
curl -H "Accept: application/vnd.compendium.blog;version=2,application/json" --user someuser:mgc3crqk45ufzkfb -d 'Title=Foo&Body=Bar' https://api.test.compendiumblog.com/app/post