You can get all the details of a single customer by their id.
Use Get all customers method if you want to retrieve all customers from your account. You can also search for a specific customer or a bunch of customers with the Search for customers method.
➡️ Request
URL | https://api.helpcrunch.com/v1/customers/<customer_id> |
Method | GET |
Headers | Authorization: Bearer <your_api_key> |
<customer_id> is the identifier for the customer as given by HelpCrunch. It is required for this method and looks like a combination of numbers, for example 1568834.
Read more about authorization header here.
✅ Successful Response
If your request has succeeded, you'll get a 200 OK success status code together with the following response body.
{
"id": 8737843,
"name": "Cindy Mindy",
"email": "cindy.mindy@example.com",
"userId": "example_6268",
"company": "example",
"phone": null,
"firstSeen": 1588927354,
"lastSeen": 1591627673,
"location": {
"regionCode": "CA",
"countryCode": "US",
"city": "San Francisco"
},
"device": {
"id": 28883192,
"ip": "192.168.1.1",
"timezone": "America/Los Angeles",
"platform": "desktop",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
},
"unsubscribed": false,
"blocked": false,
"source": "http://helpcrunch.com/blog/best-live-chat-software/",
"referer": "https://www.google.com/",
"locale": "en",
"notes": null,
"lastPage": "https://example.helpcrunch.com/v2/chats",
"tags": [
{
"name": "lead",
"color": "#00c2e0"
}
],
"customData": {
"Currency": "USD",
"Next payment date": "2020-09-01 00:40:00",
"Billing info added": true,
"Number of payments": 35,
"Subscription status": "active"
}
}
🛑 Error Responses
You may get one of the following error status codes and responses. More info on the errors is available here.
401 Unauthorized
{
"errors": [
{
"code": "invalid_token",
"message": "Invalid token"
}
]
}
404 Not Found
{
"errors": [
{
"code": "entity_not_found",
"message": "Customer not found"
}
]
}
429 Too Many Requests
{
"errors": [
{
"code": "too_many_requests",
"message": "You have exceeded your requests limit"
}
]
}
If you have any questions regarding the REST API, feel free to chat us any time.
👩💻 Happy Coding! 👨💻