You can find the event type in the meta section of the POST data. At this moment 3 types of events exist:

publish

A story is about to be published on Story Chief. You should handle the POST data and save your story to your local database. An example of the POST data can be found below. Story Chief expects a response with the id of your story and the url of the story. See response article

update

A story needs to be updated. The POST data will contain all story data and the 'external_id' you provided to Story Chief with the Publish event. The 'external_id' can now be used to search the story in your local database and update it. Note that you may not change the url of the story when updating.

delete

A story needs to be deleted.  The POST data will contain the 'external_id' and 'external_url' you provided to Story Chief with the Publish event. The 'external_id' can now be used to search the story in your local database and delete it.

POST Data

When a story is published to your channel. A message might look like this:

{
    "meta": {
        "event": "publish",
        "mac": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"
    },
    "data": {
        "external_id": "79",
        "storychief_id": 4589451,
        "title": "My awesome story",
        "seo_title": "",
        "seo_description": "",
        "seo_slug": "",
        "content": "You will receive the full html output of your story here",
        "excerpt": "A small description about your story.",
        "featured_image": {
            "data": {
                "url": "https:\/\/url\/to\/your-awesome-image.png",
                "name": "your-awesome-image.png",
                "sizes": {
                    "regular": "https:\/\/url\/to\/your-image.png",
                    "large": "https:\/\/url\/to\/your-image.png",
                    "full": "https:\/\/url\/to\/your-image.png"
                }
            }
        },
        "tags": {
            "data": [{
                    "name": "sloth",
                    "slug": "sloth"
                },
                {
                    "name": "awesome",
                    "slug": "awesome"
                }
            ]
        },
        "category": {
            "data": {
                "name": "Marketing",
                "slug": "marketing"
            }
        },
        "categories": {
            "data": [{
                    "name": "Marketing",
                    "slug": "marketing"
                },
                {
                    "name": "Design",
                    "slug": "design"
                }
            ]
        },
        "author": {
            "data": {
                "first_name": "John",
                "last_name": "Doe",
                "bio": "John doe has written a lot of stories before, problem is they are unknown",
                "email": "john.doe@johndoe.com",
                "profile_picture": {
                    "data": {
                        "url": "https:\/\/url\/to\/your-image.png",
                        "name": "your-image.png"
                    }
                }
            }
        },
        "language": "en",
    }
}

Response →

Did this answer your question?