Submit an annotation
The annotation can be submitted as an anonymous user or as a registered user. If the user is anonymous, the annotation will be accounted as a vote, and several identical anonymous votes are required to apply the insight. If the vote is sent from a registered user, it is applied directly.
To send the annotation as a registered user, send Open Food Facts credentials to the API using
Basic Authentication: add a Authorization: basic {ENCODED_BASE64}
header where {ENCODED_BASE64}
is an base64-encoded string of user:password
. Don't provide an authentication header for anonymous
users.
The annotation is an integer that can take 4 values: 0
, 1
, 2
, -1
. 0
means the insight is incorrect
(so it won't be applied), 1
means it is correct (so it will be applied) and -1
means the insight
won't be returned to the user (skip). 2
is used when user submit some data to the annotate endpoint
(for example in some cases of category annotation or ingredients spellcheck).
We use the voting mecanism system to remember which insight to skip for a user (authenticated or not).
Basic HTTP authentication using Open Food Facts credentials
In: header
ID of the insight
uuid
Annotation of the prediction: 1 to accept the prediction, 0 to refuse it, and -1 for skip, 2 to accept and add data
0 | 1 | -1 | 2
Send the update to Openfoodfacts if update=1
, don't send the update otherwise. This parameter is useful if the update is performed client-side
1
0 | 1
Additional data provided by the user as key-value pairs (required when annotation=2)
Empty Object
Device identifier for tracking anonymous votes
Response Body
curl -X POST "https://robotoff.openfoodfacts.org/api/v1/insights/annotate" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'insight_id=3cd5aecd-edcc-4237-87d0-6595fc4e53c9'
{
"status_code": 0,
"status": "string",
"description": "string"
}