Place

Place objects are important locations in the API. Places can be set as the expected end locations for Actions.

The Place object

Property Type Description
id uuid string Unique identifier for the object
name string The name of the entity, eg, hub, customer location
location GeoJSON point Location in GeoJSON format
address string Street address of the object
landmark string Landmark near the object
zip_code string Zip or postal code of the object
city string City of the object
state string State of the object
country string Country of the object
created_at ISO datetime string Timestamp of when customer was created
modified_at ISO datetime string Timestamp of when customer was modified

[warning] Locations use the GeoJSON format

In GeoJSON, the coordinates are represented as [longitude, latitude]. This is different from what you will have used in the Google Maps APIs ([latitude, longitude]). To know more GeoJSON, read their spec.

Create a Place

Creates a new place object.

HTTP Request

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

Returns

Returns a place object if the call succeeded.

Parameters

Parameter Required Description
name No Identifier for the place object
address No Street address of the object
landmark No Landmark near the object
zip_code No Zip or postal code of the object
city No City of the object
state No State of the object
country No Country of the object
location No Location in GeoJSON format

[info] Geocoding

When the latitude-longitude is specified in location field, it is assumed to be the exact location. If it is not specified, then the address field is used to geocode the place, and the geocoded latitude-longitude is saved as the location property. Although most of the data is optional, the estimated latitude-longitude improves when more data is provided.

curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X POST \
     -d "{\"address\": \"270 Linden Street\", \"city\": \"San Francisco\"}" \
     https://api.hypertrack.com/api/v1/places/

% sample lang="python" %}

place = hypertrack.Place.create(address='270 Linden Street', city='San Francisco')
HyperTrackClient client = new HyperTrackClient("YOUR_SK_TOKEN");
PlaceFactory placeFactory = new PlaceFactory(client);
Map<String, Object> params = new HashMap<>();
params.put("address", "270 Linden Street");
Place place = placeFactory.create(params);

Retrieve a Place

Retrieves the details of an existing place.

HTTP Request

GET https://app.hypertrack.io/api/v1/places/<id>/

Returns

Returns a places object if a valid identifier was provided.

curl -H "Authorization: token YOUR_PK_TOKEN" \
     https://app.hypertrack.io/api/v1/places/15ce9cdc-1409-4976-a260-dc0e5b2445ac/

% sample lang="python" %}

place = hypertrack.Place.retrieve('15ce9cdc-1409-4976-a260-dc0e5b2445ac')
HyperTrackClient client = new HyperTrackClient("YOUR_SK_TOKEN");
PlaceFactory placeFactory = new PlaceFactory(client);
Place place = placeFactory.retrieve("ce2102c3-b411-4481-b13e-87559f2b441f");

Update a Place

Edit an existing place object.

HTTP Request

PATCH https://app.hypertrack.io/api/v1/places/<id>/

Returns

Returns the updated place object.

Parameters

Parameter Required Description
address No Street address of the object
landmark No Landmark near the object
zip_code No Zip or postal code of the object
city No City of the object
state No State of the object
country No Country of the object
location No Location in GeoJSON format
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X PATCH \
     -d "{\"customer_id\": \"98241a3b-82bf-46c5-8dea-61377c546c5e\"}" \
     https://app.hypertrack.io/api/v1/places/15ce9cdc-1409-4976-a260-dc0e5b2445ac/

% sample lang="python" %}

place = hypertrack.Place.retrieve('15ce9cdc-1409-4976-a260-dc0e5b2445ac')
place.name = 'Hub 1'
place.save()
HyperTrackClient client = new HyperTrackClient("YOUR_SK_TOKEN");
PlaceFactory placeFactory = new PlaceFactory(client);
Place place = placeFactory.retrieve("ce2102c3-b411-4481-b13e-87559f2b441f");
Map<String, Object> newParams = new HashMap<>();
newParams.put("name", "Hub 1");
placeFactory.patch(place, newParams);

Delete a Place

Delete an existing place object.

HTTP Request

DELETE https://app.hypertrack.io/api/v1/places/<id>/

Returns

Empty response if the object is deleted.

curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X DELETE \
     https://app.hypertrack.io/api/v1/places/15ce9cdc-1409-4976-a260-dc0e5b2445ac/

% sample lang="python" %}

place = hypertrack.Place.retrieve('15ce9cdc-1409-4976-a260-dc0e5b2445ac')
place.delete()
HyperTrackClient client = new HyperTrackClient("YOUR_SK_TOKEN");
PlaceFactory placeFactory = new PlaceFactory(client);
Place place = placeFactory.retrieve("ce2102c3-b411-4481-b13e-87559f2b441f");
placeFactory.delete(place);

Example response

{}

List all Places

Returns a list of your places.

HTTP Request

GET https://app.hypertrack.io/api/v1/places/

Returns

Returns a list of places.

Parameters

Parameter

Required

Description </tr> </thead>

page_size

No

Maximum number of objects to return, default is 50 </tr>

min_created_at

No

Filter objects by minimum created at date </tr>

max_created_at

No

Filter objects by maximum created at date </tr> </tbody> </table> </div>

curl -H "Authorization: token YOUR_SK_TOKEN" \
     https://app.hypertrack.io/api/v1/places/

% sample lang="python" %}

places = hypertrack.Place.list()
</div>
HyperTrackClient client = new HyperTrackClient("YOUR_SK_TOKEN");
PlaceFactory placeFactory = new PlaceFactory(client);
HyperTrackArrayList<Place> places = placeFactory.list();
</div></div>
Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""