export interface Message { /** * Message ID. * @readonly */ id?: string | null; /** Structured message content. */ content?: MessageContent; /** * ID of the message sender. * * Defaults to the caller's ID * using the property that matches their identity type. * For 3rd-party apps, defaults to using the app's `appId`. * * You can override the default behavior when calling * [Send Message](https://dev.wix.com/api/rest/inbox/messages/send-message) * by using the `sendAs` parameter. * @readonly */ sender?: IdentificationData; /** * Optional icon and short text providing additional details about the message, * such as the app from which the message was sent, or whether the message was an automated response. * * Currently only 1 badge is supported. */ badges?: Badge[]; /** * Communication channel to send the message to. * * Currently messages can be sent to 1 channel only. */ targetChannels?: ChannelType[]; /** Communication channel the message is sent from. */ sourceChannel?: ChannelType; /** * ID of the application that sent the message. * * Omitted if the message was sent with the Chat widget. * @readonly */ appId?: string | null; /** * __Required.__ * Controls who can see the message. */ visibility?: MessageVisibility; /** * Sequential ordering of the message. * * Ensures more accurate sorting than `createdDate` * if two messages are sent at the same time. * @readonly */ sequence?: string | null; /** * __Required.__ * Message direction. */ direction?: MessageDirection; /** Date and time the message was sent. */ createdDate?: Date | null; } export interface MessageContent extends MessageContentPayloadOneOf { /** Plain text, file, or image message. */ basic?: BasicMessagePayload; /** * Template containing an image, title, text, * and/or up to 10 call-to-action buttons. */ template?: TemplateMessagePayload; /** * Minimal message containing a single line of text * and an optional icon. * Often reports an activity that took place. */ minimal?: MinimalMessagePayload; /** * Message containing submitted form data. * Typically sent with a `direction` of `PARTICIPANT_TO_BUSINESS` * and message `visibility` of `BUSINESS`. */ form?: FormMessagePayload; /** * System message. * For internal use. */ system?: SystemMessagePayload; /** * Summary of message contents. * Displayed in Inbox in the * [Message List](https://support.wix.com/en/article/wix-inbox-getting-started#view-your-messages). */ previewText?: string | null; /** Message title. */ title?: string | null; } /** @oneof */ export interface MessageContentPayloadOneOf { /** Plain text, file, or image message. */ basic?: BasicMessagePayload; /** * Template containing an image, title, text, * and/or up to 10 call-to-action buttons. */ template?: TemplateMessagePayload; /** * Minimal message containing a single line of text * and an optional icon. * Often reports an activity that took place. */ minimal?: MinimalMessagePayload; /** * Message containing submitted form data. * Typically sent with a `direction` of `PARTICIPANT_TO_BUSINESS` * and message `visibility` of `BUSINESS`. */ form?: FormMessagePayload; /** * System message. * For internal use. */ system?: SystemMessagePayload; } export interface BasicMessagePayload { /** * List of plain text messages, images, and/or files. * List items are displayed as separate messages * in Inbox and the site's chat widget. */ items?: BasicMessageData[]; } export interface BasicMessageData extends BasicMessageDataDataOneOf { /** Text message. */ text?: string; /** * Image message. * Can contain an image from Wix Media * or from an external provider. */ image?: ImageMessage; /** * File attachment. * Can contain a file from Wix Media or an external provider. */ file?: FileMessage; } /** @oneof */ export interface BasicMessageDataDataOneOf { /** Text message. */ text?: string; /** * Image message. * Can contain an image from Wix Media * or from an external provider. */ image?: ImageMessage; /** * File attachment. * Can contain a file from Wix Media or an external provider. */ file?: FileMessage; } export interface ImageMessage { /** Wix Media ID. */ id?: string | null; /** URL where the image is hosted. */ url?: string; /** File name of the original file. */ filename?: string | null; /** Original image width, in pixels. */ width?: number; /** Original image height, in pixels. */ height?: number; } export interface FileMessage { /** Wix Media ID. */ id?: string | null; /** URL where the file is hosted. */ url?: string; /** File name of the original file. */ filename?: string | null; /** File [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). */ mimeType?: string | null; } export interface TemplateMessagePayload { /** Title displayed in the message. */ title?: string | null; /** * List of buttons to display with the message. * Buttons can either open a URL or pass interaction details to the * [Button Interacted Webhook](https://dev.wix.com/api/rest/all-apis/inbox/button-interacted-webhook). * * Maximum: 10 buttons. */ buttons?: Button[]; /** * Controls whether the message is displayed in portrait or landscape layout. * * Default: `PORTRAIT`. */ orientation?: Orientation; /** * List of lines of text. Each item in the array is displayed on a new line. * * Max: 10 lines (up to 512 characters per line). */ textLines?: string[]; /** URL where the icon is hosted. */ imageUrl?: string | null; } export interface Button { /** Button label text. */ label?: string; /** If included, the button launches the specified URL. */ launchUrl?: string | null; /** * Properties to pass to the * [Button Interacted webhook](https://dev.wix.com/api/rest/inbox/messages/button-interacted-webhook) * when the button is clicked. */ postbackProperties?: PostbackProperties; } export interface PostbackProperties { /** * [Your app's](https://dev.wix.com/dc3/my-apps) App ID. * @readonly */ appId?: string | null; /** ID you define for the interaction, to be handled by your server. */ interactionId?: string; } export declare enum Orientation { /** Unknown orientation. */ UNKNOWN_ORIENTATION = "UNKNOWN_ORIENTATION", /** Portrait layout. */ PORTRAIT = "PORTRAIT", /** Landscape layout. */ LANDSCAPE = "LANDSCAPE" } export interface MinimalMessagePayload { /** Message text. */ text?: string; /** URL where the icon is hosted. */ iconUrl?: string | null; /** If included, URL the user is redirected to when clicking the message. */ url?: string | null; } export interface FormMessagePayload { /** Form title displayed in the message. */ title?: string | null; /** Form description displayed below the title. */ description?: string | null; /** List of form fields and values. */ fields?: FormField[]; /** * List of files and/or images attached to the form. * * List items are displayed as separate messages * in Inbox and the site's chat widget. */ media?: MediaItem[]; } export interface FormField { /** Form field display name. */ name?: string; /** Submitted value. */ value?: string; } export interface MediaItem extends MediaItemMediaOneOf { /** * Image message. * Can contain an image from Wix Media * or from an external provider. */ image?: ImageMessage; /** * File attachment. * Can contain a file from Wix Media or an external provider. */ file?: FileMessage; } /** @oneof */ export interface MediaItemMediaOneOf { /** * Image message. * Can contain an image from Wix Media * or from an external provider. */ image?: ImageMessage; /** * File attachment. * Can contain a file from Wix Media or an external provider. */ file?: FileMessage; } export interface SystemMessagePayload { /** Text message. `\n` renders as a line break. */ text?: string; /** * List of buttons to display with the message. * Buttons can either open a URL or pass interaction details to the * [Button Interacted Webhook](https://dev.wix.com/api/rest/all-apis/inbox/button-interacted-webhook). * * Maximum: 10 buttons. */ buttons?: Button[]; /** URL where the icon is hosted. */ imageUrl?: string | null; } export declare enum ContentType { UNKNOWN_CONTENT = "UNKNOWN_CONTENT", BASIC = "BASIC", TEMPLATE = "TEMPLATE", MINIMAL = "MINIMAL", FORM = "FORM", SYSTEM = "SYSTEM", UNSUPPORTED = "UNSUPPORTED" } export interface IdentificationData extends IdentificationDataIdOneOf { /** Anonymous site visitor ID. */ anonymousVisitorId?: string; /** * Site * [member](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/members) * ID. */ memberId?: string; /** User ID of the site owner or a site contributor. */ wixUserId?: string; /** App ID. */ appId?: string; /** * Optional site * [contact](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fcontacts) ID. * @readonly */ contactId?: string | null; } /** @oneof */ export interface IdentificationDataIdOneOf { /** Anonymous site visitor ID. */ anonymousVisitorId?: string; /** * Site * [member](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/members) * ID. */ memberId?: string; /** User ID of the site owner or a site contributor. */ wixUserId?: string; /** App ID. */ appId?: string; } export interface Badge { /** Display text. */ text?: string; /** URL where the icon is hosted. */ iconUrl?: string | null; /** * Controls whether the badge is visible to the participant. * Currently not supported in the Chat widget. */ badgeVisibility?: BadgeVisibility; } export declare enum BadgeVisibility { /** Unkown visibility. */ UNKNOWN_BADGE_VISIBILITY = "UNKNOWN_BADGE_VISIBILITY", /** Visible to the participant and site collaborators. */ BUSINESS_AND_PARTICIPANT = "BUSINESS_AND_PARTICIPANT", /** Visible to site collaborators only. */ BUSINESS = "BUSINESS" } export declare enum ChannelType { UNKNOWN_CHANNEL_TYPE = "UNKNOWN_CHANNEL_TYPE", CHAT = "CHAT", EMAIL = "EMAIL", SMS = "SMS", FACEBOOK = "FACEBOOK", INSTAGRAM = "INSTAGRAM", WHATSAPP = "WHATSAPP" } export declare enum MessageVisibility { /** Unknown message visibility. */ UNKNOWN_VISIBILITY = "UNKNOWN_VISIBILITY", /** Visible to the participant and site collaborators. */ BUSINESS_AND_PARTICIPANT = "BUSINESS_AND_PARTICIPANT", /** Visible to site collaborators only. */ BUSINESS = "BUSINESS" } export declare enum MessageDirection { /** Unknown message direction. */ UNKNOWN_DIRECTION = "UNKNOWN_DIRECTION", /** The message was sent from the business to the participant. */ BUSINESS_TO_PARTICIPANT = "BUSINESS_TO_PARTICIPANT", /** The message was sent from the participant to the business. */ PARTICIPANT_TO_BUSINESS = "PARTICIPANT_TO_BUSINESS" } export interface GetMessageIndicationsRequest { conversationId?: string; messageId?: string; } export interface GetMessageIndicationsResponse { messageIndications?: MessageIndication[]; } export interface MessageIndication { /** @readonly */ conversationId?: string | null; /** * The time when the message was sent * @readonly */ messageId?: string | null; /** * The type of the indication * - `UNKNOWN_INDICATION_TYPE`: Unknown indication type. * - `SENT`: Message was sent. * - `SEEN`: Message was seen. * - `ERROR`: There was an error. * - `DELIVERED`: Message was delivered. */ type?: IndicationType; /** The channel to which this indication was added */ channel?: ChannelType; /** The time when action happened */ timestamp?: Date | null; } export declare enum IndicationType { /** Unknown indication type. */ UNKNOWN_INDICATION_TYPE = "UNKNOWN_INDICATION_TYPE", /** Message was sent. */ SENT = "SENT", /** Message was seen. */ SEEN = "SEEN", /** There was an error. */ ERROR = "ERROR", /** Message was delivered. */ DELIVERED = "DELIVERED" } export interface AddMessageIndicationsRequest { conversationId?: string; messageIds?: string[]; /** by whom this action was done, defaults to PARTICIPANT in case of UNKNOWN_PERFORMED_BY */ performedBy?: PerformedBy; indication?: MessageIndication; } export declare enum PerformedBy { /** Unknown performer. */ UNKNOWN_PERFORMED_BY = "UNKNOWN_PERFORMED_BY", /** Business performed the action. */ BUSINESS = "BUSINESS", /** Participant performed the action. */ PARTICIPANT = "PARTICIPANT" } export interface AddMessageIndicationsResponse { } export interface MessageSentToParticipant { /** Conversation ID. */ conversationId?: string; /** Sent message. */ message?: Message; } export interface CustomMessageData { /** Name of the app this message belong to */ appName?: string | null; /** Data set by the sending application */ appData?: Record; } export interface MessageSentToBusiness { /** Conversation ID. */ conversationId?: string; /** Sent message. */ message?: Message; /** Optional info about interaction with app done by the user */ interactionInfo?: InteractionInfo; } /** * Source of interaction message, will be available when message originated by interaction with an application. * like clicking a button. */ export interface InteractionInfo { appId?: string | null; interactionId?: string | null; } export interface ButtonInteracted { /** Conversation ID. */ conversationId?: string; /** [Your app's](https://dev.wix.com/dc3/my-apps) app ID. */ appId?: string | null; /** * ID you define for the interaction, * to be handled by your server. */ interactionId?: string | null; /** ID of the participant who pressed the button. */ interactedBy?: IdentificationData; } export interface ListMessagesRequest { /** ID of the conversation that contains the intended messages. */ conversationId: string; /** * __Required.__ * Filters for messages with the specified visibility setting. */ visibility?: MessageVisibility; paging?: CursorPaging; /** only message_sequence is supported for field name */ sorting?: Sorting; } export interface CursorPaging { /** Maximum number of items to return in the results. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface ListMessagesResponse { /** List of messages between the specified visitor and the site. */ messages?: Message[]; /** Details on the paged set of results returned. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface Cursors { /** Cursor string pointing to the next page in the list of results. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } export interface SendMessageRequest { /** ID of the conversation to add the message to. */ conversationId: string; /** Message to send. */ message: Message; /** * Controls whether the message triggers notifications when it's received. * * Default: `false` */ sendNotifications?: boolean; /** * Controls whether the unread count and conversation summary * are updated in the * [Message List](https://support.wix.com/en/article/wix-inbox-getting-started#view-your-messages). * * If `true`, unread count and conversation summary are not updated. * * Default: `false` */ silent?: boolean; /** * Controls which identity to use in the message's `sender` property. * Default: `CALLER` * For 3rd-party apps, the app is the caller. */ sendAs?: OverrideSenderOptions; } export declare enum OverrideSenderOptions { /** Uses the identity included in the request header. */ CALLER = "CALLER", /** Uses the `anonymousVisitorId`, `contactId`, or `memberId` of the conversation's participant. */ PARTICIPANT = "PARTICIPANT", /** For internal use. Uses the `wixUserId` of the person sending messages on behalf of the business. */ BUSINESS_USER = "BUSINESS_USER" } export interface SendMessageResponse { /** Sent message. */ message?: Message; } export interface Empty { } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: WebhooksIdentificationData; /** Stringify payload. */ data?: string; } export interface WebhooksIdentificationData extends WebhooksIdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface WebhooksIdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface ImageMessageNonNullableFields { url: string; width: number; height: number; } interface FileMessageNonNullableFields { url: string; } interface BasicMessageDataNonNullableFields { text: string; image?: ImageMessageNonNullableFields; file?: FileMessageNonNullableFields; } interface BasicMessagePayloadNonNullableFields { items: BasicMessageDataNonNullableFields[]; } interface PostbackPropertiesNonNullableFields { interactionId: string; } interface ButtonNonNullableFields { label: string; postbackProperties?: PostbackPropertiesNonNullableFields; } interface TemplateMessagePayloadNonNullableFields { buttons: ButtonNonNullableFields[]; orientation: Orientation; textLines: string[]; } interface MinimalMessagePayloadNonNullableFields { text: string; } interface FormFieldNonNullableFields { name: string; value: string; } interface MediaItemNonNullableFields { image?: ImageMessageNonNullableFields; file?: FileMessageNonNullableFields; } interface FormMessagePayloadNonNullableFields { fields: FormFieldNonNullableFields[]; media: MediaItemNonNullableFields[]; } interface SystemMessagePayloadNonNullableFields { text: string; buttons: ButtonNonNullableFields[]; } interface MessageContentNonNullableFields { basic?: BasicMessagePayloadNonNullableFields; template?: TemplateMessagePayloadNonNullableFields; minimal?: MinimalMessagePayloadNonNullableFields; form?: FormMessagePayloadNonNullableFields; system?: SystemMessagePayloadNonNullableFields; contentType: ContentType; } interface IdentificationDataNonNullableFields { anonymousVisitorId: string; memberId: string; wixUserId: string; appId: string; } interface BadgeNonNullableFields { text: string; badgeVisibility: BadgeVisibility; } interface MessageNonNullableFields { content?: MessageContentNonNullableFields; sender?: IdentificationDataNonNullableFields; badges: BadgeNonNullableFields[]; targetChannels: ChannelType[]; sourceChannel: ChannelType; visibility: MessageVisibility; direction: MessageDirection; targetChannelIds: string[]; } export interface ListMessagesResponseNonNullableFields { messages: MessageNonNullableFields[]; } export interface SendMessageResponseNonNullableFields { message?: MessageNonNullableFields; } export {};