Quickstart
This walks through signing in, finding your organisation and downloading the field app’s offline package.
1. Get a token
Section titled “1. Get a token”curl https://api.tradeops.cc/v1/auth/token \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"email":"rep@example.com","password":"…","device_name":"Curl"}'{ "token": "1|Kq3…", "token_type": "Bearer" }If the member uses two-factor sign-in, also send code. Field reps without a password can sign in with a texted code.
2. Find your organisation
Section titled “2. Find your organisation”curl https://api.tradeops.cc/v1/me \ -H 'Accept: application/json' \ -H 'Authorization: Bearer 1|Kq3…'{ "data": { "id": "01JC8…", "type": "users", "attributes": { "name": "Field Rep", "email": "rep@example.com", "teams": [ { "slug": "island-grocers", "name": "Island Grocers", "role": "rep", "timezone": "America/Jamaica", "logo_url": null } ] } }}Each organisation’s slug goes at the start of the team routes.
3. Download the offline package
Section titled “3. Download the offline package”curl https://api.tradeops.cc/v1/island-grocers/sync \ -H 'Accept: application/json' \ -H 'Authorization: Bearer 1|Kq3…'You get the rep’s open visits, the checklists they can submit, active customers and their campaigns. Read Offline sync for how to keep it up to date.
4. Sign out
Section titled “4. Sign out”curl -X DELETE https://api.tradeops.cc/v1/auth/token \ -H 'Accept: application/json' \ -H 'Authorization: Bearer 1|Kq3…'