### Configure Missive Chat Widget Source: https://learn.missiveapp.com/missive-chat/documentation This JavaScript snippet demonstrates how to configure the Missive Live Chat widget by setting various options such as chat position, user interface elements, and custom variables. The configuration object `MissiveChatConfig` is defined and then a script tag is dynamically created and appended to the document's head to load the chat widget. If an option is set in both the Setup page and the HTML, the HTML configuration will take precedence. ```javascript (function(d, w) { w.MissiveChatConfig = { id: '[MISSIVE-CHAT-ACCOUNT-ID]', chat: { position: 'bottom-right', hidden: false, name: "", avatarUrl: "", hideWhenOffline: false, hideBranding: false, showOnlineStatus: true, showAvatars: true, showNames: true, rememberOpenState: true, variables: { 'background-color': '#fff', 'badge-background-color': '#f23131', 'badge-border-radius': '100%', 'badge-box-shadow': '0 1px 2px rgba(0,0,0, .2)', 'badge-color': '#fff', 'badge-size': '24px', 'border-color': 'rgba(0,0,0, .05)', 'border': 'solid 1px rgba(0,0,0, .06)', 'box-shadow': '0 5px 30px rgba(0,0,0, .1)', 'bubble-dark-color': 'var(--main-color)', 'bubble-light-color': '#f5f5f5', 'button-border-radius': '10em', 'close-button-color': '#fff', 'closed-border-radius': '30px', 'font-family': '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', 'font-size': '15px', 'header-opened-background-color': 'var(--main-color)', 'header-subtitle-text-color': 'rgba(255,255,255, .65)', 'header-title-text-color': '#fff', 'height': '600px', 'light-text-color': '#7b7c7f', 'main-color': '#2866D1', 'margin': '20px', 'max-height': 'calc(100% - 40px)', 'max-width': 'calc(100% - 40px)', 'opened-border-radius': '10px', 'status-connecting-color': '#fdd157', 'status-offline-color': '#f23131', 'status-online-color': '#00b351', 'text-color': '#34363a', 'transition-duration': '225ms', 'transition-easing': 'cubic-bezier(.4, .0, .2, 1)', 'width': '350px', }, }, support: { email: "", phone: "", }, user: { email: "", name: "", digest: "", avatarUrl: "", }, visitor: { askName: true, requireName: false, askEmail: true, requireEmail: true, requireConsent: false, }, meta: {}, messages: { welcome: "Hi there! 👋\n\nThe team will reply as soon as possible.", help: "How can we help?", identify: "First, identify yourself.", error: "Sorry, there is an issue connecting to our chat. Please check your Internet connection and try again.", title: "Chat with us", online: "We’re online", offline: "We’re offline", connecting: "Connecting…", chat: "Message…", newMessage: "New message!", newMessages: "New messages!", internet: "Can’t send messages offline.", identifyName: "Name", identifyEmail: "Email", identifySubmit: "Submit", identifySkip: "Skip", identifyRequired: "Required field", identifyThanks: "Thanks", identifyConsent: "I accept this website privacy policy and terms of use.", }, }; var s = d.createElement('script'); s.async = true; s.src = 'https://webchat.missiveapp.com/' + w.MissiveChatConfig.id + '/missive.js'; if (d.head) d.head.appendChild(s); })(document, window); ``` -------------------------------- ### Initiate OAuth Flow for Authentication in Missive Source: https://learn.missiveapp.com/api-documentation/iframe-integrations-api Starts an OAuth authentication flow by opening a new browser tab with a specified authentication URL. It handles iframe limitations and iOS compatibility, resolving with query parameters from the redirect. ```javascript async function authenticateWithOAuth() { try { // 1. Initiate OAuth flow const response = await Missive.initiateCallback('https://your-auth-endpoint') // 2. Response will contain query params from the OAuth redirect const { access_token } = response // 3. Store the token for future use await Missive.storeSet('oauth_token', access_token) } catch (error) { console.error('OAuth flow failed:', error) } } ``` -------------------------------- ### Prompt Template for Missive iFrame Integration using AI Source: https://learn.missiveapp.com/api-documentation/iframe-integrations-no-code-ai A comprehensive prompt template to guide AI coding assistants in generating Missive iFrame integrations. It specifies the integration's goal, trigger mechanisms using the Missive JavaScript API, data source, required functionality, UI styling guidelines referencing Missive's CSS, and optional interaction elements. It also includes a process for AI to outline its plan before full code generation. ```markdown Hello! I'd like your help building a Missive iFrame integration. My goal is to [Clearly state the main purpose of your integration. e.g., "display customer details from our CRM inside Missive" or "show recent order history"]. This integration will run in an iframe within the Missive sidebar, as described here: https://learn.missiveapp.com/api-documentation/iframe-integrations. Key Requirements: 1. Trigger: The integration should react when a user selects a conversation in Missive. It needs to use the Missive JavaScript API (`Missive.on('change:conversations', ...)` and `Missive.fetchConversations(...)`) found here: https://learn.missiveapp.com/api-documentation/iframe-integrations-api. 2. Data Source: The necessary information comes from [Describe where the data originates. e.g., "a Google sheet document"]. 3. Functionality: When triggered, the integration should [List the specific actions. e.g., "1. Extract the primary email address from the selected conversation. 2. Query the data source using that email. 3. Display the customer's name, status, and a link to their profile."]. If no relevant data is found or multiple conversations are selected, it should display a clear message like "No data found". 4. UI/Styling: Please generate standard HTML, CSS, and JavaScript. The UI should be clean and simple. Use the official Missive stylesheet (https://integrations.missiveapp.com/missive.css) to ensure it matches the Missive look and feel across themes. 5. Interaction (Optional): [Add any specific interactions needed. e.g., "Include a button that uses `Missive.openURL` to open the customer's profile in a new tab." or "Allow adding a note using `Missive.comment`."] 6. Hosting & Security: The code needs to run in a browser iframe and will be hosted on a platform like Replit, Vercel, or Netlify, requiring HTTPS. For initial security, we can plan to use a simple secret token in the URL parameter, but focus on the frontend logic for now. Process: Before generating the full code, please: * Outline the steps you'll take. * List the files (HTML, CSS, JS) you propose to create. * Ask any clarifying questions you have about the requirements or data sources. * Confirm your understanding of the goal. Do not write the full code implementation yet. Let's agree on the plan first. ``` -------------------------------- ### Create an Incoming Message in Custom Channel Source: https://learn.missiveapp.com/api-documentation/rest-endpoints This code example shows how to create an incoming message within a custom channel using the Missive API. It is designed for integrating message providers not natively supported by Missive. The payload includes account ID, sender, recipients, and message body. ```json { "messages": { "account": "fbf74c47-d0a0-4d77-bf3c-2118025d8102", "from_field": { "id": "12345", "username": "@philippe", "name": "Philippe Lehoux" }, "to_fields": [ { "id": "54321", "username": "@missiveapp", "name": "Missive" } ], "body": "Hello world!" } } ``` -------------------------------- ### Get Single Response - GET /v1/responses/{id} Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Fetches a specific response by its unique identifier. This endpoint allows retrieval of detailed information for a single response. ```HTTP GET /v1/responses/**_id_** ``` -------------------------------- ### Configure Missive Chat with Verified User Source: https://learn.missiveapp.com/missive-chat/documentation This JavaScript configuration shows how to set up the Missive Live Chat with a verified logged-in user. It includes the user's name, email, and a pre-computed digest generated using the secret key. This ensures that the user's identity is securely verified by the system. ```javascript // digest == 'd78c55fe6579a12831b5e0cdc5765ff7d110fefb2e386a43067accb51ce242f2' w.MissiveChatConfig = { "id": "c3a1b3de-5e3f-4283-baaa-8e1d63fea126", "user": { "name": "Jane Doe", "email": "jane@acme.com", "digest": "d78c55fe6579a12831b5e0cdc5765ff7d110fefb2e386a43067accb51ce242f2" } } ``` -------------------------------- ### GET /v1/organizations Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Lists all organizations that the authenticated user is a part of. ```APIDOC ## GET /v1/organizations ### Description List organizations the authenticated user is part of. ### Method GET ### Endpoint /v1/organizations ### Parameters #### Path Parameters None #### Query Parameters None ### Request Example ```json { "example": "No request body for GET requests." } ``` ### Response #### Success Response (200) - **organizations** (array) - An array of organization objects, each with an `id` and `name`. #### Response Example ```json { "organizations": [ { "id": "0d9bab85-a74f-4ece-9142-0f9b9f36ff92", "name": "Conference Badge" } ] } ``` ``` -------------------------------- ### Get a Response Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Fetches a specific response using its unique identifier. ```APIDOC ## GET /v1/responses/{id} ### Description Fetch a specific response using the response `id`. ### Method GET ### Endpoint /v1/responses/**_id_** ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the response to retrieve. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **response** (object) - The retrieved response object (structure similar to the 'List Responses' success response). ``` -------------------------------- ### Initialize Missive Chat Widget with JavaScript Source: https://learn.missiveapp.com/missive-chat/documentation This snippet demonstrates how to initialize the Missive Live Chat widget on your website. It requires wrapping API calls within the `onReady` callback to ensure the widget is fully loaded. The `id` must be replaced with your actual Missive Chat Account ID. Various callbacks are available for custom event handling. ```html ``` -------------------------------- ### Set Media Permissions for Missive Integrations Source: https://learn.missiveapp.com/api-documentation/iframe-integrations-api Requests camera and microphone permissions for Missive integrations. This is necessary for functionalities requiring audio/video input and may require a reload of the integration after access is granted. ```javascript Missive.setPermissions({ camera: true, microphone: true }); ``` -------------------------------- ### Get a Conversation Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Fetches a specific conversation using its unique identifier. ```APIDOC ## GET /v1/conversations/{id} ### Description Fetch a specific conversation using the conversation `id`. Note that the returned conversation may have a different `id` if conversations have been merged. Passing an old conversation `id` will still work, but the new conversation `id` will be returned. ### Method GET ### Endpoint /v1/conversations/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the conversation. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **conversations** (array) - An array containing the requested conversation object. Structure is the same as in the 'Get Conversations' endpoint. #### Response Example ```json { "conversations": [ { "id": "6d3c9b1c-7067-4a28-8ea6-ea91340b67cc", "subject": null, "latest_message_subject": "Question?", "organization": { "id": "96cafdc6-ec6a-4439-9b0c-f55a1133b1e7", "name": "Conference Badge" }, "color": null, "assignees": [], "users": [ { "id": "dc3c4104-eced-4206-b532-ef84b331778a", "name": "Chad Zemlak", "email": "chad@conferencebade.com", "unassigned": false, "closed": false, "archived": false, "trashed": false, "junked": false, "assigned": false, "flagged": true, "snoozed": false } ], "attachments_count": 0, "messages_count": 1, "authors": [ { "name": "Samwise Gamgee", "address": "sam@fellowship.org" } ], "drafts_count": 0, "send_later_messages_count": 0, "tasks_count": 0, "completed_tasks_count": 0, "web_url": "https://mail.missiveapp.com/#inbox/conversations/6d3c9b1c-7067-4a28-8ea6-ea91340b67cc", "app_url": "missive://mail.missiveapp.com/#inbox/conversations/6d3c9b1c-7067-4a28-8ea6-ea91340b67cc", "assignee_names": "", "assignee_emails": "", "shared_label_names": "", "last_activity_at": 1654544954, "team": { "id": "f36b7570-078e-408e-9cb8-2b4441ad93c0", "name": "Team 1", "organization": "96cafdc6-ec6a-4439-9b0c-f55a1133b1e7" }, "shared_labels": [] } ] } ``` ``` -------------------------------- ### Get Conversations Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Retrieves a list of conversations with support for various filtering, sorting, and pagination parameters. ```APIDOC ## GET /v1/conversations ### Description Retrieves a list of conversations. Supports numerous query parameters for filtering, pagination, and sorting. ### Method GET ### Endpoint /v1/conversations ### Parameters #### Query Parameters - **limit** (number) - Optional - Number of conversations returned. Default: `25`. Max: `50` - **until** (timestamp) - Optional - Timestamp value in Unix time used to paginate. Use the `last_activity_at` of the oldest conversation from previous page. - **inbox** (boolean) - Optional - Pass `true` to list conversations in the **Inbox**. - **all** (boolean) - Optional - Pass `true` to list conversations in the **All** mailbox. - **assigned** (boolean) - Optional - Pass `true` to list conversations assigned to the user. - **closed** (boolean) - Optional - Pass `true` to list conversations in **Closed**. - **snoozed** (boolean) - Optional - Pass `true` to list conversations in **Snoozed**. - **flagged** (boolean) - Optional - Pass `true` to list conversations in **Starred**. - **trashed** (boolean) - Optional - Pass `true` to list conversations in **Trash**. - **junked** (boolean) - Optional - Pass `true` to list conversations in **Spam**. - **drafts** (boolean) - Optional - Pass `true` to list conversations in **Drafts**. - **shared_label** (string) - Optional - Shared label ID. List conversations in the **shared label**. - **team_inbox** (string) - Optional - Team ID. List conversations in the team’s **Inbox**. - **team_closed** (string) - Optional - Team ID. List conversations in the team’s **Closed** mailbox. - **team_all** (string) - Optional - Team ID. List conversations in the team’s **All** mailbox. - **organization** (string) - Optional - Organization ID. Filter conversations to only those shared with the organization. Note: This parameter has no effect when `shared_label` or a `team_` parameter is provided. - **email** (string) - Optional - Filter conversations by email address. Returns conversations where this email address appears as a sender or recipient. - **domain** (string) - Optional - Filter conversations by domain. Returns conversations where any sender or recipient's email address belongs to this domain. ### Response #### Success Response (200) - **conversations** (array) - An array of conversation objects. - **id** (string) - The unique identifier for the conversation. - **subject** (string) - The subject of the conversation. - **latest_message_subject** (string) - The subject of the latest message in the conversation. - **organization** (object) - Information about the organization the conversation belongs to. - **color** (string) - The color associated with the conversation. - **assignees** (array) - A list of users assigned to the conversation. - **users** (array) - A list of users involved in the conversation. - **attachments_count** (number) - The number of attachments in the conversation. - **messages_count** (number) - The total number of messages in the conversation. - **authors** (array) - A list of authors of the messages in the conversation. - **drafts_count** (number) - The number of drafts in the conversation. - **send_later_messages_count** (number) - The number of messages scheduled to be sent later. - **tasks_count** (number) - The number of tasks associated with the conversation. - **completed_tasks_count** (number) - The number of completed tasks associated with the conversation. - **web_url** (string) - The URL to view the conversation in a web browser. - **app_url** (string) - The URL to open the conversation in the application. - **assignee_names** (string) - Comma-separated list of assignee names. - **assignee_emails** (string) - Comma-separated list of assignee emails. - **shared_label_names** (string) - Comma-separated list of shared label names. - **last_activity_at** (timestamp) - The Unix timestamp of the last activity in the conversation. - **team** (object) - Information about the team the conversation belongs to. - **shared_labels** (array) - A list of shared labels applied to the conversation. ### Request Example (No request body for GET requests) ### Response Example ```json { "conversations": [ { "id": "6d3c9b1c-7067-4a28-8ea6-ea91340b67cc", "subject": null, "latest_message_subject": "Question?", "organization": { "id": "96cafdc6-ec6a-4439-9b0c-f55a1133b1e7", "name": "Conference Badge" }, "color": null, "assignees": [], "users": [ { "id": "dc3c4104-eced-4206-b532-ef84b331778a", "name": "Chad Zemlak", "email": "chad@conferencebade.com", "unassigned": false, "closed": false, "archived": false, "trashed": false, "junked": false, "assigned": false, "flagged": true, "snoozed": false } ], "attachments_count": 0, "messages_count": 1, "authors": [ { "name": "Samwise Gamgee", "address": "sam@fellowship.org" } ], "drafts_count": 0, "send_later_messages_count": 0, "tasks_count": 0, "completed_tasks_count": 0, "web_url": "https://mail.missiveapp.com/#inbox/conversations/6d3c9b1c-7067-4a28-8ea6-ea91340b67cc", "app_url": "missive://mail.missiveapp.com/#inbox/conversations/6d3c9b1c-7067-4a28-8ea6-ea91340b67cc", "assignee_names": "", "assignee_emails": "", "shared_label_names": "", "last_activity_at": 1654544954, "team": { "id": "f36b7570-078e-408e-9cb8-2b4441ad93c0", "name": "Team 1", "organization": "96cafdc6-ec6a-4439-9b0c-f55a1133b1e7" }, "shared_labels": [] } ] } ``` ``` -------------------------------- ### Create Conversation using JavaScript Source: https://learn.missiveapp.com/api-documentation/iframe-integrations-api Creates a new conversation in Missive. The `options` parameter allows specifying whether to navigate to the new conversation and how many to create. By default, one conversation is created and selected. ```javascript Missive.createConversation({ select: true, count: 1 }).then((conversations) => { console.log('Created conversations:', conversations); }) ``` -------------------------------- ### Get a Contact Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Fetches a specific contact using its ID. Attempting to retrieve a deleted contact will result in a 404 response. ```APIDOC ## GET /v1/contacts/**_id_** ### Description Fetch a specific contact using the contact `id`. Trying to get a deleted contact will produce a 404 response. ### Method GET ### Endpoint `/v1/contacts/**_id_**` ### Parameters #### Path Parameters - **_id_** (string) - Required - The ID of the contact to retrieve. ``` -------------------------------- ### App Methods Source: https://learn.missiveapp.com/api-documentation/iframe-integrations-api Methods for interacting with the Missive application's UI and overall state. ```APIDOC ## `reload()` ### Description Reloads the iframe. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters None ### Request Example ```javascript App.reload(); ``` ### Response None ## `search(text)` ### Description Initiates a new search within Missive. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Query Parameters - **text** (string) - Required - The search term. ### Request Example ```javascript App.search('important customer query'); ``` ### Response None ## `alert(options)` ### Description Displays an error modal with a single "Got it" action. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Request Body - **options** (object) - Optional - Configuration for the alert. - **title** (string) - Optional - The title of the error modal. Defaults to 'Error in “Your Integration” integration'. - **message** (string) - Optional - The main error message. Defaults to an empty string. - **note** (string) - Optional - Additional notes to display. Defaults to an empty string. ### Request Example ```javascript App.alert({ title: 'Failed to load data', message: 'Please try again later.', note: 'Error code: 503' }); ``` ### Response None ## `navigate(options)` ### Description Navigates the user to a specific conversation. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Request Body - **options** (object) - Required - Navigation options. - **conversationId** (string) - Required - The ID of the conversation to navigate to. ### Request Example ```javascript App.navigate({ conversationId: 'conv_12345' }); ``` ### Response None ## `on(event, callback, options)` ### Description Registers a callback function to be executed when a specific event occurs. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Query Parameters - **event** (string) - Required - The name of the event to listen for. - **callback** (function) - Required - The function to execute when the event is triggered. - **options** (object) - Optional - Additional options for event registration. - **retroactive** (boolean) - Optional - If true, the callback is triggered immediately if the event has already occurred. Defaults to `false`. ### Request Example ```javascript App.on('message_sent', (message) => { console.log('Message sent:', message); }, { retroactive: true }); ``` ### Response None ## `openForm(data)` ### Description Displays a form popup. Multiple forms can be stacked. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Request Body - **data** (object) - Optional - Data to populate the form. - **name** (string) - Optional - The title of the form. - **fields** (array) - Optional - An array of FormField objects. - **comments** (array) - Optional - An array of FormComment objects. - **notes** (array) - Optional - An array of FormNote objects. - **buttons** (array) - Optional - An array of FormButton objects. - **options** (object) - Optional - Form display options. - **autoClose** (boolean) - Optional - Whether to auto-close the popup on submit. Defaults to `true`. ### Request Example ```javascript App.openForm({ name: 'Contact Details', fields: [{ name: 'email', label: 'Email', type: 'email' }] }); ``` ### Response - **Promise(Object)** - Resolves with Field objects. ## `closeForm()` ### Description Closes the most recently opened form popup. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters None ### Request Example ```javascript App.closeForm(); ``` ### Response None ## `openSelf()` ### Description Opens the integration sidebar if it is closed and selects the current integration. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters None ### Request Example ```javascript App.openSelf(); ``` ### Response None ## `closeSelf()` ### Description Closes the integration sidebar if it is currently open. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters None ### Request Example ```javascript App.closeSelf(); ``` ### Response None ## `openURL(url)` ### Description Opens a given URL in a new tab on desktop or in the appropriate browser on mobile. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Query Parameters - **url** (string) - Required - The URL to open. ### Request Example ```javascript App.openURL('https://missiveapp.com'); ``` ### Response None ## `openContextMenu(data)` ### Description Opens a context menu at a specified position. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Request Body - **data** (object) - Required - Data for positioning and options for the context menu. - **top** (integer) - Optional - The top position for the menu. Menu will be below this point. Do not set if `data.bottom` is provided. Defaults to `0`. - **bottom** (integer) - Optional - The bottom position for the menu. Menu will be above this point. Do not set if `data.top` is provided. - **left** (integer) - Optional - The left position for the menu. Menu will be to the right of this point. Do not set if `data.right` is provided. Defaults to `0`. - **right** (integer) - Optional - The right position for the menu. Menu will be to the left of this point. Do not set if `data.left` is provided. - **options** (array) - Required - An array of Option objects representing menu items. ### Request Example ```javascript App.openContextMenu({ top: 100, left: 50, options: [ { label: 'Option 1', value: 'opt1' }, { label: 'Option 2', value: 'opt2' } ] }); ``` ### Response None ## `setActions(actions)` ### Description Defines actions that can be triggered from context menus or swipe actions throughout the app. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters #### Query Parameters - **actions** (array) - Required - An array of Action objects. ### Request Example ```javascript App.setActions([ { label: 'Mark as important', action: () => console.log('Marked as important') } ]); ``` ### Response None ## `setAsUtility()` ### Description Marks the integration as a utility integration, meaning its iframe will not be displayed in the integration sidebar. This is useful for integrations that primarily provide actions or context menu items. ### Method `javascript` ### Endpoint N/A (Client-side method) ### Parameters None ### Request Example ```javascript App.setAsUtility(); ``` ### Response None ``` -------------------------------- ### Get Analytics Report Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Retrieves a previously generated analytics report using its ID. Reports expire after 60 seconds of completion. ```APIDOC ## GET /v1/analytics/reports/**_id_** ### Description Fetches an analytics report using the report ID obtained from the 'Create analytics report' endpoint. Reports are available for a limited time after completion. It's recommended to poll this endpoint if the report is not immediately available. ### Method GET ### Endpoint /v1/analytics/reports/{{report_id}} ### Parameters #### Path Parameters - **_id_** (string) - Required - The ID of the analytics report to retrieve. ### Response #### Success Response (200) - The response body will contain the analytics report data. The exact structure depends on the report's configuration. #### Error Response (404) - An empty 404 response indicates that the report is incomplete, has expired, or does not exist. ### Request Example (No request body for GET requests) ### Response Example ```json { "report_data": { "organization_id": "0d9bab85-a74f-4ece-9142-0f9b9f36ff92", "period": { "start": "2023-08-15T00:00:00Z", "end": "2023-08-20T23:59:59Z" }, "metrics": { "total_conversations": 150, "resolved_conversations": 120, "average_resolution_time": 3600 } } } ``` ``` -------------------------------- ### GET /v1/messages?email_message_id={Message-ID} Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Fetches messages that match a specific email Message-ID found in the email header. Returns the latest 10 messages if multiple are found. ```APIDOC ## GET /v1/messages?email_message_id={Message-ID} ### Description Fetch messages matching an email `Message-ID`. Message data includes headers, body and attachments. ### Method GET ### Endpoint /v1/messages ### Parameters #### Query Parameters - **email_message_id** (string) - Required - The `Message-ID` found in an email’s header. ### Request Example ```json { "example": "No request body for GET requests." } ``` ### Response #### Success Response (200) - **messages** (array) - An array of message objects, each containing headers, body, and attachments. Typically contains one message. #### Response Example ```json { "messages": [ { // Latest message details }, { // Second-latest message details (if applicable) } ] } ``` ``` -------------------------------- ### Using Liquid Variables in Email Signatures Source: https://learn.missiveapp.com/signatures/managed-signatures Demonstrates how to insert dynamic user information into email signatures using Liquid syntax. This includes text-based variables like names and image sources for profile pictures. It also shows how to apply basic styling to images and how to use static image URLs. ```liquid {{ user.first_name }} {{ user.last_name }} ``` ```liquid ``` ```liquid ``` -------------------------------- ### GET /v1/messages/{id} Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Fetches message headers, body, and attachments using comma-separated message IDs. The response format differs for single vs. multiple message requests. ```APIDOC ## GET /v1/messages/{id} ### Description Fetch message headers, body and attachments using comma-separated message `id`s (up to 25). When fetching a single message, the response is `"messages": {...}`. When fetching multiple messages, the response is `"messages": [{...}]`. ### Method GET ### Endpoint /v1/messages/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Comma-separated message IDs (up to 25). ### Request Example ```json { "example": "No request body for GET requests." } ``` ### Response #### Success Response (200) - **messages** (object or array) - Contains message details. Format varies based on single or multiple ID requests. #### Response Example ```json { "messages": { "id": "3fa4bcf5-e57e-47a4-9422-de2cce5f802e", "subject": "A Message", "preview": "A message from Sam", "type": "email", "delivered_at": 1563806347, "updated_at": 1563807320, "created_at": 1563807320, "email_message_id": "<0f1ab2d8-cd90-4dd1-a861-ef7e31fb3cdd@missiveapp.com>", "in_reply_to": [], "references": [], "body": "
A message from Sam

\"inline-image.png\"", "from_field": { "name": "Samwise Gamgee", "address": "sam@fellowship.org" }, "to_fields": [ { "name": "Phil Smith", "address": "phil.smith@fakemail.com" } ], "cc_fields": [], "bcc_fields": [], "reply_to_fields": [], "attachments": [ { "id": "81eed561-4908-4738-9a9f-2da886b1de43", "filename": "inline-image.png", "extension": "png", "url": "https://...", "media_type": "image", "sub_type": "png", "size": 114615, "width": 668, "height": 996 } ], "conversation": { "id": "47a57b76-df42-4d8k-927x-80dbe5d87191", "subject": null, "latest_message_subject": "A Message", "organization": { "id": "93e5e5d5-11a2-4c9b-80b8-94f3c08068cf", "name": "Fellowship" }, "team": { "id": "2f618f9e-d3d4-4a01-b7d5-57124ab366b8", "name": "Hobbits", "organization": "93e5e5d5-11a2-4c9b-80b8-94f3c08068cf" }, "color": null, "assignees": [ { "id": "6b52b6b9-9b51-46ad-a4e3-82ef3c45512c", "name": "Frodo Baggins", "email": "frodo@fellowship.org", "unassigned": false, "closed": false, "archived": false, "trashed": false, "junked": false, "assigned": true, "flagged": false, "snoozed": true } ], "assignee_names": "Frodo Baggins", "assignee_emails": "frodo@fellowship.org", "users": [ { "id": "6b52b6b9-9b51-46ad-a4e3-82ef3c45512c", "name": "Frodo Baggins", "email": "frodo@fellowship.org", "unassigned": false, "closed": false, "archived": false, "trashed": false, "junked": false, "assigned": true, "flagged": false, "snoozed": true } ], "attachments_count": 0, "messages_count": 1, "authors": [ { "name": "Samwise Gamgee", "address": "sam@fellowship.org" } ], "drafts_count": 0, "send_later_messages_count": 0, "tasks_count": 0, "completed_tasks_count": 0, "shared_labels": [ { "id": "146ff5c4-d5la-3b63-b994-76711fn790lq", "name": "Elfs" } ], "shared_label_names": "Elfs", "app_url": "missive://mail.missiveapp.com/#inbox/conversations/47a57b76-df42-4d8k-927x-80dbe5d87191", "web_url": "https://mail.missiveapp.com/#inbox/conversations/47a57b76-df42-4d8k-927x-80dbe5d87191" } } } ``` ##### Inline images Inline images markup in the message `body` HTML contain no `src` attribute, instead they contain a `data-missive-attachment-id` attribute with the attachment `id`. The attachment and its URL are available in the GET response under the `attachments` key. ``` -------------------------------- ### Create a Task Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Allows the creation of new tasks. Tasks can be standalone, linked to conversations, or created as subtasks within conversations. ```APIDOC ## POST /v1/tasks ### Description Create a new task. Tasks can be standalone, conversations or created inside conversations. ### Method POST ### Endpoint /v1/tasks ### Parameters #### Request Body - **tasks** (object) - Required - Contains task details. - **organization** (string) - Required if using team, assignees, or add_users - Organization ID. - **title** (string) - Required - Task title (max 1000 characters). - **description** (string) - Optional - Task description (max 10000 characters). - **team** (string) - Required for standalone tasks (if assignees not provided) - Team ID. - **assignees** (array[string]) - Required for standalone tasks (if team not provided) - Array of user IDs. - **due_at** (integer) - Optional - Unix timestamp for task due date. - **subtask** (boolean) - Optional - Boolean indicating if this is a subtask. - **conversation** (string) - Required when subtask is true - Parent conversation ID. - **add_users** (array[string]) - Optional - Array of user IDs to add to parent conversation (only for subtasks). ### Request Example ```json { "tasks": { "organization": "0d9bab85-a74f-4ece-9142-0f9b9f36ff92", "title": "Review pull request", "description": "Please review PR #123", "team": "0e24f298-965d-4475-9220-b32636a1e2c3", "due_at": 1692371867 } } ``` ### Response #### Success Response (200) - **tasks** (object) - Contains details of the created task. - **id** (string) - The unique identifier for the task. - **conversation** (string | null) - The ID of the conversation this task belongs to, or null if it's a standalone task. - **title** (string) - The title of the task. - **description** (string) - The description of the task. - **state** (string) - The current state of the task (e.g., `todo`, `in_progress`, `closed`). - **assignees** (array[string]) - An array of user IDs assigned to the task. - **team** (string) - The ID of the team assigned to the task. - **due_at** (integer) - The Unix timestamp for the task's due date. #### Response Example ```json { "tasks": { "id": "75ad834a-9bd6-4008-b9e6-fc9fa2e7770b", "conversation": null, "title": "Updated task title", "description": "New description", "state": "in_progress", "assignees": ["1ce8117e-ae42-4304-b953-c81656da4bd1"], "team": "0e24f298-965d-4475-9220-b32636a1e2c3", "due_at": 1692371867 } } ``` ``` -------------------------------- ### List Users in Organization (API) Source: https://learn.missiveapp.com/api-documentation/rest-endpoints Retrieves a list of users within the organizations the authenticated user is part of using a GET request to the /v1/users endpoint. Supports pagination and filtering by organization. ```json { "users": [ { "id": "a41a00fd-453d-49d7-a487-9765c35a3b70", "me": true, "email": "philippe@missiveapp.com", "name": "Philippe Lehoux", "avatar_url": "https://..." } ] } ```