Skip to main content

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

NameDescriptionTypeRequired
onPostPublishFunction to receive data when a post is published from the editor. See onPostPublish for more details.Functionno
post_ideaUse this to populate the Post idea in the Create New flowStringNo
business_details.descriptionUse this to populate the Brand's Business description. Used in making posts in Business to Post typeStringNo
business_details.productsUse this to pass the Brand's products. Multiple products can be passed in an array. Used in making posts in Business to Post typeArrayNo
business_details.audienceUse this to pass the Brand's Audience description. Used in making posts in Business to Post typeStringNo
business_details.benefitsUse this to pass the Brand's Benefits description. Used in making posts in Business to Post typeStringNo
media_typeUsed 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".ArrayNo
generation_modeUsed 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. StringNo
new_creation_flowEnable new post creation flow for generating content. This is primarily added for backward compatibility and is Defaulted to false. StringNo
post_objectiveOpen "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.StringNo