Hello 👋 How can we help?

Find customers by tag via REST API

Retrieve customers data by sending the GET request with a tag name.
Written by Konstantine
Updated 3 weeks ago

You can retrieve customers data by sending the GET request with a tag name. You can specify a limit (max 100 customer per once) and offset for customers in GET parameters. You will always be available to see total amount of your customers in “total” field in the response.

Url: https://your-organization.helpcrunch.com/api/public/customers-by-tag/:tagName?limit=2&offset=15
Method: GET
Headers: Authorization: Bearer api-key=”842699d800d4df44831d8968ecfda46367717109″
Responses:

{
  "customers": [
    {
      "id": 123,
      "name": "John Doe",
      "company": "Test",
      "phone": "+3809011111111",
      "user_id": "123123",
      "email": "test@example.com",
      "referrer": "https://example.com/",
      "source": "https://example.com/somepage.html",
      "first_seen": "2016-01-18T21:18:26+0000",
      "is_anonym": false,
      "chat_status": 6,
      "sessions": 9,
      "ip": "194.133.132.4/32",
      "country": "Ukraine",
      "country_code": "UA",
      "region": "Kyiv City",
      "city": "Kiyv",
      "hostname": "yoursite.com",
      "last_page": "https://yoursite.com/somepage.html",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"
    },
    {
      "id": 124,
      "name": "John Johnson",
      "company": "Test",
      "phone": "+380938902394",
      "user_id": "3522",
      "email": "test@test.com",
      "referrer": "https://example.com/",
      "source": "https://test.com/somepage.html",
      "first_seen": "2017-03-30T00:05:36+0000",
      "sessions": 9,
      "ip": "194.133.132.4/32",
      "country": "Ukraine",
      "country_code": "UA",
      "region": "Kyiv City",
      "city": "Kiyv",
      "hostname": "yoursite.com",
      "last_page": "https://yoursite.com/somepage.html",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"
    }
  ],
  "total": 107
} 
  • You will get “401 Unauthorized” if api-key in Authorization header is wrong or absent
  • You will get “403 Access denied” if you are trying to get data from a customer that does not belong to your organization
  • You will get “404 Customers could not be found” if a customer does not exist or you sent no data
  • You will get “422 Unprocessable Entity” and “Request is not valid. Syntax error” if you use wrong customers data structure
  • You will get “403 Forbidden” and “You have exceeded your requests limit” if you send “limit” GET parameter greater than 100.
Did this answer your question?