Chat
User Chat
This module provides the API endpoints for the Integreat Chat API
- integreat_cms.api.v3.chat.user_chat.chat(request: HttpRequest, region_slug: str, language_slug: str, device_id: str) JsonResponse | HttpResponse [source]
Function to send a new message in the current chat of a specified device_id, or to create one if no chat exists or the user requested a new one.
- Parameters:
- Returns:
JSON object according to APIv3 chat endpoint definition
- Return type:
JsonResponse | HttpResponse
- integreat_cms.api.v3.chat.user_chat.get_or_create_user_chat(request: HttpRequest, device_id: str, language_slug: str) UserChat | None [source]
Get existing UserChat or create a new one if the HTTP method is POST.
- integreat_cms.api.v3.chat.user_chat.is_app_user_message(webhook_message: dict) bool [source]
Check if message originates from app user
param webhook_message: Zammad webhook ticket dict
- integreat_cms.api.v3.chat.user_chat.is_chat_enabled_for_user(request: HttpRequest, region_slug: str, device_id: str) JsonResponse [source]
Function to check if the chat feature is enabled for the given region and the given user.