Line 1: |
Line 1: |
| [[Category:Developer]] | | [[Category:Developer]] |
| [[Category:API]] | | [[Category:API]] |
− | == Status == | + | |
| + | == Introduction == |
| + | === Current status of the API === |
| Currently the API is mainly used internally for [[Project:Mobile_Apps|Cordova application]] but does not yet follow good practices in API design. | | Currently the API is mainly used internally for [[Project:Mobile_Apps|Cordova application]] but does not yet follow good practices in API design. |
| It is also used by several application and while not yet stable, doesn't change much. | | It is also used by several application and while not yet stable, doesn't change much. |
| You can have a look at the source code of the app (https://github.com/openfoodfacts/cordova-app/blob/master/www/off.js and https://github.com/openfoodfacts/cordova-app/blob/master/www/index.html) | | You can have a look at the source code of the app (https://github.com/openfoodfacts/cordova-app/blob/master/www/off.js and https://github.com/openfoodfacts/cordova-app/blob/master/www/index.html) |
| Anyone with Swagger (or equivalent knowledge) willing to help us document the API is most welcome :-) | | Anyone with Swagger (or equivalent knowledge) willing to help us document the API is most welcome :-) |
− | | + | === Getting help with the API === |
− | == Getting help with the API == | + | You can ask for help on using the API in this [[https://openfoodfacts.slack.com/messages/api/|API channel on Slack]]. Join us to discuss your use case and get help/code from other devs. |
− | You can ask for help on using the API in this [[https://openfoodfacts.slack.com/messages/api/|API channel on Slack]]. | + | === How to test the API === |
− | | + | ==== READ operations ==== |
− | == Testing == | + | * You can do READ operations using production |
| + | * You should now use the SSL version of the API. The unsecure version '''WILL''' be deprecated :-) |
| + | <pre>https://ssl-api.openfoodfacts.org</pre> |
| + | ==== WRITE operations ==== |
| * You should do all your test edits on http://world.openfoodfacts.net (ask for the password on Slack) | | * You should do all your test edits on http://world.openfoodfacts.net (ask for the password on Slack) |
| * Do not hesitate to create a global account for your app if you don't want to implement Open Food Facts user creation in your app right now. | | * Do not hesitate to create a global account for your app if you don't want to implement Open Food Facts user creation in your app right now. |
− | == Bugs == | + | === Bugs === |
| + | ==== Reporting bugs ==== |
| * Do not hesitate to file a bug if you find an issue in the API, or need an improvement. | | * Do not hesitate to file a bug if you find an issue in the API, or need an improvement. |
| + | ==== Known bugs ==== |
| * General bugs: https://github.com/openfoodfacts/openfoodfacts-server/issues | | * General bugs: https://github.com/openfoodfacts/openfoodfacts-server/issues |
| * API bugs: https://github.com/openfoodfacts/openfoodfacts-server/labels/api | | * API bugs: https://github.com/openfoodfacts/openfoodfacts-server/labels/api |
| * API milestone: https://github.com/openfoodfacts/openfoodfacts-server/milestone/8 | | * API milestone: https://github.com/openfoodfacts/openfoodfacts-server/milestone/8 |
− | | + | === Conventions for the API === |
− | == Using the new SSL API == | |
− | You should now use the SSL version of the API. The unsecure version '''WILL''' be deprecated :-)
| |
− | <pre>https://ssl-api.openfoodfacts.org</pre>
| |
− | | |
− | == Conventions == | |
− | | |
| * fields that end with _t are dates in the UNIX timestamp format (number of seconds since Jan 1st 1970) | | * fields that end with _t are dates in the UNIX timestamp format (number of seconds since Jan 1st 1970) |
| * fields that end with _datetime are dates in the iso8601 format: yyyy-mm-ddThh:mn:ssZ | | * fields that end with _datetime are dates in the iso8601 format: yyyy-mm-ddThh:mn:ssZ |