Get Locations

The List Locations API allows you to fetch a list of locations within Zenput. For historical reasons, sometimes you'll see the word account in place of location. Both terms refer to the same entities.

Below is a sample call and a full description of input parameters, and success and error output formats.

$ curl -H 'X-API-TOKEN: your-api-token-goes-here' \
    'https://www.zenput.com/api/v1/accounts/list_accounts/?start=0&limit=10'

Input parameters
All input parameters are optional.

NameTypeDescription
search_querytextQuery to search first name and last name.
startintegerThe index of the first row to return, used with limit, to define a page of results.
limitintegerThe number of users to return, used with start, to define a page of results. The default value is 100.
order_byOne of "name", "address", "city", "country", "email", "state", "zipcode"Sort order of result. A value may be prefixed by a - to specify a descending sort.
countbooleanIf true, result will include a count of found users without regard to any start or limit values.

Output format, success

{
    "status": 200,
    "count": count-of-accounts-found,
    "results": [
      {},
      ...
      {}
    ],
    "success": true
}

Output format, failure

{
    "status": 500,
    "message": "Cannot get account list",
    "exception": "Technical error details appear here",
    "success": false
}

API V3 (/api/v3/locations)

$ curl -H 'X-API-TOKEN: <API_TOKEN>' \
    'https://www.zenput.com/api/v3/locations/?start=0&limit=1'

Input parameters
All input parameters are optional.

NameTypeDescription
searchtextQuery to search across the following attributes: name, address, city, state, zip code, email, phone and external key.
external_keytextFilter results to given external key.
ordering"id" or "name"Sort order of result. A value may be prefixed by a - to specify a descending sort.
limitintegerNumber of results to return per page.
startintegerThe initial index from which to return the results.
meta_onlybooleanReturn only data within the meta key.

Output format (success)

{
  "meta": {
    "status_code": 200,
    "count": 999,
    "next": "https://www.zenput.com/api/v3/locations/?limit=1&start=1",
    "previous": null
  },
  "data": [
    {
      "id": 1,
      "name": "Location name",
      "address": "5394 Banding Parkway",
      "city": "richmond",
      "state": "VA",
      "zipcode": "86340",
      "country": "US",
      "email": "[email protected]",
      "phone": null,
      "external_key": "store-external-key",
      "lat": 38.4315734,
      "lon": -74.6568942,
      "date_modified": "2020-11-05T17:31:48+00:00",
      "date_created": "2020-11-05T17:31:46+00:00",
      "time_zone": "America/New_York",
      "company": {
        "id": 1,
        "name": "Zenput",
        "features": []
      },
      "tags": [
        {
          "id": 1,
          "name": "All Locations",
          "is_editable": false
        }
      ],
      "owners": [],
      "teams": []
    }
  ]
}