Getting started¶
Exactfarming Public API documentation
API is intended to work with user data from variouse services, client apps
API Host¶
Production:
https://api.exactfarming.com
Staging:
https://api.pl.efarm.pw
API Interaction¶
Authentification¶
All API requests MUST include the Authorization header
The header value MUST be formatted as follows: Token token = {{ farmer_auth_token }}
There is request CURL example:
curl --request GET \
--url https://api.pl.efarm.pw/public_api/v1/fields \
--header 'authorization: Token token=your_auth_token'
All requests have access only to data associated with the user's token.
For instance, if you requested a list of fields (geofences) - you will get fields that belong only to the user's account.
Getting Authntication Token¶
Work with localization¶
Some of the results in the response depend on the region (for example: base unit);
There are 4 locale selection points:
- authentification token locale (db attribute)
- user profile locale (db attribute)
- locale, passed with req (path part
/en/public_api/v1/fieldsor query parameterpublic_api/v1/fields?lang=en) - default locale - en
When working with the API, the locale will be selected in the order specified in the list - from top to bottom