o senden Sie Nachrichten an den API-Kanal
Da der API-Kanal die implizite Kontakterstellung nicht unterstützt, verwendet LivedDesk den API-Kanal in drei Schritten:
- Einen Kontakt erstellen
- Eine Konversation auf Basis der Kontaktinformationen erstellen
- Eine Nachricht senden
Einen Kontakt erstellen
API-Endpunkt
https://livedesk-api.engagelab.com/api/v2/accounts/contacts
Anfragebeispiel
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/contacts \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407,
"name": "Test", // Optional
"email": "alice@acme.inc",
"phone_number": "+123456789",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
}
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/contacts \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407,
"name": "Test", // Optional
"email": "alice@acme.inc",
"phone_number": "+123456789",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
}
Diesen Codeblock im schwebenden Fenster anzeigen
Anfrage-Header
| Field | Type | Description |
|---|---|---|
| Authorization | string | Verwenden Sie Authorization: Basic base64(API Key:API Secret) zur Authentifizierung. Gehen Sie zur Seite API Key, um API Key und API Secret zu erhalten, und verbinden Sie diese vor der Base64-Kodierung mit einem Doppelpunkt. |
| Content-Type | application/json | Datentyp. Verwenden Sie application/json für Klartextnachrichten. |
Parameter des Anfrage-Body
| Field | Type | Required | Description |
|---|---|---|---|
| inbox_id | String | Yes | Kanal-ID. Entspricht der Channel ID unter "Project Settings-Channels-Specific channel-Settings". |
| name | String | No | Kontaktname. |
| String | No | E-Mail-Adresse. | |
| phone_number | String | No | Kontaktmethode. |
| avatar_url | String | No | Link zum Anhang. |
| identifier | String | No | Benutzerkennung. |
Antwortbeispiel
{
"payload": {
"contact": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219259,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571703,
"contact_inboxes": []
},
"contact_inbox": {
"inbox": null,
"source_id": null
}
}
}
{
"payload": {
"contact": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219259,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571703,
"contact_inboxes": []
},
"contact_inbox": {
"inbox": null,
"source_id": null
}
}
}
Diesen Codeblock im schwebenden Fenster anzeigen
Antwortparameter
| Field | Type | Required | Description |
|---|---|---|---|
| additional_attributes | Object | No | Zusätzliche Attribute. |
| availability_status | String | No | Onlinestatus, Standardwert ist offline. |
| String | No | E-Mail-Adresse. | |
| id | String | No | Kontakt-ID. |
| name | String | No | Name. |
| phone_number | String | No | Telefonnummer. |
| blocked | String | No | Gibt an, ob gesperrt. Standardwert ist false. |
| identifier | String | No | Benutzerkennung. |
| thumbnail | String | No | Miniaturansicht. |
| custom_attributes | String | No | Benutzerdefinierte Attribute. |
| created_at | String | No | Erstellungszeitstempel. |
| contact_inboxes | Array | No | Kontakt-Posteingänge. |
| inbox | String | No | Kanal. |
| source_id | String | No | Quell-ID. |
Eine Konversation erstellen
API-Endpunkt
https://livedesk-api.engagelab.com/api/v2/accounts/conversations
Anfragebeispiel
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/conversations \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407, // Required
"contact_id": 2219256, // Either contact_id or source_id can be passed, but it must correctly identify the sender
"source_id": "123456789"
}
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/conversations \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407, // Required
"contact_id": 2219256, // Either contact_id or source_id can be passed, but it must correctly identify the sender
"source_id": "123456789"
}
Diesen Codeblock im schwebenden Fenster anzeigen
Anfrage-Header
| Field | Type | Description |
|---|---|---|
| Authorization | string | Verwenden Sie Authorization: Basic base64(API Key:API Secret) zur Authentifizierung. Gehen Sie zur Seite API Key, um API Key und API Secret zu erhalten, und verbinden Sie diese vor der Base64-Kodierung mit einem Doppelpunkt. |
| Content-Type | application/json | Datentyp. Verwenden Sie application/json für Klartextnachrichten. |
Parameter des Anfrage-Body
| Field | Type | Required | Description |
|---|---|---|---|
| inbox_id | String | Yes | Kanal-ID. Identisch mit der ID, die in der Schnittstelle zur Kontakterstellung verwendet wird. |
| contact_id | String | No | Kontakt-ID. Die id aus der Antwort der Schnittstelle zur Kontakterstellung. |
| source_id | String | No | Quell-ID. |
Antwortbeispiel
{
"meta": {
"sender": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219256,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571624
},
"channel": "Channel::Api",
"hmac_verified": false
},
"id": 40,
"messages": [],
"account_id": 17623000010928,
"uuid": "660ce36f-46bb-4153-948c-8a26e6dab634",
"inbox_id": 407,
"additional_attributes": {},
"agent_last_seen_at": 0,
"assignee_last_seen_at": 0,
"can_reply": true,
"contact_last_seen_at": 0,
"custom_attributes": {},
"labels": [],
"muted": false,
"snoozed_until": null,
"status": "open",
"priority": null,
"conversation_category": "chat",
"chat_mode": "private_chat",
"is_forum": false,
"created_at": 1766572062,
"updated_at": 1766572062.5803902,
"timestamp": 1766572062,
"first_reply_created_at": 0,
"unread_count": 0,
"last_non_activity_message": null,
"last_activity_at": 1766572062,
"waiting_since": 1766572062,
"sla_policy_id": null,
"ticket_id": null,
"over_limit": false,
"content_preview": {
"content": null,
"message_type": null,
"created_at": null
},
"platform": {
"channel_type": "Channel::Api",
"inbox_name": "JennyApi",
"inbox_id": 407
},
"account_info": {
"contact_name": "Test",
"contact_email": null,
"contact_phone": null,
"contact_id": 2219256,
"contact_avatar": ""
},
"assignment": {
"assignee_id": null,
"assignee_name": null,
"assignee_email": null,
"team_id": null,
"team_name": null
}
}
{
"meta": {
"sender": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219256,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571624
},
"channel": "Channel::Api",
"hmac_verified": false
},
"id": 40,
"messages": [],
"account_id": 17623000010928,
"uuid": "660ce36f-46bb-4153-948c-8a26e6dab634",
"inbox_id": 407,
"additional_attributes": {},
"agent_last_seen_at": 0,
"assignee_last_seen_at": 0,
"can_reply": true,
"contact_last_seen_at": 0,
"custom_attributes": {},
"labels": [],
"muted": false,
"snoozed_until": null,
"status": "open",
"priority": null,
"conversation_category": "chat",
"chat_mode": "private_chat",
"is_forum": false,
"created_at": 1766572062,
"updated_at": 1766572062.5803902,
"timestamp": 1766572062,
"first_reply_created_at": 0,
"unread_count": 0,
"last_non_activity_message": null,
"last_activity_at": 1766572062,
"waiting_since": 1766572062,
"sla_policy_id": null,
"ticket_id": null,
"over_limit": false,
"content_preview": {
"content": null,
"message_type": null,
"created_at": null
},
"platform": {
"channel_type": "Channel::Api",
"inbox_name": "JennyApi",
"inbox_id": 407
},
"account_info": {
"contact_name": "Test",
"contact_email": null,
"contact_phone": null,
"contact_id": 2219256,
"contact_avatar": ""
},
"assignment": {
"assignee_id": null,
"assignee_name": null,
"assignee_email": null,
"team_id": null,
"team_name": null
}
}
Diesen Codeblock im schwebenden Fenster anzeigen
Antwortparameter
| Field | Type | Required | Description |
|---|---|---|---|
| meta | Object | No | Metadatenobjekt. |
| sender | Object | No | Absenderinformationen. |
| additional_attributes | Object | No | Zusätzliche Attribute. |
| availability_status | String | No | Verfügbarkeitsstatus. |
| Null | No | E-Mail. | |
| id | Number | No | Kontakt-ID. |
| name | String | No | Absendername. |
| phone_number | Null | No | Telefonnummer. |
| blocked | Boolean | No | Gibt an, ob gesperrt. |
| identifier | Null | No | Kennung des Benutzerattributs. |
| thumbnail | String | No | Miniaturansicht. |
| custom_attributes | Object | No | Benutzerdefinierte Attribute. |
| created_at | Number | No | Erstellungszeitstempel der Konversation. |
| channel | String | No | Kanaltyp. |
| hmac_verified | Boolean | No | HMAC-Verifizierungsstatus. |
| id | Number | No | Konversations-ID. |
| messages | Array | No | Nachrichten-Array. |
| account_id | Number | No | Projekt-ID. |
| uuid | String | No | Eindeutige Kennung. |
| inbox_id | Number | No | Kanal-ID. |
| additional_attributes | Object | No | Zusätzliche Attribute. |
| agent_last_seen_at | Number | No | Zeitpunkt der letzten Bearbeitung durch den Agenten. |
| assignee_last_seen_at | Number | No | Zeitpunkt der letzten Bearbeitung durch den Zuweisungsempfänger. |
| can_reply | Boolean | No | Gibt an, ob geantwortet werden kann. |
| contact_last_seen_at | Number | No | Zeitpunkt, zu dem der Kontakt zuletzt gesehen wurde. |
| custom_attributes | Object | No | Benutzerdefinierte Attribute. |
| labels | Array | No | Label-Array. |
| muted | Boolean | No | Gibt an, ob stummgeschaltet. |
| snoozed_until | Null | No | Bis wann pausiert. |
| status | String | No | Status. |
| priority | Null | No | Priorität. |
| conversation_category | String | No | Konversationskategorie. |
| chat_mode | String | No | Chatmodus. |
| is_forum | Boolean | No | Gibt an, ob es sich um ein Forum handelt. |
| created_at | Number | No | Erstellungszeitstempel. |
| updated_at | Number | No | Aktualisierungszeitstempel. |
| timestamp | Number | No | Zeitstempel. |
| first_reply_created_at | Number | No | Erstellungszeit der ersten Antwort. |
| unread_count | Number | No | Anzahl ungelesener Nachrichten. |
| last_non_activity_message | Null | No | Letzte Nicht-Aktivitätsnachricht. |
| last_activity_at | Number | No | Zeitpunkt der letzten Aktivität. |
| waiting_since | Number | No | Startzeitpunkt des Wartens. |
| sla_policy_id | Null | No | SLA-Richtlinien-ID. |
| ticket_id | Null | No | Ticket-ID. |
| over_limit | Boolean | No | Gibt an, ob das Limit überschritten ist. |
| content_preview | Object | No | Inhaltsvorschau. |
| content_preview.content | Null | No | Vorschauinhalt. |
| content_preview.message_type | Null | No | Nachrichtentyp. |
| content_preview.created_at | Null | No | Erstellungszeit. |
| platform | Object | No | Plattforminformationen. |
| channel_type | String | No | Kanaltyp. |
| inbox_name | String | No | Name des Posteingangs. |
| inbox_id | Number | No | Posteingangs-ID. |
| account_info | Object | No | Kontoinformationen. |
| contact_name | String | No | Kontaktname. |
| contact_email | Null | No | Kontakt-E-Mail. |
| contact_phone | Null | No | Kontakttelefon. |
| contact_id | Number | No | Kontakt-ID. |
| contact_avatar | String | No | Kontakt-Avatar. |
| assignment | Object | No | Zuweisungsinformationen. |
| assignee_id | Null | No | ID des Zuweisungsempfängers. |
| assignee_name | Null | No | Name des Zuweisungsempfängers. |
| assignee_email | Null | No | E-Mail des Zuweisungsempfängers. |
| team_id | Null | No | Team-ID. |
| team_name | Null | No | Teamname. |
Eine Nachricht senden
API-Endpunkt
https://livedesk-api.engagelab.com/api/v2/accounts/conversations/:conversation_id/messages
Anfragebeispiel
curl -X POST 'https://livedesk-api.engagelab.com/api/v2/accounts/conversations/:conversation_id/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
-d '{
"content": "Der Kundenservice sendet eine Nachricht, ist das normal?",
"private": false,
"message_type": "incoming",
"content_attributes": {
"in_reply_to": 29
}
}'
curl -X POST 'https://livedesk-api.engagelab.com/api/v2/accounts/conversations/:conversation_id/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
-d '{
"content": "Der Kundenservice sendet eine Nachricht, ist das normal?",
"private": false,
"message_type": "incoming",
"content_attributes": {
"in_reply_to": 29
}
}'
Diesen Codeblock im schwebenden Fenster anzeigen
Anfrage-Header
| Field | Type | Description |
|---|---|---|
| Authorization | string | Verwenden Sie Authorization: Basic base64(API Key:API Secret) zur Authentifizierung. Gehen Sie zur Seite API Key, um API Key und API Secret zu erhalten, und verbinden Sie diese vor der Base64-Kodierung mit einem Doppelpunkt. |
| Content-Type | application/json | Datentyp. Verwenden Sie application/json für Klartextnachrichten. |
Parameter des Anfrage-Body
| Field | Type | Required | Description |
|---|---|---|---|
| content | String | No | Nachrichteninhalt. |
| private | String | No | Gibt an, ob die Nachricht privat ist. |
| message_type | String | No | Nachrichtentyp: outgoing oder incoming. Diese stehen jeweils dafür, dass der Kundenservice sendet oder der Benutzer sendet. Wenn kein Wert übergeben wird, ist der Standardwert outgoing. |
| content_attributes | String | No | Inhaltsattribute. |
| in_reply_to | String | No | Inhalt, auf den geantwortet wird. |










