Customer

Customer objects represent entities where Tasks are performed. A Customer can have multiple Destinations.

The Customer object

Property Type Description
id uuid string Unique identifier for the object
name string Name of the customer
phone string E164 formatted phone number of customer
email string Email of the customer
created_at ISO datetime string Timestamp of when customer was created
modified_at ISO datetime string Timestamp of when customer was modified

Create a Customer

Creates a new customer object.

HTTP Request

POST https://app.hypertrack.io/api/v1/customers/

Returns

Returns a customer object if the call succeeded.

Parameters

Parameter Required Description
name No Name of the customer
phone No E164 formatted phone number of customer
email No Email of the customer
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -H "Content-Type: application/json" \
     -X POST \
     -d "{\"name\": \"Customer name\", \"phone\": \"+16502469293\"}" \
     https://app.hypertrack.io/api/v1/customers/

Example response

{
  "id": "f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a",
  "name": "Customer name",
  "phone": "+16502469293",
  "email": null,
  "created_at": "2016-03-09T05:20:19.742229Z",
  "modified_at": "2016-03-09T05:20:19.742257Z"
}

Retrieve a Customer

Retrieves a customer object with the id.

HTTP Request

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

Returns

Returns a customer object if a valid identifier was provided.

curl -H "Authorization: token YOUR_PK_TOKEN" \
     -X GET \
     https://app.hypertrack.io/api/v1/customers/f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a/

Example response

{
  "id": "f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a",
  "name": "Customer name",
  "phone": "+16502469293",
  "email": null,
  "created_at": "2016-03-09T05:20:19.742229Z",
  "modified_at": "2016-03-09T05:20:19.742257Z"
}

Update a Customer

Edit an existing customer object.

HTTP Request

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

Returns

Returns the updated customer object.

Parameters

Parameter Required Description
name No Name of the customer
phone No E164 formatted phone number of customer
email No Email of the customer
curl -H "Authorization: token $ask" \
     -H "Content-Type: application/json" \
     -X PATCH \
     -d "{\"name\": \"Name changed\"}" \       
     https://app.hypertrack.io/api/v1/customers/16d3d307-21e4-42b9-aa59-ac9a2ae43c65/

Example response

{
  "id": "16d3d307-21e4-42b9-aa59-ac9a2ae43c65",
  "name": "Name changed",
  "phone": "+16502469293",
  "email": null,
  "created_at": "2016-03-09T05:20:19.742229Z",
  "modified_at": "2016-03-09T05:20:19.742257Z"
}

Delete a Customer

Delete an existing customer object.

HTTP Request

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

Returns

Empty response if the object is deleted.

curl -H "Authorization: token YOUR_SK_TOKEN" \
     -X DELETE \
     https://app.hypertrack.io/api/v1/customers/f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a/

Example response

{}

List all Customers

List all customer objects. The list can be filtered using the following parameters.

HTTP Request

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

Returns

Returns a list of customers.

Parameters

Parameter Required Description
page_size No Maximum number of objects to return, default is 50
name No Filter customers with names that contain this string
id No Filter customers with a comma separated list of ids
neighborhood_id No Filter customer objects by neighborhood
min_date No Filter objects by minimum created at date
max_date No Filter objects by maximum created at date
curl -H "Authorization: token YOUR_SK_TOKEN" \
     -X GET \
     https://app.hypertrack.io/api/v1/customers/?page_size=20

Example response

{
  "count":1,
  "next":null,
  "previous":null,
  "results":[
    {
      "id":"f3ead2ae-dc0a-4a7e-85be-74ee51d9d70a",
      "name":"Tapan Pandita",
      "phone":"+16502469293",
      "email":"tapan@hypertrack.io",
      "created_at":"2016-03-09T05:20:19.742229Z",
      "modified_at":"2016-03-09T05:20:19.742257Z"
    }
  ]
}

results matching ""

    No results matching ""