Customers
How to list, create, get, update and delete customers
Request Overview
Actions | Returns | Description |
---|---|---|
|
| Get all customers |
|
| Create customer |
|
| Get a customer |
|
| Update a customer |
|
| Delete the customer and all tickets of the customer permanently. It's not possible to restore the data. |
|
| Get customer avatar |
|
| Update customer avatar |
Fields
Customer Object
Field | Type | Required | Specifics |
---|---|---|---|
|
| yes | |
|
| yes | Must be a valid email. |
|
| - | |
|
| - | |
|
| - | |
|
| - | |
|
| - | |
|
| - | Must be a valid timezone of the PHP function |
|
| - | |
|
| - | HTML will be sanitized. |
|
| - | Locale like
Unsupported Locales will be dropped. |
|
| - |
Avatar Object
Field | Type | Required |
---|---|---|
|
| yes |
|
| yes |
Requests
Get All Customers
GET
/api/v1/customers Returns, a collection of customers
GET /api/v1/customers HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
200
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"data": [
{
"id": 1,
"id_link": "https:\/\/api.helpspace.com\/api\/v1\/customer\/1",
"name": "New Customer",
"email": "some@email.de",
"job_title": "Master of ...",
"address": "Some Address",
"city": "Boston",
"state": "Massachusetts",
"postal_code": "02135",
"timezone": "America/New_York",
"country": "America",
"note": "Some Text",
"locale": "en-US"
"created_at": "2021-09-03T12:40:43+00:00",
"updated_at": "2021-09-03T12:40:43+00:00"
},
...
],
"links": {
...
},
"meta": {
...
}
}
Information about links and meta please read this article.
Create Customer
POST
/api/v1/customers Creates a new customer
POST /api/v1/customers HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
{
"name": "New Customer",
"email": "some@email.com",
"job_title": "Master of ...",
"address": "Some Address",
"city": "Boston",
"state": "Massachusetts",
"postal_code": "02135",
"timezone": "America/New_York",
"country": "America",
"note": "Some Text",
"locale": "en-US"
}
201
Response
HTTP/1.1 201 OK
Content-Type: application/json
...
{
"data": {
// Object like in get customer request
}
}
Get Customer
GET
/api/v1/customers/{id} Returns the customer object
GET /api/v1/customers/{{id}} HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
200
Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Encoding: gzip
...
{
"data": {
"id": 99,
"name": "New Customer",
"email": "some@email.de",
"job_title": "Master of ...",
"address": "Some Address",
"city": "Boston",
"state": "Massachusetts",
"postal_code": "02135",
"timezone": "America/New_York",
"country": "America",
"note": "Some Text",
"locale": "en-US"
"created_at": "2021-09-03T12:40:43+00:00",
"updated_at": "2021-09-03T12:40:43+00:00"
}
}
Update Customer
PATCH
/api/v1/customers/{id} Returns the customer object
PATCH /api/v1/customers/{{id}} HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
{
"name": "New Customer",
"email": "some@email.com",
"job_title": "Master of ...",
"address": "Some Address",
"city": "Boston",
"state": "Massachusetts",
"postal_code": "02135",
"timezone": "America/New_York",
"country": "America",
"note": "Some Text",
"locale": "en-US",
"created_at": "2021-09-03 12:40:43+00:00"
}
200
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"data": {
// Object like in get customer request
}
}
Delete Customer
DELETE
/api/v1/customers/{id} Deletes an existing customer and all its tickets permanently!!!
Be careful with deleting customers.
For data protection perpose, all tickets of the customer will be deleted permanently too.
DELETE /api/v1/customers/{{id}} HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
200
Response
HTTP/1.1 200 OK
{
"message": "Object deleted permanently."
}
Update Avatar
PATCH
/api/v1/customers/{id}/avatar Returns the updated avatar object
POST /api/v1/customers/{{id}}/avatar HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
{
"mime_type": "image/gif",
"data" : "R0lGODlh=="
}
200
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"data": {
"mime_type": "image/gif",
"data" : "R0lGODlh=="
}
}
Get Avatar
GET
/api/v1/customers/{id}/avatar Returns the updated avatar object
POST /api/v1/customers/{{id}}/avatar HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8
200
Response
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"data": {
"mime_type": "image/gif",
"data" : "R0lGODlh=="
}
}