createPost
To open the Predis.ai post creation and editing flow.
Usage
predis.createPost({
onPostPublish: function (err, data) {
console.log(err, data);
},
post_idea: "This is some brief for your post", // optional
business_details: { //optional
description: "Your business description goes here",
products: ["product 1 details", "product 2 details"],
audience: "Audience description goes here",
benefits: "Business's benefits for your audience go here"
},
media_type: ["single_image", "carousel", "video"] // optional
}
);
tip
Call the createPost
method inside the on("ready")
callback which ensures that the SDK is ready.
Parameters
Name | Description | Type | Required |
---|---|---|---|
onPostPublish | Function to receive data when a post is published from the editor. See onPostPublish for more details. | Function | no |
post_idea | Use this to populate the Post idea in the Create New flow | String | No |
business_details.description | Use this to populate the Brand's Business description. Used in making posts in Business to Post type | String | No |
business_details.products | Use this to pass the Brand's products. Multiple products can be passed in an array. Used in making posts in Business to Post type | Array | No |
business_details.audience | Use this to pass the Brand's Audience description. Used in making posts in Business to Post type | String | No |
business_details.benefits | Use this to pass the Brand's Benefits description. Used in making posts in Business to Post type | String | No |
media_type | Used if you want to restrict your users into making only particular type of post. Eg. Passing only single_image will only show image type in create post flow. Only the given values are possible - "single_image", "carousel", "video". | Array | No |