diff --git a/chat-apis.json b/chat-apis.json index f7d39666..729f83c8 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -1756,7 +1756,6 @@ "propertyName": "category", "mapping": { "message": "#/components/schemas/messageCategorySchema", - "interactive": "#/components/schemas/interactiveCategorySchema", "custom": "#/components/schemas/customCategorySchema" } }, @@ -1766,357 +1765,52 @@ }, { "$ref": "#/components/schemas/customCategorySchema" - }, - { - "$ref": "#/components/schemas/interactiveCategorySchema" } ] }, "examples": { - "form-interactive": { - "summary": "Interactive form example", + "text-message": { + "summary": "Text message example", "value": { "receiverType": "user", - "data": { - "interactionGoal": { - "type": "allOf", - "elementIds": [ - "element8" - ] - }, - "allowSenderInteraction": true, - "interactiveData": { - "title": "Form Title", - "formFields": [ - { - "elementType": "textInput", - "elementId": "element1", - "defaultValue": "vivek", - "label": "Name", - "optional": false, - "maxLines": 1, - "placeholder": { - "text": "write your name here" - } - }, - { - "elementType": "textInput", - "elementId": "element2", - "label": "Last Name", - "optional": false, - "maxLines": 1 - }, - { - "elementType": "textInput", - "elementId": "element3", - "label": "Address", - "optional": false, - "maxLines": 5 - }, - { - "elementType": "dropdown", - "elementId": "element4", - "label": "Country", - "optional": false, - "defaultValue": "option1", - "options": [ - { - "value": "option1", - "label": "INDIA" - }, - { - "value": "option2", - "label": "AUSTRALIA" - } - ] - }, - { - "elementType": "checkbox", - "elementId": "element5", - "optional": true, - "label": "Services", - "options": [ - { - "value": "option1", - "label": "Garbage" - }, - { - "value": "option2", - "label": "Electricity Bill" - }, - { - "value": "option3", - "label": "Lift" - } - ], - "defaultValue": [ - "option1", - "option2" - ] - }, - { - "elementType": "singleSelect", - "elementId": "element6", - "optional": false, - "label": "Wing", - "defaultValue": "option1", - "options": [ - { - "value": "option1", - "label": "A Wing" - }, - { - "value": "option2", - "label": "B Wing" - } - ] - }, - { - "elementType": "button", - "elementId": "element9", - "buttonText": "About us", - "disableAfterInteracted": true, - "action": { - "actionType": "urlNavigation", - "url": "https://www.cometchat.com" - } - }, - { - "elementType": "dateTime", - "elementId": "element11", - "defaultValue": false, - "label": "Contact Number", - "optional": false, - "mode": "date", - "dateTimeFormat": "Y-m-d H:i:ss", - "timezoneCode": "Asia/Kolkata", - "from1": "2024-02-23T14:30", - "from": "2024-06-23", - "to": "2024-06-24", - "maxLines": 1, - "placeholder": { - "text": "Enter contact number" - } - } - ], - "submitElement": { - "elementType": "button", - "elementId": "element8", - "buttonText": "Submit", - "disableAfterInteracted": true, - "action": { - "actionType": "apiAction", - "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", - "method": "POST", - "payload": { - "category": "message", - "type": "text", - "data": { - "text": "Thanks For filling the Form!" - }, - "receiver": "superhero2", - "receiverType": "user" - }, - "headers": { - "appId": "10893f2ae68f59", - "Content-Type": "application/json", - "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", - "onBehalfOf": "superhero1" - }, - "dataKey": "CometChatData" - } - } - } - }, - "category": "interactive", - "type": "form", "receiver": "superhero1", - "tags": [ - "tag1" - ] + "category": "message", + "type": "text", + "data": { + "text": "Hello, this is a text message!" + } } }, - "card-interactive": { - "summary": "Interactive card example", + "media-message": { + "summary": "Media message example", "value": { "receiverType": "user", - "data": { - "interactionGoal": { - "type": "none" - }, - "allowSenderInteraction": true, - "interactiveData": { - "imageUrl": "https://upload.wikimedia.org/wikipedia/en/e/e1/Thomas_D._Baird_%28low-resolution%29.jpg", - "text": "Thanks For filling the Form!.\n\nWant to make your gifts more special? Now its easy with our personalized card messages!\n\nOur new feature lets you add a custom message on a beautifully designed card, making your gift-giving extra personal and memorable.\nWhether its for a birthday , anniversary , or just because , our card messages will express your feelings perfectly.\n\nTo start creating your own card message:\nChoose the gift\nWrite your heartfelt message\nWell print it on a high-quality card and include it with your gift\nAdd a touch of your own sentiments with our personalized card messages. Make every gift unforgettable. Start creating your card message today!\nVisit our website Website Link or download our app App Link.\n\nExpress more than just words with our Personalized Card Messages.Because its not just a gift, its your feelings.\n", - "cardActions": [ - { - "elementType": "button", - "elementId": "element8", - "buttonText": "Buy now", - "disableAfterInteracted": true, - "action": { - "actionType": "apiAction", - "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", - "method": "POST", - "payload": { - "category": "message", - "type": "text", - "data": { - "text": "Thanks For filling the Form!" - }, - "receiver": "group_1695921003310", - "receiverType": "group" - }, - "headers": { - "appId": "10893f2ae68f59", - "Content-Type": "application\\/json", - "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", - "onBehalfOf": "superhero1" - }, - "dataKey": "CometChatData" - } - }, - { - "elementType": "button", - "elementId": "element9", - "buttonText": "Navigate", - "disableAfterInteracted": true, - "action": { - "actionType": "urlNavigation", - "url": "https://www.cometchat.com" - } - }, - { - "elementType": "button", - "elementId": "element10", - "buttonText": "Submit", - "disableAfterInteracted": true, - "action": { - "actionType": "apiAction", - "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", - "method": "POST", - "payload": { - "category": "message", - "type": "text", - "data": { - "text": "Thanks For filling the Form!" - }, - "receiver": "group_1695921003310", - "receiverType": "group" - }, - "headers": { - "appId": "10893f2ae68f59", - "Content-Type": "application/json", - "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", - "onBehalfOf": "superhero1" - }, - "dataKey": "CometChatData" - } - } - ] - } - }, - "category": "interactive", - "type": "card", "receiver": "superhero1", - "tags": [ - "tag1" - ] + "category": "message", + "type": "image", + "data": { + "attachments": [ + { + "url": "https://example.com/image.jpg", + "name": "image.jpg", + "mimeType": "image/jpeg", + "extension": "jpg", + "size": "1024" + } + ] + } } }, - "scheduler-interactive": { - "summary": "Interactive scheduler example", + "custom-message": { + "summary": "Custom message example", "value": { "receiverType": "user", - "receiver": "superhero2", - "category": "interactive", - "type": "scheduler", + "receiver": "superhero1", + "category": "custom", + "type": "customType", "data": { - "receiverType": "user", - "receiver": "superhero2", - "muid": "16Jan3:41423PM", - "interactionGoal": { - "type": "anyAction", - "elementIds": [] - }, - "allowSenderInteraction": false, - "interactiveData": { - "title": "Meet with Dr. Jacob", - "avatarUrl": "https: //data-us.cometchat.io/assets/images/avatars/ironman.png", - "bufferTime": 15, - "icsFileUrl": "https://data-us.cometchat.io/23965108c9b89ad2/media/1704380186_864562419_ab59586ed5ab5f89d2c960457ceee249.ics", - "availability": { - "friday": [ - { - "to": "2359", - "from": "0000" - } - ], - "monday": [ - { - "to": "1700", - "from": "0600" - } - ], - "tuesday": [ - { - "to": "1400", - "from": "1000" - }, - { - "to": "2000", - "from": "1700" - } - ], - "thursday": [ - { - "to": "2359", - "from": "0000" - } - ], - "wednesday": [ - { - "to": "0800", - "from": "0600" - }, - { - "to": "1700", - "from": "1200" - } - ] - }, - "timezoneCode": "Asia/Kolkata", - "duration": 60, - "scheduleElement": { - "action": { - "url": "https://802bba5ae13a7.api-us.cometchat-staging.com/v3.0/messages", - "actionType": "apiAction", - "method": "post", - "dataKey": "", - "headers": { - "accept": "application/json", - "apiKey": "62a32b5140e6b630dab38e2e690d88de9c69d416", - "onBehalfOf": "suryansh1", - "content-type": "application/json" - }, - "payload": { - "data": { - "text": "Meeting Scheduled Successfully!" - }, - "type": "text", - "category": "message", - "receiver": "demo1", - "receiverType": "group" - } - }, - "elementId": "1", - "buttonText": "Schedule", - "elementType": "button", - "disableAfterInteracted": true - }, - "goalCompletionText": "Your meeting has been Scheduled", - "dateRangeStart": "2024-06-09", - "dateRangeEnd": "2024-06-09" + "customData": { + "key": "value" } } } @@ -16977,23 +16671,18 @@ ] }, "category": { - "description": "Category of the message. The available categories is custom.", + "description": "Category of the message. The available category is custom.", "type": "string", - "default": "custom", "enum": [ "custom" ] }, "quotedMessageId": { "description": "ID of the message being quoted.\nIf provided, the send message response will include a `quotedMessage` node\nin the response containing the referenced message object.", - "type": "string", - "default": "message", - "enum": [ - "message" - ] + "type": "string" }, "type": { - "description": "Type of the message.", + "description": "Type of the message. custom category can have any user defined custom types", "type": "string" }, "data": { @@ -17729,262 +17418,6 @@ }, "type": "object" }, - "interactiveCategorySchema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "muid": { - "description": "The muid will be a unique Identifier of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories is interactive.", - "type": "string", - "default": "interactive", - "enum": [ - "interactive" - ] - }, - "type": { - "description": "Type of the message. The available values are card, form and customInteractive.", - "type": "string", - "default": "card", - "enum": [ - "card", - "form", - "customInteractive", - "scheduler" - ] - }, - "data": { - "description": "JSON containing message attributes. Please select the appropriate schema based on the type property.", - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/interactionFormSchema" - }, - { - "$ref": "#/components/schemas/interactionCardSchema" - }, - { - "$ref": "#/components/schemas/SchedulerSchema" - }, - { - "$ref": "#/components/schemas/customInteractiveSchema" - } - ] - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "properties": { - "uids": { - "type": "array", - "items": { - "type": "string" - } - }, - "guids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object", - "example": { - "receiverType": "user", - "data": { - "interactionGoal": { - "type": "allOf", - "elementIds": [ - "element8" - ] - }, - "allowSenderInteraction": true, - "interactiveData": { - "title": "Form Title", - "formFields": [ - { - "elementType": "textInput", - "elementId": "element1", - "defaultValue": "vivek", - "label": "Name", - "optional": false, - "maxLines": 1, - "placeholder": { - "text": "write your name here" - } - }, - { - "elementType": "textInput", - "elementId": "element2", - "label": "Last Name", - "optional": false, - "maxLines": 1 - }, - { - "elementType": "textInput", - "elementId": "element3", - "label": "Address", - "optional": false, - "maxLines": 5 - }, - { - "elementType": "dropdown", - "elementId": "element4", - "label": "Country", - "optional": false, - "defaultValue": "option1", - "options": [ - { - "value": "option1", - "label": "INDIA" - }, - { - "value": "option2", - "label": "AUSTRALIA" - } - ] - }, - { - "elementType": "checkbox", - "elementId": "element5", - "optional": true, - "label": "Services", - "options": [ - { - "value": "option1", - "label": "Garbage" - }, - { - "value": "option2", - "label": "Electricity Bill" - }, - { - "value": "option3", - "label": "Lift" - } - ], - "defaultValue": [ - "option1", - "option2" - ] - }, - { - "elementType": "singleSelect", - "elementId": "element6", - "optional": false, - "label": "Wing", - "defaultValue": "option1", - "options": [ - { - "value": "option1", - "label": "A Wing" - }, - { - "value": "option2", - "label": "B Wing" - } - ] - }, - { - "elementType": "button", - "elementId": "element9", - "buttonText": "About us", - "disableAfterInteracted": true, - "action": { - "actionType": "urlNavigation", - "url": "https://www.cometchat.com" - } - } - ], - "submitElement": { - "elementType": "button", - "elementId": "element8", - "buttonText": "Submit", - "disableAfterInteracted": true, - "action": { - "actionType": "apiAction", - "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", - "method": "POST", - "payload": { - "category": "message", - "type": "text", - "data": { - "text": "Thanks For filling the Form!" - }, - "receiver": "superhero2", - "receiverType": "user" - }, - "headers": { - "appId": "10893f2ae68f59", - "Content-Type": "application/json", - "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", - "onBehalfOf": "superhero1" - }, - "dataKey": "CometChatData" - } - } - } - }, - "category": "interactive", - "type": "form", - "receiver": "superhero1", - "tags": [ - "tag1" - ] - } - }, - "interactiveMessageSchema": { - "properties": { - "current": { - "properties": { - "limit": { - "type": "integer" - }, - "count": { - "type": "integer" - } - }, - "type": "object" - }, - "next": { - "properties": { - "affix": { - "type": "string" - }, - "sentAt": { - "type": "integer" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, "messageCategorySchema": { "properties": { "receiver": { @@ -18004,9 +17437,8 @@ ] }, "category": { - "description": "Category of the message. The available categories are message and custom.", + "description": "Category of the message. The available category is message.", "type": "string", - "default": "message", "enum": [ "message" ] @@ -18016,15 +17448,14 @@ "type": "string" }, "type": { - "description": "Type of the message. The available values are text, image, file, audio, video.", + "description": "Type of the message. The available values are text, image, audio, video, file.", "type": "string", - "default": "text", "enum": [ "text", "image", - "file", "audio", - "video" + "video", + "file" ] }, "data": { diff --git a/data-import-apis.json b/data-import-apis.json index 85c46fcd..2ec774f5 100644 --- a/data-import-apis.json +++ b/data-import-apis.json @@ -2862,23 +2862,18 @@ ] }, "category": { - "description": "Category of the message. The available categories is custom.", + "description": "Category of the message. The available category is custom.", "type": "string", - "default": "custom", "enum": [ "custom" ] }, "quotedMessageId": { "description": "ID of the message being quoted.\nIf provided, the send message response will include a `quotedMessage` node\nin the response containing the referenced message object.", - "type": "string", - "default": "message", - "enum": [ - "message" - ] + "type": "string" }, "type": { - "description": "Type of the message.", + "description": "Type of the message. custom category can have any user defined custom types", "type": "string" }, "data": { @@ -3614,262 +3609,6 @@ }, "type": "object" }, - "interactiveCategorySchema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "muid": { - "description": "The muid will be a unique Identifier of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories is interactive.", - "type": "string", - "default": "interactive", - "enum": [ - "interactive" - ] - }, - "type": { - "description": "Type of the message. The available values are card, form and customInteractive.", - "type": "string", - "default": "card", - "enum": [ - "card", - "form", - "customInteractive", - "scheduler" - ] - }, - "data": { - "description": "JSON containing message attributes. Please select the appropriate schema based on the type property.", - "type": "object", - "oneOf": [ - { - "$ref": "#/components/schemas/interactionFormSchema" - }, - { - "$ref": "#/components/schemas/interactionCardSchema" - }, - { - "$ref": "#/components/schemas/SchedulerSchema" - }, - { - "$ref": "#/components/schemas/customInteractiveSchema" - } - ] - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "properties": { - "uids": { - "type": "array", - "items": { - "type": "string" - } - }, - "guids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object", - "example": { - "receiverType": "user", - "data": { - "interactionGoal": { - "type": "allOf", - "elementIds": [ - "element8" - ] - }, - "allowSenderInteraction": true, - "interactiveData": { - "title": "Form Title", - "formFields": [ - { - "elementType": "textInput", - "elementId": "element1", - "defaultValue": "vivek", - "label": "Name", - "optional": false, - "maxLines": 1, - "placeholder": { - "text": "write your name here" - } - }, - { - "elementType": "textInput", - "elementId": "element2", - "label": "Last Name", - "optional": false, - "maxLines": 1 - }, - { - "elementType": "textInput", - "elementId": "element3", - "label": "Address", - "optional": false, - "maxLines": 5 - }, - { - "elementType": "dropdown", - "elementId": "element4", - "label": "Country", - "optional": false, - "defaultValue": "option1", - "options": [ - { - "value": "option1", - "label": "INDIA" - }, - { - "value": "option2", - "label": "AUSTRALIA" - } - ] - }, - { - "elementType": "checkbox", - "elementId": "element5", - "optional": true, - "label": "Services", - "options": [ - { - "value": "option1", - "label": "Garbage" - }, - { - "value": "option2", - "label": "Electricity Bill" - }, - { - "value": "option3", - "label": "Lift" - } - ], - "defaultValue": [ - "option1", - "option2" - ] - }, - { - "elementType": "singleSelect", - "elementId": "element6", - "optional": false, - "label": "Wing", - "defaultValue": "option1", - "options": [ - { - "value": "option1", - "label": "A Wing" - }, - { - "value": "option2", - "label": "B Wing" - } - ] - }, - { - "elementType": "button", - "elementId": "element9", - "buttonText": "About us", - "disableAfterInteracted": true, - "action": { - "actionType": "urlNavigation", - "url": "https://www.cometchat.com" - } - } - ], - "submitElement": { - "elementType": "button", - "elementId": "element8", - "buttonText": "Submit", - "disableAfterInteracted": true, - "action": { - "actionType": "apiAction", - "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", - "method": "POST", - "payload": { - "category": "message", - "type": "text", - "data": { - "text": "Thanks For filling the Form!" - }, - "receiver": "superhero2", - "receiverType": "user" - }, - "headers": { - "appId": "10893f2ae68f59", - "Content-Type": "application/json", - "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", - "onBehalfOf": "superhero1" - }, - "dataKey": "CometChatData" - } - } - } - }, - "category": "interactive", - "type": "form", - "receiver": "superhero1", - "tags": [ - "tag1" - ] - } - }, - "interactiveMessageSchema": { - "properties": { - "current": { - "properties": { - "limit": { - "type": "integer" - }, - "count": { - "type": "integer" - } - }, - "type": "object" - }, - "next": { - "properties": { - "affix": { - "type": "string" - }, - "sentAt": { - "type": "integer" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, "messageCategorySchema": { "properties": { "receiver": { @@ -3889,9 +3628,8 @@ ] }, "category": { - "description": "Category of the message. The available categories are message and custom.", + "description": "Category of the message. The available category is message.", "type": "string", - "default": "message", "enum": [ "message" ] @@ -3901,15 +3639,14 @@ "type": "string" }, "type": { - "description": "Type of the message. The available values are text, image, file, audio, video.", + "description": "Type of the message. The available values are text, image, audio, video, file.", "type": "string", - "default": "text", "enum": [ "text", "image", - "file", "audio", - "video" + "video", + "file" ] }, "data": {