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
generation_mode: "text", //text or business
new_creation_flow : true,
post_objective : "ad_creatives"
}
);
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 |
generation_mode | Used if you want to default your users into making only particular type of post. Eg. Passing "text" will show text to post mode as default. Passing "business" will show business to post mode as default. Defaulted to Text. | String | No |
new_creation_flow | Enable new post creation flow for generating content. This is primarily added for backward compatibility and is Defaulted to false. | String | No |
post_objective | Open "Ad creatives" only mode if new flow is enabled using post_objective parameter with ad_creatives value. This only works if the "new_creation_flow" is enabled. The "media_type" value is required if post_objective is provided. If this is enabled then aspect ratio option will appear on the third step along with post design, number of variants etc. Only single_image and video is supported for ad creatives as of now. | String | No |