### List Groups Response Example Source: https://developers.freshchat.com/api/index Example response when listing groups, containing an array of group objects. Demonstrates different routing configurations. ```json { "groups": [ { "id": "d56d224e-1a7c-4520-8134-074143f8d958", "name": "Sales", "description": "Group to handle Sales related queries", "routing_type": "OCR", "routing_logic": "OCR" }, { "id": "1cb699d5-12c1-4cac-acbd-d95c8f75e497", "name": "Support", "description": "Group to handle support tickets", "routing_type": "DISABLED", "routing_logic": "OCR" }, { "id": "b23cd57a-0c28-47a5-8fbf-3807cdcf80c0", "name": "Automation", "description": "Group that handles automation", "routing_type": "OCR", "routing_logic": "OCR" } ] } ``` ```json { "groups": [ { "id": "d56d224e-1a7c-4520-8134-074143f8d958", "name": "Sales", "description": "Group to handle Sales related queries", "routing_type": "DISABLED", "routing_logic": "DISABLED" }, { "id": "1cb699d5-12c1-4cac-acbd-d95c8f75e497", "name": "Support", "description": "Group to handle support tickets", "routing_type": "DISABLED", "routing_logic": "DISABLED" }, { "id": "b23cd57a-0c28-47a5-8fbf-3807cdcf80c0", "name": "Automation", "description": "Group that handles automation", "routing_type": "DISABLED", "routing_logic": "DISABLED" } ] } ``` -------------------------------- ### Role Object Example Source: https://developers.freshchat.com/api/index This is an example of a role object, representing a specific role within the Freshchat system. It includes the role's unique identifier, name, a flag indicating if it's a custom role, and a description. ```json { "id": "ACCOUNT_ADMIN", "name": "Account Admin", "is_custom_role": false, "description": "Primary stakeholder of the business account" } ``` -------------------------------- ### Example Channel Response (JSON) Source: https://developers.freshchat.com/api/index This is an example JSON response for a successful channel query to the Freshchat API. It returns an array of channel objects, each containing details such as id, icon, updated_time, enabled status, public status, name, tags, welcome_message, and locale. ```json { "channels": [ { "id": "9c34831f-00b9-4fd0-8184-33105fd6d514", "icon": {}, "updated_time": "2022-11-23T08:47:10.178Z", "enabled": false, "public": true, "name": "Billing Queries", "tags": [], "welcome_message": { "message_parts": [ { "text": { "content": "Hello!! Need help?" } } ], "message_type": "normal" }, "locale": "en" }, { "id": "d645c4a5-2b8c-4109-af56-4887373522e3", "icon": { "url": "https://fc-use1-00-pics-bkt-00.s3.amazonaws.com/f5a5e46e0b9f058539df57caf009bf21cb579ca17df69204ecf9cb6d5cf3c4f1/f_marketingpicFull/u_2b76cb0dd53d87b5c1507be19c3b08dcff1fcdfde326d496db05a18de367a42f/img_h4pagd8i77_aceacc2e316969c401bb74b472a8869631786e84b38eb87738dd726f9ccf2dc6.jpeg" }, "updated_time": "2022-11-23T09:02:47.181Z", "enabled": true, "public": true, "name": "Services and promotions", "tags": [ "sales" ], "welcome_message": { "message_parts": [ { "text": { "content": "Hey!! Reach out for exciting promotions." } } ], "message_type": "normal" }, "locale": "en" } ] } ``` -------------------------------- ### Freshchat API Message Object Example Source: https://developers.freshchat.com/api/index An example demonstrating the structure of a message object within a Freshchat conversation. This includes message parts, reply parts with URL buttons, channel ID, actor type, and actor ID. ```json { "messages": [ { "message_parts": [ { "text": { "content": "For further information, check out Freshchat API documentation." } } ], "reply_parts": [ { "collection": { "sub_parts": [ { "url_button": { "url": "https://developers.freshchat.com/api/", "label": "Click for API documentation", "target": "_blank" } } ] } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` -------------------------------- ### Agent Deletion Response Example Source: https://developers.freshchat.com/api/index Example response for a successful agent deletion request. Indicates the request was accepted. ```json { "code": 202, "status": "ACCEPTED", "message": "Agent deletion request accepted" } ``` -------------------------------- ### Freshchat API Response Examples Source: https://developers.freshchat.com/api/index Examples of successful and error responses from the Freshchat API. These responses include a status code, a default status message, and a specific message detailing the API request's outcome. ```json { "code": 202, "status": "ACCEPTED", "message": "Agent deletion request accepted" } ``` ```json { "code": 404, "status": "AGENT_NOT_FOUND", "message": "agent not found" } ``` -------------------------------- ### Retrieve Agent Information - cURL Example Source: https://developers.freshchat.com/api/index This cURL command demonstrates how to retrieve information for a specific agent using their unique agent_id. It specifies the GET method, the API endpoint, and required headers for authentication and content type. ```curl curl -X GET "https://.freshchat.com/v2/agents/1ab37a05-7b3e-42ee-bcbe-283fd093408c" -H "accept: application/json" -H "Authorization: Bearer eyJraWQiOiJjxxxskdz2Dkl-I" ``` -------------------------------- ### GET /channels Source: https://developers.freshchat.com/api/index Retrieves a list of channels with optional filtering by locale. Supports pagination and sorting. ```APIDOC ## GET /channels ### Description Retrieves a list of channels, optionally filtered by locale. This endpoint supports query parameters for filtering and pagination. ### Method GET ### Endpoint /v2/channels ### Parameters #### Query Parameters - **locale** (string) - Optional - Limits the response to topics whose **locale** value matches the parameter value. Must be specified in the ISO-639 format. - **page** (integer) - Optional - Specifies the page number for pagination. - **items_per_page** (integer) - Optional - Specifies the number of items to return per page. - **sort_order** (string) - Optional - Specifies the order of sorting (e.g., 'asc', 'desc'). - **sort_by** (string) - Optional - Specifies the field to sort by (e.g., 'name'). ### Request Example ```json curl -X GET "https://.freshchat.com/v2/channels?page=1&items_per_page=2&sort_order=asc&sort_by=name&locale=en" -H "accept: application/json" -H "Authorization: Bearer eyJraxxxV4" ``` ### Response #### Success Response (200) - **channels** (array) - An array of channel objects, each containing details like id, name, locale, etc. #### Response Example ```json { "channels": [ { "id": "9c34831f-00b9-4fd0-8184-33105fd6d514", "icon": {}, "updated_time": "2022-11-23T08:47:10.178Z", "enabled": false, "public": true, "name": "Billing Queries", "tags": [], "welcome_message": { "message_parts": [ { "text": { "content": "Hello!! Need help?" } } ], "message_type": "normal" }, "locale": "en" }, { "id": "d645c4a5-2b8c-4109-af56-4887373522e3", "icon": { "url": "https://fc-use1-00-pics-bkt-00.s3.amazonaws.com/f5a5e46e0b9f058539df57caf009bf21cb579ca17df69204ecf9cb6d5cf3c4f1/f_marketingpicFull/u_2b76cb0dd53d87b5c1507be19c3b08dcff1fcdfde326d496db05a18de367a42f/img_h4pagd8i77_aceacc2e316969c401bb74b472a8869631786e84b38eb87738dd726f9ccf2dc6.jpeg" }, "updated_time": "2022-11-23T09:02:47.181Z", "enabled": true, "public": true, "name": "Services and promotions", "tags": [ "sales" ], "welcome_message": { "message_parts": [ { "text": { "content": "Hey!! Reach out for exciting promotions." } } ], "message_type": "normal" }, "locale": "en" } ] } ``` ``` -------------------------------- ### Group Object Example Source: https://developers.freshchat.com/api/index Represents a group within Freshchat, including its ID, name, description, and routing configuration. ```json { "id": "b23cd57a-0c28-47a5-8fbf-3807cdcf80c0", "name": "Automation", "description": "Group that handles automation", "routing_type": "OCR", "routing_logic": "OCR" } ``` -------------------------------- ### Message with Quick Reply Buttons Source: https://developers.freshchat.com/api/index Example of sending a message that includes a reply part containing a collection of quick reply buttons for user interaction. ```APIDOC ## Message with Quick Reply Buttons ### Description This example shows how to send a message with a reply part that includes a collection of quick reply buttons, allowing users to choose from predefined options. ### Method POST ### Endpoint /v2/conversations ### Parameters #### Request Body - **messages** (array) - Required - An array of message objects. - **message_parts** (array) - Required - An array of message parts. - **text** (object) - Required - Text content of the message part. - **content** (string) - Required - The actual text content. - **reply_parts** (array) - Required - An array of reply parts. - **collection** (object) - Required - A collection of reply elements. - **sub_parts** (array) - Required - An array of sub-parts within the collection. - **quick_reply_button** (object) - Required - Configuration for a quick reply button. - **label** (string) - Required - The text displayed on the button. - **channel_id** (string) - Required - The ID of the channel. - **actor_type** (string) - Required - The type of actor sending the message (e.g., "agent"). - **actor_id** (string) - Required - The ID of the actor. ### Request Example ```json { "messages": [ { "message_parts": [ { "text": { "content": "Click proceed for samples" } } ], "reply_parts": [ { "collection": { "sub_parts": [ { "quick_reply_button": { "label": "Proceed" } }, { "quick_reply_button": { "label": "Decline" } } ] } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` ### Response #### Success Response (200) - **messages** (array) - An array of sent message objects. #### Response Example (Response structure would typically mirror the sent message with status information) ``` -------------------------------- ### Template Message with Dropdown List Source: https://developers.freshchat.com/api/index Example of sending a template message that presents a dropdown list for users to select an option, with custom text and payloads. ```APIDOC ## Template Message with Dropdown List ### Description This example demonstrates sending a template message that includes a dropdown list for user selection. Each option can have a label, custom reply text, and a payload. ### Method POST ### Endpoint /v2/conversations ### Parameters #### Request Body - **messages** (array) - Required - An array of message objects. - **message_parts** (array) - Required - An array of message parts. - **text** (object) - Required - Text content of the message part. - **content** (string) - Required - The actual text content. - **reply_parts** (array) - Required - An array of reply parts. - **template_content** (object) - Required - Content for a template message. - **type** (string) - Required - Type of template, "quick_reply_dropdown". - **sections** (array) - Required - Sections of the dropdown. - **name** (string) - Required - Name of the section (e.g., "options"). - **parts** (array) - Required - Parts within a section. - **quick_reply_button** (object) - Required - Configuration for a dropdown option. - **label** (string) - Required - The text displayed for the option. - **custom_reply_text** (string) - Optional - Custom text sent when the option is selected. - **payload** (string) - Optional - Payload associated with the option. - **channel_id** (string) - Required - The ID of the channel. - **actor_type** (string) - Required - The type of actor sending the message (e.g., "agent"). - **actor_id** (string) - Required - The ID of the actor. ### Request Example ```json { "messages": [ { "message_parts": [ { "text": { "content": "How many employees do you have?" } } ], "reply_parts": [ { "template_content": { "type": "quick_reply_dropdown", "sections": [ { "name": "options", "parts": [ { "quick_reply_button": { "label": "0-50", "custom_reply_text": "Zero to Fifty", "payload": "Zero to Fifty payload" } }, { "quick_reply_button": { "label": "50-100", "custom_reply_text": "Fifty to hundred", "payload": "Fifty to hundred" } }, { "quick_reply_button": { "label": "500+" } } ] } ] } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` ### Response #### Success Response (200) - **messages** (array) - An array of sent message objects. #### Response Example (Response structure would typically mirror the sent message with status information) ``` -------------------------------- ### Example: Message with Image, Text, and URL Button Source: https://developers.freshchat.com/api/index Demonstrates how to construct a bot message containing an image, text, and a URL button as response enablers. ```APIDOC ## POST /conversations/{conversation_id}/messages ### Description Sends a message to a conversation, potentially including various response enablers. ### Method POST ### Endpoint `/conversations/{conversation_id}/messages` ### Request Body ```json { "messages": [ { "message_parts": [ { "text": { "content": "Click for more details!!" } }, { "image": { "url": "https://fc-xx-00.s3.xxws.com/f51/f_marketingpicFull/u_be5bb9xxxd/img_a7dxx3.png" } }, { "url_button": { "url": "https://www.freshworks.com/live-chat-software/", "label": "Freshchat", "target": "_self" } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` ### Response #### Success Response (200) Returns the sent message object, including details of the response enablers used. #### Response Example ```json { "messages": [ { "message_parts": [ { "text": { "content": "Click for more details!!" } }, { "image": { "url": "https://fc-xx-00.s3.xxws.com/f51/f_marketingpicFull/u_be5bb9xxxd/img_a7dxx3.png" } }, { "url_button": { "url": "https://www.freshworks.com/live-chat-software/", "label": "Freshchat", "target": "_self" } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` ``` -------------------------------- ### Configure Dynamic URL Placeholder for Call-to-Action Source: https://developers.freshchat.com/api/index This example shows how to configure a 'Visit Website' type Call-to-Action button in a message template with a dynamic placeholder. The placeholder is appended to the URL, and the URL type should be set to 'Dynamic' for this functionality. Only one placeholder can be added. ```text Example: https://www.freshworks.com/{{1}} ``` -------------------------------- ### Send Message with Quick Reply Buttons Source: https://developers.freshchat.com/api/index This example demonstrates sending a message with a reply part that contains a collection of quick reply buttons. These buttons allow users to respond with predefined options. Each button requires a 'label'. ```json { "messages": [ { "message_parts": [ { "text": { "content": "Click proceed for samples" } } ], "reply_parts": [ { "collection": { "sub_parts": [ { "quick_reply_button": { "label": "Proceed" } }, { "quick_reply_button": { "label": "Decline" } } ] } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` -------------------------------- ### Outbound Message Object Example (JSON) Source: https://developers.freshchat.com/api/index An example of the outbound message object returned by the Freshchat API. This object details the status, sender, recipient, and content of a sent message, including potential failure reasons. ```json { "message_id": "5841b28c-7869-474f-9b25-c2b1ba9aa7b9", "from": { "phone_number": "+919999999999" }, "provider": "whatsapp", "to": [ { "phone_number": "+919999999999" } ], "data": { "message_template": { "storage": "conversation", "template_name": "shipping_update", "namespace": "XXXXXXXX_XXXX_XXXX_XXXX_XXXXXXXXXXXX", "language": { "policy": "deterministic", "code": "en_US" }, "rich_template_data": { "body": { "params": [ { "data": "Username" } ] } } } }, "request_id": "5841b28c-7869-474f-9b25-c2b1ba9aa7b9", "status": "Failed", "created_on": 1566970961, "failure_code": "OBM001", "failure_reason": "no template exists" } ``` -------------------------------- ### Create User Request (Curl Example) Source: https://developers.freshchat.com/api/index This cURL command demonstrates how to create a new user in Freshchat. It uses a POST request to the `/v2/users` endpoint and includes a JSON payload with user details such as `email`, `first_name`, `phone`, and optional `avatar` and `properties`. Ensure the `Authorization` header is correctly set. ```curl curl -X POST "https://.freshchat.com/v2/users" -H "accept: application/json" -H "Authorization: Bearer eyJraxxxdQ" -H "Content-Type: application/JSON" -d "{ 'avatar': { 'url': 'https://web.freshchat.com/img/johndoe.png' }, 'email': 'milton.doe@mail.com', 'first_name': 'Milton', 'last_name': 'Doe', 'phone': '235689714', 'properties': [ { 'name': 'orderId', 'value': '#1242' } ], 'reference_id': 'milton@doe' }" ``` -------------------------------- ### List Users with Filters (JSON Example) Source: https://developers.freshchat.com/api/index Demonstrates the structure of a JSON response when listing users with applied filters. This response includes user details, pagination information, and links for navigation. It's useful for understanding the data format returned by user listing APIs. ```json { "users": [ { "properties": [ { "name": "fc_user_timezone", "value": "Asia/Calcutta" } ], "reference_id": "random123@random.com", "restore_id": "d323efcb-1a2e-4ccc-96d0-cb0791481f61", "created_time": "2022-10-13T09:03:34.709Z", "updated_time": "2022-10-27T12:25:15.831Z", "id": "2079f4e7-e608-43d9-acb1-593908ca5426", "first_name": "Alice", "last_name": "Doe", "email": "alice.doe@mail.com", "avatar": {}, "phone": "639528417", "login_status": false }, { "properties": [ { "name": "fc_user_timezone", "value": "Asia/Calcutta" }, { "name": "siteId", "value": "213123" } ], "reference_id": "121", "restore_id": "0663d5f0-f6cc-43f6-bd74-e5d0c0e2cf09", "created_time": "2022-08-29T07:32:07.003Z", "updated_time": "2022-10-27T12:30:39.591Z", "id": "ca03d5ea-9615-4069-8938-bc39e522a436", "first_name": "Alice", "last_name": "John", "email": "alice.john@email.com", "avatar": {}, "phone": "174285396", "login_status": false } ], "pagination": { "total_items": 4, "total_pages": 1, "current_page": 1, "items_per_page": 100 }, "links": { "first_page": { "href": "/v2/users?first_name=Alice&items_per_page=100&sort_order=asc&sort_by=email&page=1", "rel": "user", "type": "GET" }, "last_page": { "href": "/v2/users?first_name=Alice&items_per_page=100&sort_order=asc&sort_by=email&page=1", "rel": "user", "type": "GET" } } } ``` -------------------------------- ### Configure Dynamic Placeholder for Visit Website Button Source: https://developers.freshchat.com/api/index This section describes how to configure a 'Visit Website' type Call-to-Action button in a message template with a dynamic placeholder for the URL. Only one placeholder can be added. ```APIDOC ## Message Template Configuration ### Description Allows configuring a 'Visit Website' Call-to-Action button with a dynamic placeholder for the URL. ### Configuration Steps 1. **Choose URL Type**: Select 'Dynamic' for the URL type. 2. **Provide Placeholder**: Define a placeholder in the URL (e.g., `https://www.freshworks.com/{{1}}`). Only one placeholder is allowed. ### Preview of Modified Template (Visual representation of the template with the configured button and placeholder) ### Redirection Behavior When the user clicks the URL, the placeholder is replaced with the actual value, opening the fully qualified URL. ``` -------------------------------- ### List Roles Response Example Source: https://developers.freshchat.com/api/index This JSON snippet illustrates a successful response when listing roles from the Freshchat API. It includes an array of role objects, pagination details, and links for navigating through the results. ```json { "roles": [ { "id": "ACCOUNT_ADMIN", "name": "Account Admin", "is_custom_role": false, "description": "Primary stakeholder for the business account." }, { "id": "ADMIN", "name": "Admin", "is_custom_role": false, "description": "Stakeholder with all Admin permissions." }, { "id": "AGENT", "name": "Agent", "is_custom_role": false, "description": "Account partner with agent level permissions." }, { "id": "8bee5c99-2695-436c-a266-5cb310190406", "name": "Internal agent", "is_custom_role": true, "description": "Account executive identified as an internal agent." } ], "pagination": { "total_items": 37, "total_pages": 4, "current_page": 1, "items_per_page": 10 }, "links": { "next_page": { "href": "/v2/roles?sort_by=name&items_per_page=10&sort_order=asc&page=2", "rel": "role", "type": "GET" }, "first_page": { "href": "/v2/roles?sort_by=name&items_per_page=10&sort_order=asc&page=1", "rel": "role", "type": "GET" }, "last_page": { "href": "/v2/roles?sort_by=name&items_per_page=10&sort_order=asc&page=4", "rel": "role", "type": "GET" } } } ``` -------------------------------- ### Conversation Properties Response Example | JSON Source: https://developers.freshchat.com/api/index This is an example of a successful JSON response when listing conversation properties. It shows the structure of an array containing conversation property field objects, including default and custom properties with their attributes like id, name, type, and choices. ```json [ { "id": "675fb5f6-ff96-4f73-a9b3-e62554958c65", "name": "priority", "label": "Priority", "type": "DROPDOWN", "custom": false, "editable": true, "position": 174, "required": false, "choices": [ { "id": "1", "value": "Low" }, { "id": "2", "value": "Medium" }, { "id": "3", "value": "High" }, { "id": "4", "value": "Urgent" } ], "default_value": "1" }, { "id": "98b26df9-168f-4f1c-8dcb-9abef7ee99f2", "name": "cf_type", "label": "Type", "type": "DROPDOWN", "custom": true, "editable": true, "position": 175, "required": false, "choices": [ { "id": "62c868a6-66e5-4c3e-863e-ddaa53f1e50b", "value": "General Query" }, { "id": "9212cbf7-ac45-4383-aab6-99b902fd9071", "value": "Technical Query" }, { "id": "fab25bc8-2135-43e7-950d-1a98ac377e61", "value": "Feature Request" }, { "id": "1b6d82c8-8c0c-4278-ad18-ea0ce635a043", "value": "Feedback" } ] }, { "id": "4d2e24e6-6742-421b-bb5a-f880ecb053c2", "name": "cf_rating", "label": "Rating", "type": "NUMBER", "custom": true, "editable": true, "position": 126, "required": false, "choices": [] } ] ``` -------------------------------- ### GET /v2/business-hours/within-bh Source: https://developers.freshchat.com/api/index Verifies if a specific group is within its configured business hours. ```APIDOC ## GET /v2/business-hours/within-bh ### Description Identifies a group by its `group_id` and returns a boolean response indicating whether the group is currently within its defined business hours. ### Method GET ### Endpoint /v2/business-hours/within-bh ### Query Parameters - **group_id** (string) - Required - The unique identifier for the group. If not specified, a default response is returned. ### Request Example ```bash curl -X GET "https://.freshchat.com/v2/business-hours/within-bh?group_id=12345-abcde" ``` ### Response #### Success Response (200) - **is_within_business_hours** (boolean) - `true` if the group is within business hours, `false` otherwise. #### Response Example ```json { "is_within_business_hours": true } ``` ``` -------------------------------- ### Example Channel Object Structure Source: https://developers.freshchat.com/api/index Illustrates the structure of a single channel (topic) object returned by the Freshchat API. This object contains details such as the channel's ID, name, icon, enablement status, visibility, associated tags, welcome message, and locale. ```json { "id": "d645c4a5-2b8c-4109-af56-4887373522e3", "updated_time": "2022-11-23T04:56:13.587Z", "name": "Services and promotions", "icon": { "url": "https://fc-pics-bkt-00.s3.aws.com/ff1/f_marketingpic/u_2f/img_a6.jpeg" }, "enabled": true, "tags": [ "sales" ], "public": true, "welcome_message": { "message_parts": [ { "text": { "content": "Hey!! Reach out for exciting promotions." } } ], "message_type": "normal" }, "locale": "en" } ``` -------------------------------- ### GET /reports/raw/{id} Source: https://developers.freshchat.com/api/index Retrieves a specific raw report using its ID. ```APIDOC ## GET /reports/raw/{id} ### Description Retrieves a specific raw report using its ID. ### Method GET ### Endpoint /reports/raw/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the report to retrieve. ### Response #### Success Response (200) - The response will be the content of the requested report in CSV format. #### Response Example ```csv start_time,end_time,event,agent_id,group_id 2020-01-23T00:30:00.000Z,2020-01-23T18:59:59.000Z,Conversation-Group-Assigned,agent123,groupXYZ ``` ``` -------------------------------- ### Displaying a Carousel Card with Text, Image, and URL Button Source: https://developers.freshchat.com/api/index This example demonstrates how to construct a message that includes a text part, an image part, and a URL button part. This is useful for rich responses in the Freshchat interface. ```json { "messages": [ { "message_parts": [ { "text": { "content": "Click for more details!!" } }, { "image": { "url": "https://fc-xx-00.s3.xxws.com/f51/f_marketingpicFull/u_be5bb9xxxd/img_a7dxx3.png" } }, { "url_button": { "url": "https://www.freshworks.com/live-chat-software/", "label": "Freshchat", "target": "_self" } } ], "channel_id": "b0247bdb-2796-4489-bd0a-09c22b5440dc", "actor_type": "agent", "actor_id": "1de5d130-1c62-48cf-8349-1b39c60d0c28" } ] } ``` -------------------------------- ### CSAT Survey Response Example (JSON) Source: https://developers.freshchat.com/api/index This snippet provides an example of a successful CSAT survey response from the Freshchat API. It includes a unique response ID, creation timestamp, feedback details, rating, interaction and conversation IDs, issue resolution status, CSAT attributer ID, app ID, and reopen conversation status. ```json { "csat_response_id": 741611473053925, "created": 1683812688548, "additional_feedback": "Issue was resolved in a very short time", "rating": 5, "interaction_id": "463700702359153-1615963379263", "conversation_id": "7bc48e9b-e75d-4e67-a96c-384396ef8631", "issue_resolved": true, "csat_attributer_id": 464464627971760, "app_id": 587545534469, "reopen_conversation": false } ``` -------------------------------- ### GET /websites/developers_freshchat_api Source: https://developers.freshchat.com/api/index Retrieves historical metrics with various query parameters for filtering and aggregation. ```APIDOC ## GET /websites/developers_freshchat_api ### Description Retrieves historical metrics with various query parameters for filtering, grouping, and specifying time intervals. ### Method GET ### Endpoint /websites/developers_freshchat_api ### Parameters #### Query Parameters - **metric** (string) - Mandatory - Name of the metric to be retrieved. Refer to Historic metrics for valid values. - **start** (datetime) - Mandatory - Starting date-time of the period in UTC format. - **end** (datetime) - Mandatory - Ending date-time of the period in UTC format. - **interval** (string) - Optional - Frequency of metric retrieval. Valid values: 1m, 5m, 15m, 1h, 1d, 1w, 1mo. - **aggregator** (string) - Mandatory for aggregate metrics - Method to summarize atomic metrics. Valid values: min, max, avg, median, p90. Do not use for count metrics. - **x_time** (string) - Mandatory for specific conversation metrics - Specifies a time period relative to the current instant (e.g., '30m' for 30 minutes ago). Note: start and end parameters are still required. - **group_by** (string) - Optional - Grouping criteria for metrics. Can be 'group', 'agent', or 'rating' (for csat_metrics.rating). - **filter_by** (string) - Optional - Filters the retrieved metrics based on specified criteria. Refer to Historic metrics for valid values. ### Request Example ```json { "example": "GET /websites/developers_freshchat_api?metric=conversation_metrics.resolved_interactions&start=2023-01-01T00:00:00Z&end=2023-01-31T23:59:59Z&interval=1d&aggregator=avg&group_by=agent" } ``` ### Response #### Success Response (200) - **data** (array) - Array of metric data points. - **timestamp** (datetime) - The timestamp for the data point. - **value** (number) - The metric value. #### Response Example ```json { "example": { "data": [ { "timestamp": "2023-01-01T00:00:00Z", "value": 15 }, { "timestamp": "2023-01-02T00:00:00Z", "value": 20 } ] } } ``` ``` -------------------------------- ### GET /v2/conversations/{conversation_id} Source: https://developers.freshchat.com/api/index Retrieves details of a specific conversation using its unique identifier. ```APIDOC ## GET /v2/conversations/{conversation_id} ### Description Identifies a conversation by the **conversation_id** passed in the request and returns the corresponding information as a conversation object. ### Method GET ### Endpoint /v2/conversations/{conversation_id} ### Parameters #### Path Parameters - **conversation_id** (string) - Required - Identifier of the conversation object, auto-generated when a conversation record is created in the Freshchat system. #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET "https://.com/v2/conversations/12345abcde-fghij-klmno-pqrst-uvwxyz123456" \ -H "accept: application/json" \ -H "Authorization: Bearer eyJraxxx24X0" ``` ### Response #### Success Response (200 OK) - **conversation_id** (string) - Identifier of the conversation. - **status** (string) - Status of the conversation. - **messages** (array of objects) - Details of the messages in the conversation. - **properties** (object) - Properties of the conversation. - **users** (array of objects) - Details of the users involved in the conversation. #### Response Example ```json { "conversation_id": "12345abcde-fghij-klmno-pqrst-uvwxyz123456", "status": "new", "messages": [ { "message_parts": [ { "text": { "content": "Hii! Need help in receiving the refund." } } ], "channel_id": "71df7c11-df1e-4365-80e3-75a434c9caf0", "message_type": "normal", "actor_type": "user", "actor_id": "86a76727-f5f7-40b5-8f93-309043646b1c20230415141608" } ], "properties": { "priority": "Low" }, "users": [ { "id": "86a76727-f5f7-40b5-8f93-309043646b1c20230415141608" } ] } ``` ``` -------------------------------- ### Example List of Channels Response Source: https://developers.freshchat.com/api/index Demonstrates the JSON response structure when retrieving a list of all channels from the Freshchat API. This response is an object containing a 'groups' array, where each element represents a configured topic (channel) with its associated properties. ```json { "groups": [ { "id": "d56d224e-1a7c-4520-8134-074143f8d958", "name": "Sales", "description": "Group to handle Sales related queries", "routing_type": "INTELLIASSIGN", "routing_logic": "ROUND_ROBIN" }, { "id": "1cb699d5-12c1-4cac-acbd-d95c8f75e497", "name": "Support", "description": "Group to handle support tickets", "routing_type": "INTELLIASSIGN", "routing_logic": "ROUND_ROBIN" }, { "id": "b23cd57a-0c28-47a5-8fbf-3807cdcf80c0", "name": "Automation", "description": "Group that handles automation", "routing_type": "DISABLED", "routing_logic": "ROUND_ROBIN" } ] } ``` -------------------------------- ### List Roles using Curl Source: https://developers.freshchat.com/api/index This snippet demonstrates how to retrieve a list of all roles configured in the Freshchat system using a cURL command. It includes parameters for pagination and sorting, and requires an authorization token. ```curl curl -X GET "https://.freshchat.com/v2/roles?page=1&items_per_page=10&sort_order=asc&sort_by=name" -H "accept: application/json" -H "Authorization: Bearer eyJraWQiOiJjxxxskdz2Dkl-I" ```