Activity Customers
When you define an activity or project you can assign it to a customer and include contact names, addresses and contact phone numbers. Customer assignments are for reporting only. They do not affect any other Work-related data.
Prerequisites
There are no prerequisites for creating activity customers.
Example
In this example, we create, verify, update, and delete an activity customer.
Create an activity customer
The create request:
- creates a new activity customer named: Example
- defines various data particular to this activity customer
Example request
Call the Create Customer POST /v1/work/customers
operation with the following request payload.
{
"name": "Example",
"fullName": "Example Company, Inc.",
"contactName1": "Roger Wilco",
"address1": "1234 Example Way",
"address2": "Example, EX 12345",
"phone1": "111-111-1111",
"version": 1
}
Example response
A success response returns HTTP status code 200 and a response body similar to the following example.
{
"id": 51,
"name": "Example",
"fullName": "Example Company, Inc.",
"contactName1": "Roger Wilco",
"address1": "1234 Example Way",
"address2": "Example, EX 12345",
"phone1": "111-111-1111",
"version": 1
}
Verify
To verify, call the Retrieve Customer by ID GET /v1/work/customers/{id}
or the Retrieve All Customers or by Name GET /v1/work/customers?name={name}
operation.
Calling GET /v1/work/customers/51
or GET /v1/work/customers?name=Example
returns:
{
"id": 51,
"name": "Example",
"fullName": "Example Company, Inc.",
"contactName1": "Roger Wilco",
"address1": "1234 Example Way",
"address2": "Example, EX 12345",
"phone1": "111-111-1111",
"version": 1
}
Note: The Retrieve All Customers or by Name GET /v1/work/customers?name=Example
operation returns the object above enclosed in an array, since omitting the name
query parameter returns all activity customers in the system.
Update the activity customer
To update the activity customer by changing the contact name, call the Update Customer by ID PUT /v1/work/customers/51
operation with the following request payload.
Example request
{
"id": 51,
"name": "Example",
"fullName": "Example Company, Inc.",
"contactName1": "Jane Doe",
"address1": "1234 Example Way",
"address2": "Example, EX 12345",
"phone1": "111-111-1111",
"version": 1
}
Example response
{
"id": 51,
"name": "Example",
"fullName": "Example Company, Inc.",
"contactName1": "Jane Doe",
"address1": "1234 Example Way",
"address2": "Example, EX 12345",
"phone1": "111-111-1111",
"version": 2
}
Note that the version is automatically incremented to 2. To successfully update this activity customer again, you must pass version 2 in the request body.
Delete the activity customer
To delete this activity customer, call the Delete Customer by ID operation: DELETE /v1/work/customers/51
.
The system returns HTTP status 204 with an empty response body.
Updated over 1 year ago