Moderate One or More Posts

Operation Summary: 
Approve or decline a pending blog post.
Resource URL: 
https://api.compendiumblog.com/app/posts/moderate
HTTP method: 
POST
HTTP Status Codes: 
200 OK
403 Forbidden
Response Representations: 
JSON
Permitted Roles: 
Super Administrator
Super Delegate
Network Administrator
Required Parameters: 

Overview

This endpoint allows you to specify options on a per post basis as well as for all posts. That is, you can specify defaults for any post attributes that are not specified. For instance, if you know that you want the same Feedback applied to all posts you can simply specify that value using the optional Feedback parameter instead of specifying it on every post. Similarly, you can override that default global. That is, if you did specify a value for the Feedback parameter, but one post had a different feedback key/value pair it would get that feedback value instead of the global.

Posts
An array of JSON objects containing posts and the operation to perform on each of them. Details of each attribute is below.
[
    {
        'PostId': string,
        'Operation': string,
        'Feedback': string,
        'Notify': boolean,
        'Ping': boolean
    },...
]

Structure Information

Below you will find specific information on each of the keys of the required Posts object.

PostId
An appropriate 36 character UUID for the Post being moderated.
Operation
If specified, must be one of 'approve' or 'decline'.
Feedback
If specified this must not be empty (null or the empty string).
Notify
If specified this must be one of 'true' or 'false'.
Ping
If specified this must be one of 'true' or 'false'.
Optional Parameters: 
Operation
This parameter provides a default value for any Post in the Posts array. Must be one of 'approve' or 'decline'. Note that if this parameter is not supplied, and a post in the posts array does not have the operation specified, an error will be returned for this post.
Feedback
This parameter provides a default value for any Post in the Posts array that does not already have feedback. Note that no feedback is required.
Notify
Whether or not to notify appropriate users/admins or not. Forces an override. Boolean.
Ping
Whether or not to ping remote services and update them about approved content. Forces an override. Boolean. See also Network Settings - PingList
Response Values: 
Status
A status object containing two keys; Error and Success. Success is an array of post id's that were successfully moderated. Error is an array of objects of the common error form, except there is also a PostId key in the Error object.
Response Structure: 

JSON
The response is a single member object containing the key 'Status'. Status has two keys, Success and Error. Success contains an array of all post id's that were successfully moderated and Error contains an array of any errors that were encountered. Each Error object has a Name, a Message and a PostId (for the post that this error applies to).

{  
   'Status' : {
      'Success' : [string, string,... ],
      'Error'   : [
          {
              'Name': string,
              'Message': string,
              'PostId': string
          },...
      ]
   }
}
Error Types: 
Posts
Failed to validate the specified Posts array
Posts_PostId
Failed validating the PostId
Posts_Operation
Failed validating the Operation
Posts_Feedback
Failed feedback validation
Posts_Notify
Failed notification validation
Posts_Ping
Failed ping validation
Feedback
Feedback was specified as a parameter and failed validation.
Method
An unsupported HTTP method was used.
Notify
Notify was specified as a parameter and failed validation
Operation
Operation was specified as a parameter and failed validation
Security
You do not have permission to moderate the specified post id.
Unknown
An error occurred but we don't have a description for it. Please report this.
Supported Event: 

Posts.Approve.Success.Ping

This callback is fired upon successful approval of posts and is intended for use with blog update ping servers, such as those provided by Weblogs.com and Google Blog Search.

Payload Members

BlogTitle
The title of the individual blog to which the newly approved post belongs.
BlogUrl
The URL of the individual blog's homepage.
PostUrl
The permalink URL for the post that was just approved.
FeedUrl
The URL of the RSS feed for the blog to which the newly approved post belongs.
Tags
A collection of descriptive terms for categorizing the blog. Currently is fixed at the value of "corporate blog"
Services
A JSON encoded object storing the blog update ping service URLs to be contacted and the protocols they use.

The structure of the Services member is itself a JSON encoded object. Property names are ping service endpoint URLs. The value of a property is the ping protocol that is supported. There are three possible values: 'weblogs-xml-rpc', 'weblogs-ext-xml-rpc', 'weblogs-rest'. Additional information on these protocols are provided at the Weblogs.com API documentation site.

Additional Notes: 
  • To see if all operations were successful you can simply check to see if the length of the Error array is zero or not, or check that the length of the Success array is the same as the number of items that were submitted.
  • To see if there was an error, you can check the length of the Error array. You can also find the associated PostId in the error object.
  • Super Administrators can moderate all posts. Super Delegates can moderate all posts on their assigned networks. Network Administrators can moderate all posts on their network.
Drupal 6 Appliance - Powered by TurnKey Linux