Action

Action is the unit of tracking with HyperTrack. It is the starting point for building your use case. If you are building your use case, we recommend following the Actions Guides.

This document is a detailed reference to the Action Object and the API calls.

Action properties

An Action object consists of following data.

Properties set by you when creating actions

Property Type Description
user_id OR user_unique_id UUID string/string Only required parameter. id or unique_id of an existing user
unique_id String Unique identifier for the action in your system
collection_id String Identifier for the collection of actions in your system. See below for details.
type String Type of action, e.g., meetup, pickup, delivery, dropoff, visit, sos, stopover, task or any other custom type
metadata JSON Custom key-values pairs in your system that you want to associate with the action. E.g. Customer - John Smith
expected_place JSON Object of place where the action is expected to be completed. Use it to get ETA, expected route, remaining miles and delay events.
expected_at ISO datetime string Time at which action is scheduled to complete. Will be used to compute delays.
autocomplete_rule JSON Rules to autocomplete action based on time or place. Learn more.
autocancel_after Integer Action will automatically cancel after those many hours if not completed prior. Use this to automatically clean up actions. Defaults to 24 hours after expected_at if available; else 24 hours after eta_at_creation if you had set expected_place; else 24 hours after created_at.
Action collection

Use collections to group actions. Examples:

  • A group of friends meeting up and sharing live location with each other
  • An order that requires multiple actions to be tracked, such as a pickup followed by a dropoff

Properties computed by HyperTrack

Property Type Description
id UUID String Unique identifier for the action object created by HyperTrack when action was created
user JSON Object of user for whom action is created
tracking_url String Live tracking URL with live location, activity status and device health status
location JSON Object with live location of action. Will be null for a completed/cancelled action
activity JSON Object with live activity of action. Will be null for a completed/cancelled action
health JSON Object with live device health. Will be null for a completed/cancelled action
status String Current status of the action. See below for possible values
created_at ISO datetime string Time when action was successfully created
updated_at ISO datetime string Last time when the action object was updated by HyperTrack
completed_at ISO datetime string Time when action was successfully completed, autocompleted, canceled or autocanceled
started_place JSON Object of place where tracking started for action
completed_place JSON Object of place where action was completed
distance Integer Distance traveled from the previous action^ completed, in meters
route String Route traveled from the previous action^ completed, provided in the encoded polyline format
location_time_series String Route, alongwith timestamp, traveled from the previous action^ completed. Read more
shortest_distance Integer Shortest distance from the previous action^, in meters. Available only for completed actions. Will be null for all other actions
shortest_route String Shortest route from the previous action^, in meters. Available only for completed actions. Will be null for all other actions

^ Mileage of the first action will be computed from the time/place tracking started. Tracking starts when one or more actions are created for the user and stops when all actions for the user are completed.

Status

The possible values for status are:

  • created: action created successfully
  • completed: action completed successfully
  • autocompleted: action automatically completed successfully due to isautocomplete_at* flags
  • canceled: action canceled successfully
  • autocanceled: action automatically canceled successfully due to autocancel_after flag

Properties computed by HyperTrack when action has an expected_place

Property Type Description
arrival_status String Current arrival status of the action. See below for possible values. Will be null for a completed/cancelled action.
eta ISO datetime string Current ETA for user to get to expected_place on most favorable route factoring live traffic conditions. Will be null for a completed/cancelled action.
eta_at_creation ISO datetime string ETA when action was created. Use it to compare current eta with the original expectation set.
expected_route String Latlongs for most favorable route for user to get to expected_place factoring live traffic conditions. Also the route based on which eta is computed. Will be null for a completed/cancelled action.
remaining_distance Integer Distance remaining, in meters. Will be null for a completed/cancelled action.
Arrival status

The possible values for arrival_status are:

  • leaving_now: When user has moved <100 meter from the place where tracking started
  • on_the_way: When user has moved >100 meter from the place where tracking started
  • arriving: When user is <400 meter from expected_place
  • arrived: When user is <100 meter from expected_place

Sample JSON

{

}

APIs to program actions

API call Method URL Description
Create actions actions/ Create one or more actions
Complete an action actions/<id>/complete/ Complete an action
Cancel an action actions/<id>/cancel/ Cancel an action
Get an action actions/<id>/ Get an action object
Get multiple actions actions/ Lists all actions objects. Use parameters to filter and order
Update an action actions/<id>/ Edit an action object
Delete all actions in test environment actions/bulk_delete/ This API does not work in production environment
Get sequence of actions with expected_place users/<id>/sequence_actions/ Get the sequence in which actions with expected_place are expected to be completed
Update sequence of actions with expected_place users/<id>/sequence_actions/ Update the sequence in which actions with expected_place are expected to be completed

Create actions

Creates one or more new actions. The request body consists of a list of objects. One action is created for each object as per the parameters of the object.

If you create multiple actions for a user, the sequence of the objects in the list determines the sequence in which actions are expected to completed. In case of multiple actions with expected_place created for a user, arrival_status, eta and other properties are computed for all actions with an expected_place. By default, the system expects actions to complete in the sequence they are created. The default sequence may be modified using the sequence_actions API call. Actions with no expected_place are excluded from this computation.

You can also auto-create actions based on time or place. Refer to rules.

HTTP Request

POST https://api.hypertrack.com/api/v2/actions/

Parameters

An action can be created using the following parameters. The only required parameter to create an action is a unique identifier of an existing User object. You can pass either an user_id or an user_unique_id. user_id is the ID of user generated by HyperTrack and user_unique_id is the ID of user provided by you. All other parameters are optional.

Note that you can pass expected_place_id instead of expected_place JSON object. It is the id of the Place where the action is expected to take place. If your users perform actions at a place very frequently, we recommend that you:

  • Create a Place object (for the very first time)
  • Store the id of the Place object you get in response, and
  • Send this id every time you create an action
Parameter Type
user_id OR user_unique_id UUID String/String
unique_id String
collection_id String
type String
metadata JSON
expected_place OR expected_place_id JSON/UUID String
expected_at ISO datetime string
autocomplete_rule JSON
autocancel_after Integer
Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X POST \
     -d "[]" \
     https://api.hypertrack.com/api/v2/actions/
```

{% sample lang="node" %}
```javascript
```

{% sample lang="ruby" %}
```ruby
Returns

Returns list of action objects, if all actions were successfully created. If the parameters of any object in the request body are invalid, no action will be created and an error is returned.

Note that if you pass an address string as the expected_place and the address fails to geocode, action won't be created. In such a case, pass a valid address, or create action without an expected_place.

Complete an action

Complete the action with ID given in the request URL. You can also set actions to auto-complete based on time or place. Refer to rules.

[warning] Recommend completing action from the SDK

If actions can be completed based on user interactions in the mobile app, we recommend using the SDK method to complete actions. SDK collects additional metadata at the time of completion, leading to more accurate data collection.

HTTP Request

POST https://api.hypertrack.com/api/v2/actions/<id>/complete/

Parameters

One optional parameter.

Property Type Description
completed_annotation String Custom text to save metadata around completion of action. It can be used to store text like success, partial success, rescheduled. It is derived by HyperTrack if you request HyperTrack to automatically complete an action, and explains what triggered it
Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X POST \
     https://api.hypertrack.com/api/v2/actions/ce2102c3-b411-4481-b13e-87559f2b441f/complete/
action = hypertrack.Action.retrieve('ce2102c3-b411-4481-b13e-87559f2b441f')
action.complete()
hypertrack.action
    .complete("ce2102c3-b411-4481-b13e-87559f2b441f");
HyperTrackClient client = new HyperTrackClient("PUBLISHABLE_KEY");
ActionFactory actionFactory = new ActionFactory(client);
Action action = actionFactory.retrieve("ce2102c3-b411-4481-b13e-87559f2b441f");
actionFactory.complete(action, null);
action = HyperTrack::Action.retrieve('ce2102c3-b411-4481-b13e-87559f2b441f')
action.complete()
Returns

Returns the action object if the call succeeded. The action's properties that are computed by HyperTrack are calculated before returning the object.

Cancel an action

Cancel the action with ID given in the request URL. You don't need to cancel an action if you created it with the `autocancel_after. If you expect user to not complete an action, it is recommended that you use one of the autocomplete or autocancel properties to get HyperTrack to do it automatically.

[warning] Be careful when you cancel an action

When an action gets canceled, all its properties that are computed by HyperTrack are set null (for integer types) or empty string (for string types) or empty (for JSON types).

HTTP Request

POST https://api.hypertrack.com/api/v2/actions/<id>/cancel/

Parameters

One optional parameter.

Property Type Description
completed_annotation String Custom text to save metadata around cancelation of action. It can be used to store text like Canceled by user, Canceled by customer, Action created accidentally and so on. It is derived by HyperTrack if you request HyperTrack to automatically cancel an action, and explains what triggered it
Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X POST \
     https://api.hypertrack.com/api/v2/actions/ce2102c3-b411-4481-b13e-87559f2b441f/cancel/
action = hypertrack.Action.retrieve('ce2102c3-b411-4481-b13e-87559f2b441f')
action.cancel()
hypertrack.action
    .cancel("ce2102c3-b411-4481-b13e-87559f2b441f");
HyperTrackClient client = new HyperTrackClient("PUBLISHABLE_KEY");
ActionFactory actionFactory = new ActionFactory(client);
Action action = actionFactory.retrieve("ce2102c3-b411-4481-b13e-87559f2b441f");
actionFactory.cancel(action, null);
action = HyperTrack::Action.retrieve('ce2102c3-b411-4481-b13e-87559f2b441f')
action.cancel()
Returns

Returns an action object if the call succeeded. The action's properties that are computed by HyperTrack are set to null/empty before returning the object.

Get an action

Get the action with ID given in the request URL.

HTTP Request

GET https://api.hypertrack.com/api/v2/actions/<id>/

Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/ce2102c3-b411-4481-b13e-87559f2b441f/
action = hypertrack.Action.retrieve('ce2102c3-b411-4481-b13e-87559f2b441f')
hypertrack.action
    .retrieve("ce2102c3-b411-4481-b13e-87559f2b441f")
    .then(function(action) {})
HyperTrackClient client = new HyperTrackClient("PUBLISHABLE_KEY");
ActionFactory actionFactory = new ActionFactory(client);
Action action = actionFactory.retrieve("ce2102c3-b411-4481-b13e-87559f2b441f");
HyperTrack::Action.retrieve('ce2102c3-b411-4481-b13e-87559f2b441f')
Returns

Returns an action object if the call succeeded.

Get multiple actions

Get all action objects based on chosen parameters.

HTTP Request

GET https://api.hypertrack.com/api/v2/actions/

Parameters

You can use any of the optional parameters to filter and/or order the action list.

Sample API Request
curl -H "Authorization: token SECRET_KEY" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/?page_size=20
actions = hypertrack.Action.list()
hypertrack.action
    .list()
    .then(function(actions) {});
```

{% sample lang="ruby" %}
```ruby
HyperTrack::Action.list
Returns

Returns a paginated list of action objects, with each page containing specified number of action objects.

Update an action

Edit an existing action object. You can use this API to change the properties that you set when creating the action.

HTTP Request

PATCH https://api.hypertrack.com/api/v2/actions/<id>/

Parameters

Pass only those parameters that you want to update.

Note that you cannot update

  • user, autocomplete_rule properties of an action
  • expected_at, expected_place properties of an action if the action has an autocomplete_rule set. Tell us if you need this capability, we will prioritise its development . If the action being patched doesn't have an autocomplete_rule then you can update these properties
  • an action once it has been completed or cancelled
Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X PATCH \
     -d "{\"type\": \"pickup\", \"unique_id\": \"CRN1234\"}" \
     https://api.hypertrack.com/api/v2/actions/d0ae4912-2074-45ef-a7c0-76be58639ea9/
action = hypertrack.Action.retrieve('d0ae4912-2074-45ef-a7c0-76be58639ea9')
action.type = 'pickup'
action.unique_id = 'CRN1234'
action.save()
hypertrack.action
    .update(
        "d0ae4912-2074-45ef-a7c0-76be58639ea9",
        {
            "type": "pickup",
            "unique_id": "CRN1234"
        }
    );
```

{% sample lang="ruby" %}
```ruby
Returns

Returns the updated action object, if the update was successful.

Delete actions

Deletes all actions in the test environment. It works only with the secret key of your test environment. Note that this API will return with HTTP error status code HTTP 400 if used with the production environment's keys. It takes no parameters.

[warning] Use this API carefully

Once deleted the data for these actions cannot be recovered. Note that the deleted actions are counted towards your monthly account limit for test environment.

HTTP Request

DELETE https://api.hypertrack.com/api/v2/actions/bulk_delete/

Sample API Request
Returns

Returns with HTTP error status code 204, if delete was successful.

Update sequence of actions

Get/update the sequence in which actions with expected_place are expected to be completed. Only actions with expected_place are returned/updated. By default, actions are expected to complete in the order they were created.

HTTP Request

POST https://api.hypertrack.com/api/v2/users/<id>/sequence_actions/

Parameters

The request body must contain exactly one parameter.

Parameter Type Comment
action_ids Ordered list of UUID strings Action IDs ordered in the sequence in which the actions are expected to be completed. These actions must be of the specified user and not yet completed/cancelled. If the list is not exhaustive, the incomplete actions of the user that have not been specified in the list are sequenced at the end of the specified list
Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X PATCH \
     -d "{\"action_ids\": [\"d0ae4912-2074-45ef-a7c0-76be58639ea9\", \"d0ae4912-2074-45ef-a7c0-76be58639ea9\"]}" \
     https://api.hypertrack.com/api/v2/users/d0ae4912-2074-45ef-a7c0-76be58639ea9/sequence_actions/
```

{% sample lang="node" %}
```javascript
```

{% sample lang="ruby" %}
```ruby
Returns

Returns a ordered list of action IDs that represents the updated action sequence, if the update was successful.

APIs to get data for common use cases

API call Method URL Description Use cases
Mileage tracking actions/<id>/mileage/ Get mileage for each action based on chosen parameters. By default, mileage is computed from the previous action completed. Mileage tracking
Placeline actions/placeline/ Get placeline and location_time_series for action Order tracking, Customer support, Operations monitoring

Mileage tracking

Get mileage for an action based on chosen parameters.

By default, mileage of an action is computed from the previous action completed. Mileage of the first action will be computed from the time/place tracking started. Tracking starts when one or more actions are created for the user. Note that a cancelled action returns null values in the mileage API.

HTTP Request

GET https://api.hypertrack.com/api/v2/actions/<id>/mileage/

Sample API Request
curl -H "Authorization: token PUBLISHABLE_KEY" \
     -H "Content-Type: application/json" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/d0ae4912-2074-45ef-a7c0-76be58639ea9/mileage/
```

{% sample lang="node" %}
```javascript
```

{% sample lang="ruby" %}
```ruby
Returns

Returns a paginated list of objects, one for each action that gets filtered with the query parameters. Each object in the response contains the action object and additional mileage data.

Property Type Description
duration_by_activity JSON Time difference, in seconds, split by activity type. In the JSON, each key is an activity type and the value is the duration for that activity
distance_by_activity JSON Distance traveled, in meters, split by activity type. In the JSON, each key is an activity type and the value is the distance traveled during that activity
steps_by_activity JSON Steps traveled, in meters, split by activity type. In the JSON, each key is an activity type and the value is the steps traveled during that activity. Returned only for walk, run and stop activities
confidence String Confidence in distance traveled computation. Possible values are high and low
confidence_reason String Reason for low confidence in distance traveled computation. If confidence is high, this is empty string

Here are the properties of duration_by_activity, distance_by_activity, and steps_by_activity JSON:

Property Type Description
total Integer Total distance/duration
drive Integer Distance/duration for which user was driving
cycle Integer Distance/duration for which user was cycling
walk Integer Distance/duration/steps for which user was walking
run Integer Distance/duration/steps for which user was running
stop Integer Distance/duration/steps for which user was stopped
unknown_location_disabled Integer Duration for which user had turned off location on the device
unknown_location_permission_denied Integer Duration for which user had denied location permission to your app
unknown_activity_permission_denied Integer Duration for which user had denied Motion and Fitness permission to your app (applicable only on iOS devices)
unknown_sdk_killed Integer Duration for which the HyperTrack SDK was killed on user's device
unknown_device_off Integer Duration for which user's device was switched off (available only for Android devices)
unknown_tracking_paused Integer Duration for which the user's device was not being tracked as pauseTracking() had been called
Sample response JSON
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "ce2102c3-b411-4481-b13e-87559f2b441f",
            <!-- all action properties -->

            "duration_by_activity": {
                "total": 1646,
                "drive": 1600,
                "cycle": 0,
                "run": 0,
                "walk": 0,
                "stop": 46,
                "unknown_location_disabled": 0,
                "unknown_location_permission_denied": 0,
                "unknown_activity_permission_denied": 0,                
                "unknown_sdk_killed": 0,
                "unknown_device_off": 0,
                "unknown_tracking_paused": 0,
            },

            "distance_by_activity": {
                "total": 120,
                "drive": 100,
                "cycle": 0,
                "run": 15,
                "walk": 5,
                "stop": 0,
            },

            "steps_by_activity": {
                "total": 200,
                "run": 10,
                "walk": 40,
                "stop": 150,
            },

            "confidence": "high",
            "confidence_reason": "",
        },

        {
            "id": "00003703-e65f-49bf-a76f-f73727afbb86",
            <!-- all action properties -->

            "duration_by_activity": {
                "total": 1746,
                "drive": 1400,
                "cycle": 0,
                "run": 0,
                "walk": 0,
                "stop": 46,
                "unknown_location_disabled": 300,
                "unknown_location_permission_denied": 0,
                "unknown_activity_permission_denied": 0,                
                "unknown_sdk_killed": 0,
                "unknown_device_off": 0,
                "unknown_tracking_paused": 0,
            },

            "distance_by_activity": {
                "total": 120,
                "drive": 100,
                "cycle": 0,
                "run": 0,
                "walk": 20,
                "stop": 0,
            },

            "steps_by_activity": {
                "total": 200,
                "run": 10,
                "walk": 40,
                "stop": 150,
            },

            "confidence": "low",
            "confidence_reason": "distance may be inaccurate as user location was disabled for long",

        }
    ]
}

Placeline

Get placeline for actions based on chosen parameters.

Similar to mileage, by default, placeline of an action is computed from the previous action completed. Placeline of the first action will be computed from the time/place tracking started. Tracking starts when one or more actions are created for the user. Note that a cancelled action returns null values in the placeline API.

HTTP Request

GET https://api.hypertrack.com/api/v2/actions/placeline/

Parameters

You can use any of the optional parameters to filter and/or order the action list.

Sample API Request
curl -H "Authorization: token SECRET_KEY" \
     -H "Content-Type: application/json" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/placeline/?collection_id=order-1234
```

{% sample lang="node" %}
```javascript
```

{% sample lang="ruby" %}
```ruby
Returns

Returns a paginated list of objects, one for each action that gets filtered with the query parameters. Each object in the response contains:

  • action object and
  • a placeline object (JSON). It is a list of activity segments, where each segment is defined by a start and an end timestamp, and has relevant location and health data as properties. Examples of activity types are stop, walk, and drive.
Sample API Response
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "00003703-e65f-49bf-a76f-f73727afbb86",
            <!-- all action properties -->

            <!-- placeline -->
            "placeline": [
                {
                  # segment identifiers
                  "id": "5c7a0e2e-35ce-4482-baa3-34f837146071",
                  "started_at": "2017-07-13T00:05:22.757000+00:00",
                  "duration": 95738.982,

                  # derived from activity
                  "type": "walk",
                  "step_count": 301,

                  # derived from location
                  "distance": 310.473,
                  "route": "aiseFr_ajVAA??fA{A??LO??l@t@??r@bA??PT??HL??r@`A??`CcD",
                  "location_time_series": "aiseFr_ajVcs{ykx@bA????PT????HL????r@`A????`CcDA",

                  # derived from device health
                  "health": [
                    {
                      "type": "network_offline",
                      "recorded_at": "2017-07-14T02:41:02.046000Z",

                    },
                    {
                      "type": "battery_low",
                      "recorded_at": "2017-07-14T02:42:01.046000Z"
                    }
                  ]
                },

                {
                  # segment identifiers
                  "id": "5c7a0e2e-35ce-4482-baa3-34f837146071",
                  "started_at": "2017-07-13T00:05:22.757000+00:00",
                  "duration": 95738.982,

                  # derived from activity - for a stop
                  "type": "stop",
                  "step_count": 301,

                  # derived from location - for a stop
                  "place": {
                    "id": "83f46d89-cacd-4a1a-9007-507dbd5a4d7c",
                    "geojson": {
                      "type": "Point",
                      "coordinates": [
                        -122.3985203814826,
                        37.7869638230917
                      ]
                    },
                    "name": "Rincon Hill Apartments",
                    "address": "182 2nd St, San Francisco, CA 94105, USA",
                    "locality": "South Beach",
                    "landmark": "",
                    "zip_code": "94105",
                    "city": "SF",
                    "state": "CA",
                    "country": "US"
                  },

                  # derived from device health
                  "health": []
                },

                {
                  # segment identifiers
                  "id": "5c7a0e2e-35ce-4482-baa3-31499904322",
                  "started_at": "2017-07-13T00:05:22.757000+00:00",
                  "duration": 95738.982,

                  # derived from activity - for unknown activity
                  "type": "unknown",
                  "unknown_reason": "activity_permission_denied",

                  # derived from location
                  "distance": 310.47333797811655,
                  "route": "LO??l@t@??r@bA??PT??HL??r@`A??`CcD",
                  "location_time_series": "{ykx@bA????PT????HL????r@`A????`CcDA",

                  # derived from device health
                  "health": [],
                }
            ]
        }
    ]
}

Filtering and ordering parameters

You can pass the following parameters as arguments in the URL of actions and actions/placeline GET APIs that returns a list. The list can be filtered/ordered using one or more parameters. All of them are optional.

Identifier filters
Parameter Type Description
id UUID String Filter action that has this id. To filter multiple actions, use a comma separated list of ids
unique_id String Filter action that has this unique_id. To filter multiple actions, use a comma separated list of unique_ids
collection_id String Filter actions that have this collection_id
user_id String Filter actions of specified user. To filter for multiple users, use a comma separated list of user_ids
user__unique_id String Filter actions of specified user. To filter for multiple users, use a comma separated list of user_unique_ids
user__group_id String Filter actions of users in the specified group_id
type String Filter actions of this type. To filter for multiple types, use a comma separated list of types

Here is a sample API to get list of actions filtered by ids:

curl -H "Authorization: token SECRET_KEY" \
     -H "Content-Type: application/json" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/?id=41caa9f2-ad63-4a8b-98ed-1414c372e1ce,4e2a8344-9864-4473-864f-e223dec208b3
Datetime filters
Parameter Type Description
min_created_at ISO datetime string Filter actions which were created after this datetime
max_created_at ISO datetime string Filter actions which were created before this datetime
min_completed_at ISO datetime string Filter actions which were completed after this datetime
max_completed_at ISO datetime string Filter actions which were completed before this datetime
min_expected_at ISO datetime string Filter actions which were scheduled after this datetime
max_expected_at ISO datetime string Filter actions which were scheduled before this datetime

Here is a sample API to get list of actions filtered by created_at dates:

curl -H "Authorization: token SECRET_KEY" \
     -H "Content-Type: application/json" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/?min_created_at=2017-10-24T18%3A30%3A00.000Z&max_created_at=2017-10-25T18%3A29%3A59.999Z
Status filters

Tell us if you need this API, we will prioritise its development

Parameter Type Description
status String Filter actions that have this status. To specify multiple statuses, use a comma separated list
arrival_status String Filter actions that have this arrival_status. To specify multiple statuses, use a comma separated list
Location filters
Parameter Type Description
completed_location__bbox Comma separated 4-tuple of lat and long Filter actions that were completed within a bounding box. Specified as max_lng,max_lat,min_lng,min_lat
Pagination parameter
Parameter Type Description
page_size integer Maximum number of objects to return, default is 50
Ordering parameter

You can order the objects returned in response of any GET list API by adding the optional ordering parameter to the URL. This parameter can have one of the following possible values. By default, the ordering is done in ascending order for the specified value. Prefix a - (minus) sign to any of the below values to get descending order.

  • Datetime ordering values: created_at, completed_at, expected_at or eta. If you request for descending order, actions that have null timestamp will be ordered last.
  • Identifier ordering values: unique_id, collection_id, type or user_id, ordered lexicographically.
  • Status ordering values: status or arrival_status, ordered lexicographically. Tell us if you need this API, we will prioritise its development
  • Movement properties' ordering values: distance or duration

Here is a sample to get list of actions ordered by the most recently completed first:

curl -H "Authorization: token SECRET_KEY" \
     -H "Content-Type: application/json" \
     -X GET \
     https://api.hypertrack.com/api/v2/actions/?ordering=-ended_at

results matching ""

    No results matching ""