Use the Uphance Agents API to access agent data. Retrieve agent records and optionally include associated customers, contacts, and addresses.
GET all agents
Retrieve a paginated list of agents for the current organisation.
$ curl https://api.uphance.com/agents?page=1&by_customer_contact=[email]&include_customers_details=true \
-H "Authorization: ACCESS_TOKEN"
Query Parameters-
page (integer, optional): Page number (default page size is 50).
include_customers_details (boolean, optional): If present, each agent record will include its customers along with customer people and addresses. Default value is false.
by_customer_contact (string, optional): Filter agents associated with a customer contact email or phone.
Example response:
{
"agents": [
{
"id": 9155,
"name": "qaagent",
"email": "[email protected]",
"phone": "123 456 7891",
"address": "333 west 86th street",
"city": "New York",
"postal_code": "10024",
"country": "US",
"currency": "USD",
"customers": [
{
"id": 60983,
"name": "Abhey",
"company_type": "customer",
"customer_type": "wholesale",
"country": "",
"city": "",
"vat_number": "",
"channel_id": 9603,
"notes": "",
"reference": "99923",
"people": [
{
"id": 56888,
"customer_id": 60983,
"first_name": "Abhey",
"last_name": "Garg",
"position": "Owner",
"phone_1": "9638527411",
"phone_2": "",
"email": "[email protected]",
"notes": "",
"buyer": false,
"shipping": false,
"billing": false
},
],
"addresses": [
{
"id": 59563,
"customer_id": 60983,
"line_1": "Das",
"line_2": "123",
"line_3": "Road",
"city": "Chandigarh",
"state": "AL",
"country": "IN",
"postcode": "13201",
"default_for_shipping": true,
"default_for_billing": true
}
]
}
]
}
],
"meta": {
"current_page": 1,
"next_page": null,
"prev_page": null,
"total_pages": 1,
"total_count": 1
}
}
GET one agent by Agent ID
Retrieve a single agent by its unique ID.
$ curl https://api.uphance.com/agents/[Agent_ID]?include_customers_details=true \
-H "Authorization: ACCESS_TOKEN"
