Record Reference Serving Size View
Records that the calling member opened a serving size category and returns it as stored after the change. The category's name and reference amount come from the server, so only its id is sent. Opening a category puts it at the top of the member's Recent list. Each call is kept in the member's own view history, including the search text for a category opened from search.
application/json- body
A serving size category the member opened.
category_id*Category IdIdentifier of the serving size category, as the serving size category endpoints return it.
^[A-Za-z0-9][A-Za-z0-9_.:\-]*$1 <= length <= 128opened_from*ReferenceServingSizeOpenedFromThe tab the category was opened from: search, recent or saved.
"search""recent""saved"result_position?|Where the category appeared in the search results, starting at 1 (at most 10000). Only when opened from search.
query?|The search text that found the category. Kept in the member's own view history only. Only when opened from search.
Successful Response
application/json- response
A serving size category the member opened, with its Saved and Recent state.
category_id*Category IdIdentifier of the serving size category, as the serving size category endpoints return it.
name*NameThe category's name, e.g. Cookies.
reference_amount*Reference AmountThe reference amount customarily eaten at one time, in reference_unit, e.g. 30.
reference_unit*ReferenceAmountUnitg for grams, or mL for millilitres: the categories whose reference amount is a volume (beverages, juices, milk, cream, shakes, syrups and cooking wine).
"g""mL"amount_kind*ServingSizeAmountKinddiscrete for products eaten in units (cookies, bagels), bulk for products measured out (flour, juice).
"discrete""bulk"audience*ServingSizeAudiencegeneral or infant_toddler: who the reference amount is set for.
"general""infant_toddler"data_version*Data VersionVersion of the regulatory data the values above come from.
saved*SavedWhether the member saved this category.
saved_at*|When the member saved it; null while it is not saved.
first_viewed_at*First Viewed AtWhen the member first opened it.
date-timelast_viewed_at*Last Viewed AtWhen the member last opened it.
date-timeview_count*View CountHow many times the member opened it.
curl -X POST 'https://api.bettermenu.live/studio/reference/serving-sizes/views' \ -H 'Content-Type: application/json' \ -d '{ "category_id": "string", "opened_from": "search"}'{ "category_id": "string", "name": "string", "reference_amount": 0, "reference_unit": "g", "amount_kind": "discrete", "audience": "general", "data_version": "string", "saved": true, "saved_at": "2019-08-24T14:15:22Z", "first_viewed_at": "2019-08-24T14:15:22Z", "last_viewed_at": "2019-08-24T14:15:22Z", "view_count": 0}