Edit a Post

Endpoint allows to create new Post

Edit existing post

PUT https://api.whisk.com/v2/posts/{post_id}

Use this method for user that edits his post. Depends on content user wants to attach the post use connected attachments in body. Notice, if you'll change attachment type then it could reflect on post visibility in some places. For example, changing post attachment from recipe_with_rating to any other will lead to hiding review from recipe.

Path Parameters

Name
Type
Description

post_id*

String

Requested Post id

Headers

Name
Type
Description

Authorization*

String

User Access token to authorize the API usage. For more information, see Authentication

Request Body

Name
Type
Description

recipe_ids

Array

An array if recipe ids could be attached to post.

liked*

Boolean

Mandatory parameter, set default to true. Represents green like or red dislike.

tags

Array

Array of predefined tags could be attached to review. Will be shown in review. Also counts for recipe popular tags.

image

Object

Image object. Contain list of parameters related to image.

text

String

Text attached to post. If type of post equals recipe_with_rating text submitted here will be shown in review

text

Object

An object for text attribute

attachments

Object

An object for attaching content to a post. there could be an image, recipes, review (recipe_with_rating), communities. Recipes, review, communities are oneof, but it is possible to use an image with a single recipe attached. Multiple recipes type and community type used in automatic post creation from adding recipes to communities and creating communities and not represented in UX.

recipe_with_rating

Object

An object for attaching review to post. recipe_id and liked are mandatory for this specific type of attachment. Can't be used together with recipes, communities types. Image and text for this type could be attached to specific field of the post that why there are no presented in this object. When we create a post with recipe_with_rating attachment then we automatically create a review for recipe.

recipe_id*

String

Recipe id where review would be attached.

rating*

Object

Rating object with liked attribute

community_ids

Array

Community id's attached to post. (For specific types of automatically created posts)

Request body

Sample request and response

curl -X PUT "https://api.b2c.whisk-dev.com/v2/posts/a8867a1f0fbf4fa8b6ecc13bc859d1ae" -H "accept: application/json" -H "Authorization: Bearer " -H "Content-Type: application/json" -d "{ "payload": { "text": { "text": "really nice" }, "attachments": { "images": [ { "url": "https://cloudinary-cdn.whisk.com/image/upload/v1596098580/recipe/fa01a7cbcfdc6f25f866db4584c3bbab.jpg", "width": 0, "height": 0, "selection": { "x": 0, "y": 0, "width": 0, "height": 0 } } ], "recipe_ids": [ "1018e9a80254a641a387c958be13f409ac4ba7f5e5d" ], "recipe_with_rating": { }, "community_ids": [ ] } }}"

Last updated

Was this helpful?