Create Expected Visits

Last updated 11 days ago

APIs to create and manage expected visits

This product feature is still under development and is not available in production. Please reach out to us on Slack if you want an early access.

Create place

Create a custom place object where you expect the visit to happen

HTTP Request

POST https://api.hypertrack.com/v3/places

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added

Create expected visit

Create expected visit(s) by sharing device_id and place_id

Note:

  1. Pass a device_id if you expect a specific device to visit that place; do not pass any device_id if you expect any devices in your account to visit that place

  2. If you want the visits to get created only once for that place, set occurrence to once. In this case, the expected visit gets cancelled after the first visit; if you want set a permanent geofence at that place and keep creating visits whenever the device visits those places, set occurrence to always

  3. You can set account-level expected_visits only when you set occurrence to always

HTTP Request

POST https://api.hypertrack.com/v3/expected_visits

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added

Get expected visit

Get expected visit(s) by passing a specific expected visit_id

HTTP Request

GET https://api.hypertrack.com/v3/expected_visits/<expected_visit_id

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added

Get expected visits for a device

Get expected visits for a device by passing a specific device_id. We return all expected visits for that device, in the order the device is expected to visit those places. There is no well defined order of expected visits with occurrence set as always.

HTTP Request

GET https://api.hypertrack.com/v3/expected_visits/?device_id=<device_id>&occurrence=[once|always]

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added

Manually mark visits

Manually mark the visit as they happen. It will create a visit. It will also cancel the corresponding expected visit if the occurrence of the expected visit was set as once.

HTTP Request

PATCH https://api.hypertrack.com/v3/expected_visits/<expected_visit_id>

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added

Cancel expected visits

Cancel expected visits if you don’t want HyperTrack to create visits to those places. Completed visits that won’t be impacted. You can pass either an expected_visit_id if you want to deactivate a specific expected visit, or pass a device_id if you want to deactivate all the expected visits for that device.

HTTP Request

PATCH https://api.hypertrack.com/v3/expected_visits/<expected_visit_id>

OR

PATCH https://api.hypertrack.com/v3/expected_visits?device_id=<device_id>

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added

Reorder expected visits

HyperTrack assumes the visits to take place in order in which they were created for ETA and expected route computation. Re-order expected visits using this API. Send all the expected_visit_ids that you want to re-order. The ids should belong to the same device_id. Only once visits can be reordered. You will get an error if any always visit is passed to this API.

HTTP Request

GET https://api.hypertrack.com/v3/eta/device/<device_id>/order andPOST https://api.hypertrack.com/v3/eta/device/<device_id>/order

Parameters

Parameter

Type

Description

Required

x

x

x

x

Sample Request

TO BE ADDED

Returns

PROPERTY

TYPE

DESCRIPTION

x

x

Sample Response

to be added