Skip to content

Quickstart

This walks through signing in, finding your organisation and downloading the field app’s offline package.

Terminal window
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.

Terminal window
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.

Terminal window
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.

Terminal window
curl -X DELETE https://api.tradeops.cc/v1/auth/token \
-H 'Accept: application/json' \
-H 'Authorization: Bearer 1|Kq3…'