Posts and Reviews

Posts and reviews API allows to support social functions in your App, like writing reviews for recipes , add Posts (with different types attached content), leave replies.

General information

Reviews and Posts entities

Reviews and Posts are technically separated entities on Whisk from UX perspective but there are connected in the back-end side.

Review in UX - special content which user could leave for a certain recipe. Review should include binary rate mandatory, and text, image, tags as optiional parameters.

Post in UX - special type of content which could be created by user and contain text, image, recipe or review.

On back-end side when we are getting request for creating a review for some recipe from a user we automatically create post in our system and put created review in it. So from this moment client will get post id every time when requestion review. So it is possible to call operations on Post if user want to do something with review. For example, to report review client should call post reporting endpoint.

Client could create reviews via reviews api or post api but it is recommended to create and edit reviews via reviews api cause reviews have more lightweighted structure.

Review object

Review object is a group of objects and attributes

{
  "recipe_with_rating": {
    "text": "string"
    "recipe_id": "string",
    "rating": {
      "liked": true
    },
    "tags": [
      "string"
    ]
  },
  "image": {
    "url": "string",
    "width": 0,
    "height": 0,
    "selection": {
      "x": 0,
      "y": 0,
      "width": 0,
      "height": 0
    }
  }
}

Attributes description

After review creation and automatic attaching to Post on BE side review attributes text and image copy to post attributes.

Post object

Post object is a group of objects and attributes

{
	"post": {
		"id": "string",
		"title": "string",
		"text": "string",
		"header": {
			"image": {}
			},
			"title": {
				"name": "string",
				"user_id": "string",
				"community_id": "string"
			},
			"subtitle": {
				"name": "string",
				"user_id": "string",
				"community_id": "string"
			}
		},
		"posted_by": {
			"id": "string",
			"first_name": "string",
			"last_name": "string",
			"username": "string",
			"picture": {}
			},
			"relation": {
				"is_following": true,
				"is_followed_by": true,
				"is_me": true
			}
		},
		"posted_at": "string",
		"time_since_added": 0,
		"attachments": {
			"images": [],
			"recipes": [],
			"recipe_with_rating": {
				"recipe": {},
				"rating": {
					"liked": true
				},
				"tags": [
					{
						"name": "string",
						"display_name": "string"
					}
				]
			},
			"communities": []
		},
		"replies": {
			"reply_count": 0
		},
		"reactions": {
			"count": 0,
			"my_like": true,
			"sample": []
		}
	}
}

Attributes description

Reply object

Reply object is a group of objects and attributes

{
	"replies": [
		{
			"id": "string",
			"text": {
				"text": "string"
			},
			"attachments": {
				"images": [],
				"recipes": []
			},
			"user": {
				"id": "string",
				"first_name": "string",
				"last_name": "string",
				"username": "string",
				"picture": {
					"url": "string",
					"width": 0,
					"height": 0,
					"selection": {
						"x": 0,
						"y": 0,
						"width": 0,
						"height": 0
					}
				},
				"relation": {
					"is_following": true,
					"is_followed_by": true,
					"is_me": true
				}
			},
			"reactions": {
				"count": 0,
				"my_like": true,
				"sample": []
			},
			"time_since_added": 0
		}
	],
	"total_count": 0,
	"paging": {
		"cursors": {
			"after": "string",
			"before": "string"
		},
		"total": "string"
	}
}

Attributes description

Last updated