Publisher API: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

Create and publish a post

A site owner wants to publish a post to one of their connected social channels.

Prerequisite: The site owner must connect the channel in the site's dashboard before you can publish to it. See Connecting to your social media accounts.

To create and publish a post:

  1. Call List Accounts for the channel to retrieve the connected account's id.
  2. Call Get Feature Data with PUBLISH_POST to confirm the site can publish and has remaining quota.
  3. Call Create Draft Item with the post's channel, type, and content. The type and content must match a combination the channel supports. The response includes the draft's id.
  4. Call Publish Item By ID with the draft's id to publish it immediately. The published post appears on the site's Social Media Marketing page in the dashboard.

Schedule a post for a future date

A site owner wants to prepare a post now and have it published automatically at a later time.

To schedule a post:

  1. Call Create Draft Item with the post's channel, type, and content. The response includes the draft's id.
  2. Call Publish Item By ID with the draft's id and a scheduledDate. The post is published at that date with a status of SCHEDULED.

Reschedule or cancel a scheduled post

A site owner wants to change the publish date of a scheduled post, or stop it from being published.

To reschedule or cancel a scheduled post:

  1. Call Query Items to find the scheduled post and get its id from the results.
  2. To move the post to a different date, call Reschedule Item with the id and the new scheduledDate. To stop it from being published, call Cancel Scheduled Item with the id.

Generate post content and publish it

A site owner wants to create a post from one of their site's assets, such as a product, without writing the content themselves.

To generate post content and publish it:

  1. Call Generate Post Data with the site assets to base the post on, the channels to generate for, or both. The response includes ready-to-use post content for each requested channel.
  2. Call Create Draft Item with the generated content for the channel you want to post to. The response includes the draft's id.
  3. Call Publish Item By ID with the draft's id to publish it, or include a scheduledDate to schedule it.

Generate a caption for a post

A site owner wants to create a caption with AI to use in a post, rather than generate a full post.

To generate content and publish a post with it:

  1. Call Generate Text with a prompt describing the post to generate caption suggestions.
  2. Call Create Draft Item with the generated caption as the post's content. The response includes the draft's id.
  3. Call Publish Item By ID with the draft's id to publish it, or include a scheduledDate to schedule it.
Did this help?