Posts


All Posts

You can get a list of all the posts of an entity by using the following endpoint.

{warning} Don't forget that all endpoints documented here need to be prefixed with 1.0/campaigns/{campaign.id}/.

Method URI Headers
GET/HEAD entities/{entity.id}/posts Default

Results

{
    "data": [
        {
            "created_at":  "2019-01-30T00:01:44.000000Z",
            "created_by": 1,
            "entity_id": 69,
            "entry": "Lorem Ipsum",
            "entry_parsed": "Lorem Ipsum",
            "id": 31,
            "position": null,
            "visibility_id": 1,
            "name": "Secret Note",
            "settings": [],
            "updated_at":  "2019-08-29T13:48:54.000000Z",
            "updated_by": null,
            "permissions": [],
            "layout_id": 3,
        }
    ]
}

Post

To get the details of a single post, use the following endpoint.

Method URI Headers
GET/HEAD entities/{entity.id}/posts/{post.id} Default

Results

{
    "data": {
        "created_at":  "2019-01-30T00:01:44.000000Z",
        "created_by": 1,
        "entity_id": 69,
        "entry": "Lorem Ipsum",
        "entry_parsed": "Lorem Ipsum",
        "id": 31,
        "position": null,
        "visibility_id": 1,
        "name": "Secret Note",
        "settings": [],
        "updated_at":  "2019-08-29T13:48:54.000000Z",
        "updated_by": null,
        "permissions": [],
        "layout_id": 3,
    }
}

Create a Post

To create a post, use the following endpoint.

Method URI Headers
POST entities/{entity.id}/posts Default

Body

Parameter Type Detail
name string (Required) Name of the post
entry string The post's entry (html)
entity_id integer (Required) The post's parent entity
visibility_id integer The visibility: 1 for all, 2 self, 3 admin, 4 self-admin or 5 members.
position int|null (optional) Position for ordering pinned posts
settings object (optional) collapsed:1 if the pinned post should be collapsed on page load
layout_id integer (optional) The type of Post Layout the post will render (Only for Premium campaigns)

Results

{success} Code 200 with JSON body of the new post.

Update a Post

To update a post, use the following endpoint.

Method URI Headers
PUT/PATCH entities/{entity.id}/posts/{post.id} Default

Body

The same body parameters are available as for when creating a post.

Results

{success} Code 200 with JSON body of the updated post.

Delete a Post

To delete a post, use the following endpoint.

Method URI Headers
DELETE entities/{entity.id}/posts/{post.id} Default

Results

{success} Code 200 with JSON.

Permissions

Post permissions are exposed with each call. A permission typically looks like this

{
    "user_id": 1,
    "role_id": null,
    "permission": 1,
    "permission-text": "update"
}

A permission is either attached to a user_id or a role_id, but never to both.

The permission integer is set to 0 for Read, 1 for Update, and 2 for Deny.