Jump to content

API/Write: Difference between revisions

Line 54: Line 54:
== Posting a new product ==
== Posting a new product ==


Do a GET request, otherwise you'll get <code> {ā€œstatus_verboseā€: ā€œno code or invalid codeā€, ā€œstatusā€: 0}</code>
Do a GET request, otherwise you'll get
<pre>{
Ā  Ā  ā€œstatus_verboseā€: ā€œno code or invalid codeā€,
Ā  Ā  ā€œstatusā€: 0
}</pre>


URL: <code>https://world.openfoodfacts.org/cgi/product_jqm2.pl</code> (Product post)<sup>(remember to do tests on world.openfoodfacts.net - login and password: "off")</sup>
'''Endpoint:''' <code>https://world.openfoodfacts.org/cgi/product_jqm2.pl</code>(Product post)<sup>(remember to do tests on world.openfoodfacts.net - login and password: "off")</sup>


URL for your tests : <pre>https://world.openfoodfacts.net/cgi/product_jqm2.pl</pre>
'''Testing endpoint:'''<code>https://world.openfoodfacts.net/cgi/product_jqm2.pl</code>


=== Quick overview ===
=== Quick overview ===
Line 75: Line 79:


==== Status after save ====
==== Status after save ====
Ā 
<pre>
* {"Status_verbose":"fields saved","status":1}
{
Ā  Ā  "status_verbose": "fields saved",
Ā  Ā  "status": 1
}
</pre>


=== Examples ===
=== Examples ===
72

edits