Customer
All the endpoints that can be called on the Customer controller.
Endpoints that require the CUSTOMER_READ
permission:
GET
indexGET
itemPOST
searchByPrimaryExternalIdGET
timelineByCustomerExternalID
Endpoints that require the CUSTOMER_CUD
permission:
POST
indexPUT
indexPUT
itemDELETE
itemPOST
addChannelOnlyPUT
updateCustomerDELETE
itemChannelDELETE
itemPurgeDataPOST
externalEventPOST
syncWithCRMPOST
createCustomerCRUD
Returns all the customers.
""
Pattern: ^[0-9a-zA-Z ]+$
0
15
GET /api/v2/customer HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
index
{
"type": "text",
"itemStart": 1,
"itemTotal": 1,
"itemLimit": 1,
"items": [
{
"id": 1,
"external_primary_id": "text",
"brand_name": "text",
"firstname": "text",
"lastname": "text",
"channels": []
}
]
}
Creates a new customer.
If you want to set a custom field, it should always follow the pattern of custom_
followed by the name of the custom field.
Most parameters are optional but depending on the presence of other parameters.
Name or the ID of the channel e.g. email or telephone.
Can only be processed if customer_link_channel
is set.
^([0-9]+|email|telephone|facebook|twitter)$
The name of the address, depending on the channel e.g. a phone number or an email address.
If enable customer search by channels
is enabled on the brand, this can be used instead of primary_id
The external primary ID of the customer.
Not needed if enable customer search by channels
is enabled on this brand. This will take precedent if it is included.
Does not update the ticket with the new linked channel(s) if sent along with the request.
""
Pattern: ^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
""
Pattern: ^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
Allows for instant linking the new customer to a ticket.
^\+[0-9]+$
This is a custom customer field. See the endpoint description for further explanation.
POST /api/v2/customer HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 263
{
"channel_id": "text",
"customer_link_channel": "text",
"search_customer_channel_value": "text",
"brand_id": 1,
"primary_id": "text",
"noSync": true,
"firstname": "",
"lastname": "",
"ticket_id": 1,
"extra_email": "[email protected]",
"extra_telephone": "text",
"custom_testfield": "text"
}
No content
Updates this customer's name.
If you want to update a custom field, it should always follow the pattern of custom_
followed by the name of the custom field.
PrimaryID, brandID and customerID are all optional, but dependent on the presence of at least one.
""
Pattern: ^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
""
Pattern: ^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
This is a custom customer field. See the endpoint description for further explanation.
PUT /api/v2/customer HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 102
"primaryID='text'&brandID=1&customerID=1&firstname=''&lastname=''&custom_testfield='text'"
No content
Updates any fields existing on this customer, including custom fields.
See the example for how to update custom fields. It should always follow the pattern of custom_
followed by the name of the custom field.
If you want to update or add multiple customer channels at once, it should be done in 2 parameters:
customerChannelType_0
(corresponding to the channel type ID)customerChannelValue_0
(corresponding to the address of the channel you want to add)
The 0
would be incremental if you choose to do multiple.
""
Pattern: ^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
""
Pattern: ^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
This is a custom customer field. Any custom fields you want to update start with custom_
followed by the name of the custom field.
This is how you would add/update multiple customer channels at once. the 0
would be incremental if you add/update multiple. This should always be the channel type.
This is how you add the value to the customer channel you want to add. The same goes for how the customerChannelType
gets added, only this would be the value.
PUT /api/v2/customer/{id} HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 131
"brandID=1&firstname=''&lastname=''&custom_testfield='text'&customerChannelType_0='text'&customerChannelValue_0='text'"
Successful example
{
"message": "Customer updated.",
"type": "result"
}
Searches for this customer by primary external ID.
The external primary ID of the customer.
POST /api/v2/customer/SearchByPrimaryExternalID HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 34
{
"primary_id": "text",
"brand_id": 1
}
No content
Searches for this customer by channel value.
The channel value of the customer.
POST /api/v2/customer/SearchByCustomerChannelValue HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 44
{
"customerChannelValue": "text",
"brand_id": 1
}
No content
Adds a channel to a customer.
^\+[0-9]+$
^[a-zA-Z0-9_ ]+$
POST /api/v2/customer/addChannelOnly HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 148
{
"customer_id": 1,
"primary_id": "text",
"brand_id": 1,
"extra_email": "[email protected]",
"extra_telephone": "text",
"extra_twitter": "text",
"extra_facebook": 1
}
No content
Updates the fields of this customer.
Similar to how PUT
item works.
If you want to update a custom field, it should always follow the pattern of custom_
followed by the name of the custom field.
^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\' ]+$
This is a custom customer field. Any custom fields you want to update start with custom_
followed by the name of the custom field.
This is how you would add/update multiple customer channels at once. the 0
would be incremental if you add/update multiple. This should always be the channel type.
This is how you add the value to the customer channel you want to add. The same goes for how the customerChannelType
gets added, only this would be the value.
PUT /api/v2/customer/updateCustomer HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 166
"externalPrimaryID='text'&brandID=1&firstname='text'&lastname='text'&custom_testfield='text'&customerChannelType_0='text'&customerChannelValue_0='text'"
No content
Returns the timeline from this customer by external primary ID.
External primary ID of the customer.
Include this with any value to also return ticket history for the customer.
GET /api/v2/customer/timelineByCustomerExternalID?brand_id=1&external_id=text HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
No content
Creates a new customer event e.g. an order or marketing mail to the customer timeline.
The external primary ID of the customer.
POST /api/v2/customer/externalEvent HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 110
{
"customer_id": 1,
"external_id": "text",
"brand_id": 1,
"initiated_by": "text",
"message": "text",
"source_url": "text"
}
No content
Synchronizes customer data for this customer with the CRM if a CRM lookup URL is configured for the brand.
POST /api/v2/customer/syncWithCRM HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 54
{
"brandID": 1,
"channel": "phoneNumber",
"address": "text"
}
No content
Creates a customer using the CRUD.
The external primary ID of the customer.
^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\'' ]+$
^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\.\-\'' ]+$
This is a custom customer field. Any custom fields you want to update start with custom_
followed by the name of the custom field.
This is how you would add/update multiple customer channels at once. the 0
would be incremental if you add/update multiple. This should always be the channel type.
This is how you add the value to the customer channel you want to add. The same goes for how the customerChannelType
gets added, only this would be the value.
POST /api/v2/customer/createCustomerCRUD HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 158
{
"primaryID": "text",
"brandID": 1,
"firstname": "text",
"lastname": "text",
"custom_testfield": "text",
"customerChannelType_0": "text",
"customerChannelValue_0": "text"
}
No content