SM Post Connector

A plugin to connect WordPress with the Social Marketing tool.

View the Project on GitHub vplugins/sm-post-connector

/delete-post

The /delete-post endpoint is used to delete a specific post. You can choose to either move the post to the trash or delete it permanently.

Endpoint

Request

To delete a post, make a DELETE request with the required parameters included in the query string. You must also include an Authorization header with a valid Bearer token.

Request Headers

Header Value
Authorization Bearer <your_access_token>

Request Parameters

Parameter Type Description
id int The ID of the post to be deleted.
trash bool Set to true to permanently delete the post, or omit to move it to trash.

Example

$http({
    method: 'DELETE',
    url: 'SITE_URL/wp-json/sm-connect/v1/delete-post',
    headers: {
        'Authorization': 'Bearer <your_access_token>',
        'Content-Type': 'application/json'
    },
    params: {
        id: 97,
        trash: true
    }
}).then(function successCallback(response) {
    console.log('Post deleted:', response.data.message);
}, function errorCallback(response) {
    console.error('Error:', response.data.message);
});