### Dynamic Documentation Query Example Source: https://api.circle.so/get-started/websockets-beta Demonstrates how to perform an HTTP GET request to query documentation dynamically. Use the 'ask' query parameter with a specific question to retrieve answers and relevant documentation excerpts. ```http GET https://api.circle.so/get-started/websockets-beta.md?ask= ``` -------------------------------- ### Querying Documentation (HTTP GET) Source: https://api.circle.so/apis/circle-plus/custom-html-api-reference To get additional information not explicitly present on this page, perform an HTTP GET request with the 'ask' query parameter. The response will contain a direct answer and relevant excerpts. ```http GET https://api.circle.so/apis/circle-plus/custom-html-api-reference.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/get-started/concepts To get more information not present on the current page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://api.circle.so/get-started/concepts.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://api.circle.so/apis/headless/member-api/community-member-search Perform an HTTP GET request on the current page URL with the `ask` query parameter to retrieve specific information or clarifications. ```http GET https://api.circle.so/apis/headless/member-api/community-member-search.md?ask= ``` -------------------------------- ### Query Documentation with GET Request Source: https://api.circle.so/apis/headless/auth-sdk/go To get additional information not explicitly present on the page, perform an HTTP GET request on the current page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://api.circle.so/apis/headless/auth-sdk/go.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/apis/admin-api/quick-start To get information not explicitly present, perform a GET request to the page URL with an 'ask' query parameter containing your question. ```http GET https://api.circle.so/apis/admin-api/quick-start.md?ask= ``` -------------------------------- ### Query Documentation with GET Request Source: https://api.circle.so/mcp Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific, self-contained, and in natural language. Use this when the answer is not explicitly present, for clarification, or to retrieve related sections. ```http GET https://api.circle.so/mcp.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/get-started Perform an HTTP GET request to query the documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language to get direct answers and relevant excerpts. ```http GET https://api.circle.so/get-started.md?ask= ``` -------------------------------- ### Querying Documentation Source: https://api.circle.so/apis/headless Perform an HTTP GET request on the documentation URL with the `ask` query parameter to get answers to specific questions. ```APIDOC ## Querying Documentation ### Description Perform an HTTP GET request on the current page URL with the `ask` query parameter to retrieve specific information or clarifications not explicitly present in the documentation. ### Method GET ### Endpoint `https://api.circle.so/apis/headless.md?ask=` ### Parameters #### Query Parameters - **ask** (string) - Required - The question to ask about the documentation in natural language. ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/apis/admin-api To get additional information not directly present on the page, make a GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://api.circle.so/apis/admin-api.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/get-started/concepts/tiptap-editor Illustrates how to query the documentation for additional information not explicitly present on the page. This is done by performing an HTTP GET request with an 'ask' query parameter. ```http GET https://api.circle.so/get-started/concepts/tiptap-editor.md?ask= ``` -------------------------------- ### Auth API Response Example Source: https://api.circle.so/apis/headless/quick-start This is an example of the JSON response received after successfully authenticating a member. It contains the access token, refresh token, and their expiration times. ```json { "access_token": "eyJhbGciOiJIUzI1NiJ9.eyJjb21tdW5pdHlfaWQiOjEsImNvbW11bml0eV9tZW1iZXJfaWQiOjEsInNzb191c2VyX2lkIjoiZjdiOThlYjczZjdkMGQ0NGU0ZWE1MjYyN2JiYjVhMzkiLCJleHAiOjE3MDg1NDE1MTAsImp0aSI6ImE1MjM2ZmQzLWY4NGItNDcyYy1iNjI2LTcyYTk3YmYwZTcyOSJ9.-MY06GiyXB41dLAx_F4Eu8R4sRxq6QEjy3uLWc4Z6k8", "refresh_token": "jaebyVK59l5xxAx1D4pM8H-wYyFA6gMC12RGYZcy44w", "access_token_expires_at": "2022-01-01T00:00:00.000Z", "refresh_token_expires_at": "2022-01-01T00:00:00.000Z", "community_member_id": 1, "community_id": 1 } ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/apis/headless/auth-sdk To get additional information not directly on the page, perform an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and in natural language. This mechanism is useful for clarifications or retrieving related documentation. ```HTTP GET https://api.circle.so/apis/headless/auth-sdk.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://api.circle.so/apis/headless/member-api/cookies To get additional information not directly on the page, perform an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://api.circle.so/apis/headless/member-api/cookies.md?ask= ``` -------------------------------- ### Example WebSocket Server Responses Source: https://api.circle.so/get-started/websockets-beta Illustrates typical server responses upon a successful WebSocket connection, including connection confirmation, subscription confirmation, and periodic ping messages. ```bash WebSocket connection opened. Message from server: { type: 'welcome', sid: 'JnehncGjAQuLBIBoImSMk' } Message from server: { identifier: '{"channel":"ChatRoomChannel","community_member_id": COMMUNITY_MEMBER_ID}', type: 'confirm_subscription' } Message from server: { type: 'ping', message: 1729855056 } Message from server: { type: 'ping', message: 1729855059 } Message from server: { type: 'ping', message: 1729855062 } ``` -------------------------------- ### Query Documentation with 'ask' Parameter Source: https://api.circle.so/get-started/concepts/spaces-and-space-groups To get additional information not directly on the page, perform an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://api.circle.so/get-started/concepts/spaces-and-space-groups.md?ask= ``` -------------------------------- ### Querying Documentation with `ask` Parameter Source: https://api.circle.so/apis/admin-api/usage-and-limits/optimizing-usage Demonstrates how to dynamically query the API documentation by appending the `ask` query parameter to a GET request. This is useful for retrieving specific information or clarifications not explicitly found on the page. ```http GET https://api.circle.so/apis/admin-api/usage-and-limits/optimizing-usage.md?ask= ``` -------------------------------- ### Querying Documentation via API Source: https://api.circle.so/get-started/concepts/posts To get additional information not directly present on a page, you can perform an HTTP GET request with an 'ask' query parameter. The question should be specific and self-contained. ```http GET https://api.circle.so/get-started/concepts/posts.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/apis/headless/usage-and-limits Perform an HTTP GET request to query the documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language. ```HTTP GET https://api.circle.so/apis/headless/usage-and-limits.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://api.circle.so/apis/headless/member-api Perform an HTTP GET request to query documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language. ```http GET https://api.circle.so/apis/headless/member-api.md?ask= ``` -------------------------------- ### Retrieve Posts for a Space Source: https://api.circle.so/apis/admin-api/quick-start Example of how to retrieve all posts for a specific space using the Admin API. This example fetches posts for space ID `999` and includes pagination and status filtering. ```APIDOC ## Performing a request As an example, if you'd like to retrieve all posts for a specific space, you can use the following endpoint with the space's unique identifier. In this instance, posts are being fetched within the space ID `999`: ```sh curl -X GET "https://app.circle.so/api/admin/v2/comments/posts?space_id=999&page=1&per_page=20&status=published" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` This request also contains parameters like `page`, `per_page` and `status:` ``` -------------------------------- ### Admin API v1 Example Usage with Pagination Source: https://api.circle.so/apis/admin-api This example demonstrates how to make a paginated request to the Admin API v1, specifying the page number and the number of items per page. It also shows the expected authorization and content type headers. ```APIDOC ## Fetching Paginated Posts (Admin API v1) ### Description This endpoint allows you to retrieve posts with pagination. You can specify the page number and the number of items to display per page. ### Method GET ### Endpoint `/api/headless/admin/v1/posts` ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number of results to retrieve. Defaults to 1. - **per_page** (integer) - Optional - The number of items to return per page. Defaults to 10. ### Request Example ```bash curl -X GET "https://app.circle.so/api/headless/admin/v1/posts?page=2&per_page=30" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **page** (integer) - The current page number. - **per_page** (integer) - The number of items per page. - **has_next_page** (boolean) - Indicates if there are more pages available. - **count** (integer) - The total number of items across all pages. - **page_count** (integer) - The total number of pages. - **records** (array) - An array containing the data for the current page. ``` -------------------------------- ### Query Documentation API Source: https://api.circle.so/get-started/concepts/messages Demonstrates how to query the Circle API documentation dynamically using an HTTP GET request with the 'ask' query parameter for specific questions. ```http GET https://api.circle.so/get-started/concepts/messages.md?ask= ``` -------------------------------- ### Example JSON Structure for Blocks Source: https://api.circle.so/get-started/concepts/tiptap-editor This JSON structure represents a list of blocks that can be used within the Tiptap editor. It includes examples of different block types like 'sgid' and 'text'. ```json { "sgid":"some-sgid" }, "circle_ios_fallback_text":"@John Doe" }, { "type":"text", "text":" and some text" } ] } ``` -------------------------------- ### Combined Filters and Pagination Request Source: https://api.circle.so/apis/headless/member-api/community-member-search Example demonstrating the combination of various filters with cursor-based pagination parameters. ```json { "filters": [ { "key": "name", "filter_type": "contains", "value": "John" }, { "key": "profile_field", "filter_type": "is", "profile_field_type": "text", "profile_field_id": "123", "value": "Engineer" } ], "exclude_empty_profiles": true, "status": "active", "per_page": 20, "search_after": ["1463538857"] } ``` -------------------------------- ### Multi-Step Form Navigation Source: https://api.circle.so/apis/circle-plus/custom-html-api-reference Handles form submission by saving data to localStorage and navigating to the next step in a multi-step process. This example demonstrates basic form handling and client-side storage for state management. ```html

Step 1: Basic Information

``` -------------------------------- ### Response with Pagination Cursor Source: https://api.circle.so/apis/headless/member-api/community-member-search Example response structure indicating the next cursor for pagination. ```json { "data": [...], "next_search_after": ["1463538857"], "total_count": 15000 } ``` -------------------------------- ### Response Example for Retrieving Posts Source: https://api.circle.so/apis/admin-api/quick-start A simplified JSON structure of the response when retrieving posts for a space. ```APIDOC ```json // simplified version of Posts just { "page": 1, "per_page": 20, "has_next_page": false, "count": 3, "page_count": 1, "records": [ { "id": 1001, "status": "published", "name": "Welcome to Our Product Space", "slug": "welcome-to-our-product-space", "body": { "id": 1001, "body": "

Welcome to the product discussion space! Here we'll share updates and gather feedback.

", "created_at": "2024-09-01T09:00:00.000Z", "updated_at": "2024-09-01T09:00:00.000Z" }, "url": "https://app.circle.so/c/product-space/welcome-to-our-product-space", "space_name": "Product Space", "space_id": 999, "user_name": "Product Manager", "comments_count": 15, "published_at": "2024-09-01T09:00:00.000Z", "likes_count": 32 }, { "id": 1002, "status": "published", "name": "New Feature Announcement", "slug": "new-feature-announcement", "body": { "id": 1002, "body": "

We're excited to announce our latest feature: AI-powered recommendations!

", "created_at": "2024-09-05T14:30:00.000Z", "updated_at": "2024-09-05T14:30:00.000Z" }, "url": "https://app.circle.so/c/product-space/new-feature-announcement", "space_name": "Product Space", "space_id": 999, "user_name": "Development Lead", "comments_count": 28, "published_at": "2024-09-05T14:30:00.000Z", "likes_count": 45 }, { "id": 1003, "status": "published", "name": "Upcoming Maintenance Schedule", "slug": "upcoming-maintenance-schedule", "body": { "id": 1003, "body": "

Please be aware of our upcoming maintenance window this Saturday from 2 AM to 4 AM EST.

", "created_at": "2024-09-08T11:00:00.000Z", "updated_at": "2024-09-08T11:00:00.000Z" }, "url": "https://app.circle.so/c/product-space/upcoming-maintenance-schedule", "space_name": "Product Space", "space_id": 999, "user_name": "Support Team", "comments_count": 7, "published_at": "2024-09-08T11:00:00.000Z", "likes_count": 12 } ] } ``` ``` -------------------------------- ### Basic Profile Field Filters Source: https://api.circle.so/apis/headless/member-api/community-member-search Example of constructing filters for basic profile fields like name, email, and headline. ```json { "filters": [ { "key": "name", "filter_type": "is", "value": "John Doe" }, { "key": "email", "filter_type": "is", "value": "john@example.com" }, { "key": "headline", "filter_type": "contains", "value": "developer" } ] } ``` -------------------------------- ### Code Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a code block, specifying the programming language. ```json { "type": "codeBlock", "attrs": { "language": "javascript" }, "content":[ { "text":"console.log('Hey!');", "type":"text", "circle_ios_fallback_text":"console.log('Hey!');" } ] } ``` -------------------------------- ### Get Community Snapshot using Circle MCP Source: https://api.circle.so/mcp/prompt-library Use this prompt to get a comprehensive overview of your Circle community, including its name, total members, and a breakdown of all spaces organized by space group, along with notable settings. This helps in understanding the overall community structure and configuration. ```text Give me a full overview of my Circle community — name, total members, all spaces organized by space group, and any notable settings. I want to understand the lay of the land. ``` -------------------------------- ### Paragraph Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a basic paragraph block with text content. ```json { "type": "paragraph", "content": [ { "text": "This is a paragraph", "type": "text", "circle_ios_fallback_text": "This is a paragraph" } ] } ``` -------------------------------- ### Heading Level 2 Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a level 2 heading block. ```json { "type": "heading", "attrs": { "level": 2 }, "content": [ { "text": "This is 2nd level heading", "type": "text", "circle_ios_fallback_text": "This is 2nd level heading" } ] } ``` -------------------------------- ### Fetch Member Data using cURL Source: https://api.circle.so/apis/headless/quick-start Once you have an access token, use this cURL command to make requests to the Headless Member API. This example fetches paginated and sorted home data. ```bash curl -X GET "https://app.circle.so/api/headless/v1/home?page=2&per_page=20&sort=popular" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` -------------------------------- ### Numbered List Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for an ordered (numbered) list with multiple list items. ```json { "type": "orderedList", "attrs": { "start": 1 }, "content": [ { "type": "listItem", "content": [ { "type": "paragraph", "content": [ { "text": "This is a number list and this is item 1", "type": "text" } ] } ] }, { "type": "listItem", "content": [ { "type": "paragraph", "content": [ { "text": "This is item 2 in the list", "type": "text" } ] } ] } ] } ``` -------------------------------- ### Mention Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a mention within a paragraph, typically used for tagging users. ```json { "type":"paragraph", "content":[ { "type":"text", "text":"" }, { "type":"mention", "attrs":{ } ``` -------------------------------- ### Bulleted List Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a bulleted list with multiple list items. ```json { "type": "bulletList", "content": [ { "type": "listItem", "content": [ { "type": "paragraph", "content": [ { "text": "This is a bullet list and this is item 1", "type": "text" } ] } ] }, { "type": "listItem", "content": [ { "type": "paragraph", "content": [ { "text": "This is item 2", "type": "text" } ] } ] } ] } ``` -------------------------------- ### Heading Level 3 Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a level 3 heading block. ```json { "type": "heading", "attrs": { "level": 3 }, "content": [ { "text": "This is 3rd level heading", "type": "text", "circle_ios_fallback_text": "This is 2nd level heading" } ] } ``` -------------------------------- ### Complete Rich Text Example Source: https://api.circle.so/get-started/concepts/rich-text-body Combines paragraph, mention, link, and attachment elements into a single rich text message structure. Ensure all SGIDs and signed IDs are valid. ```json { "body": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "Hello " }, { "type": "mention", "attrs": { "sgid": "BAh7CEkiCGdpZAY6BkVUSSI7Z2lkOi8v..." } }, { "type": "text", "text": ", please check " }, { "type": "text", "marks": [ { "type": "link", "attrs": { "href": "https://www.circle.so", "target": "_blank" } } ], "text": "this link" } ] } ] }, "attachments": [ "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaH..." ] } ``` -------------------------------- ### Image Embed Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for an image embed block, including URL, dimensions, and alignment. ```json { "type": "image", "attrs": { "url": "", "width": "100%", "alignment": "center", // enum ["center"|"left"|"right"] "signed_id": "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZnM9IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--3dd03246287b040de40d07d9e81a57cc9baa1b4c", "content_type": "image/jpeg" } } ``` -------------------------------- ### Embed Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for an embed block, typically used for videos from platforms like YouTube. ```json { "type": "embed", "attrs": { "sgid": "BAh7CEkiCGdpZAY6BkVUSSI1Z2lkOi8vanVtcHN0YXJ0LWFwcC9SaWNoVGV4dE9lbWJlZC81MT9leHBpcmVzX2luBjsAVEkiDHB1cnBvc2UGOwBUSSIUcmljaF90ZXh0X2ZpZWxkBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--8c4d9e538b2a988746e77e96dcf048616db6962d" } } ``` -------------------------------- ### Example API Response for Posts Source: https://api.circle.so/apis/admin-api/quick-start This JSON structure represents a paginated response containing a list of published posts, including details like ID, status, name, body, and associated metadata. ```json // simplified version of Posts just { "page": 1, "per_page": 20, "has_next_page": false, "count": 3, "page_count": 1, "records": [ { "id": 1001, "status": "published", "name": "Welcome to Our Product Space", "slug": "welcome-to-our-product-space", "body": { "id": 1001, "body": "

Welcome to the product discussion space! Here we'll share updates and gather feedback.

", "created_at": "2024-09-01T09:00:00.000Z", "updated_at": "2024-09-01T09:00:00.000Z" }, "url": "https://app.circle.so/c/product-space/welcome-to-our-product-space", "space_name": "Product Space", "space_id": 999, "user_name": "Product Manager", "comments_count": 15, "published_at": "2024-09-01T09:00:00.000Z", "likes_count": 32 }, { "id": 1002, "status": "published", "name": "New Feature Announcement", "slug": "new-feature-announcement", "body": { "id": 1002, "body": "

We're excited to announce our latest feature: AI-powered recommendations!

", "created_at": "2024-09-05T14:30:00.000Z", "updated_at": "2024-09-05T14:30:00.000Z" }, "url": "https://app.circle.so/c/product-space/new-feature-announcement", "space_name": "Product Space", "space_id": 999, "user_name": "Development Lead", "comments_count": 28, "published_at": "2024-09-05T14:30:00.000Z", "likes_count": 45 }, { "id": 1003, "status": "published", "name": "Upcoming Maintenance Schedule", "slug": "upcoming-maintenance-schedule", "body": { "id": 1003, "body": "

Please be aware of our upcoming maintenance window this Saturday from 2 AM to 4 AM EST.

", "created_at": "2024-09-08T11:00:00.000Z", "updated_at": "2024-09-08T11:00:00.000Z" }, "url": "https://app.circle.so/c/product-space/upcoming-maintenance-schedule", "space_name": "Product Space", "space_id": 999, "user_name": "Support Team", "comments_count": 7, "published_at": "2024-09-08T11:00:00.000Z", "likes_count": 12 } ] } ``` -------------------------------- ### Open a Course Lesson Source: https://api.circle.so/apis/circle-plus/deep-linking-guide Navigate to a specific lesson within a course space. Ensure all IDs and slugs are correct. ```shell # Open a course lesson yourapp://c/foundations-course/sections/12/lessons/34 ``` -------------------------------- ### Open a Post Source: https://api.circle.so/apis/circle-plus/deep-linking-guide Use this format to open a specific post within a space. Replace placeholders with actual slugs. ```shell # Open a post yourapp://c/announcements/welcome-to-the-community ``` -------------------------------- ### Create a Course Space Source: https://api.circle.so/mcp/prompt-library This prompt creates a new course space with a structured format, enforcing lesson order and defining sections as 'Module' and lessons as 'Lesson'. ```prompt Create a new course space called "[Name]" in the [Space Group] space group. Make it structured with enforced lesson order. Use "Module" for sections and "Lesson" for lessons. ``` -------------------------------- ### Personalized Welcome Screen Source: https://api.circle.so/apis/circle-plus/custom-html-api-reference Creates a personalized welcome message and displays user role badges. It assumes a global `window.circleUser` object with `name`, `isAdmin`, and `isModerator` properties. ```html
``` -------------------------------- ### Blockquote Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a blockquote block. ```json { "type": "blockquote", "content": [ { "type": "paragraph", "content": [ { "text": "This is a blockquote", "type": "text" } ] } ] } ``` -------------------------------- ### Set Up a Gated/Locked Space Source: https://api.circle.so/mcp/prompt-library Configure a space to be private and hidden, setting a custom heading, description, and call-to-action button with a link for the lock screen. ```prompt Make [space name] private and hidden from non-members. Set the lock screen heading to "[Heading]," description to "[Description]," and CTA button to "[Label]" linking to [URL]. ``` -------------------------------- ### Horizontal Rule Block Example Source: https://api.circle.so/get-started/concepts/tiptap-editor JSON structure for a horizontal rule (a thematic break). ```json { "type": "horizontalRule" } ``` -------------------------------- ### Run WebSocket Connection Test Source: https://api.circle.so/get-started/websockets-beta Command to execute the JavaScript file for testing WebSocket connections. Successful connections will receive 'ping' messages from the server. ```bash $ node websocket-connection-test.js ``` -------------------------------- ### window.navigateToUrl() Source: https://api.circle.so/apis/circle-plus/custom-html-api-reference Opens a specified URL through the app's navigation system, allowing the app to handle it appropriately (e.g., deep links, external URLs). ```APIDOC ## window.navigateToUrl(url) ### Description Opens a URL through the app's navigation system. The app will handle the URL appropriately based on its type (deep links, external URLs, etc.). ### Method `window.navigateToUrl(url)` ### Parameters #### Path Parameters - **url** (string) - Required - The URL to navigate to ### Returns `void` ### Example ```javascript // Navigate to an external website window.navigateToUrl('https://example.com/resource'); // Navigate using a Circle deep link window.navigateToUrl('https://community.circle.so/c/announcements'); // Use in a link click handler document.querySelectorAll('a.native-nav').forEach(function(link) { link.addEventListener('click', function(e) { e.preventDefault(); window.navigateToUrl(this.href); }); }); ``` ``` -------------------------------- ### Create an Access Group Source: https://api.circle.so/mcp/prompt-library Create a new access group for managing member permissions, providing a name and a description for the group. ```prompt Create an access group called "[Name]" with description: "[Description]." ``` -------------------------------- ### Activity Score Range Filter Source: https://api.circle.so/apis/headless/member-api/community-member-search Example of filtering members within a specific range for their activity score. ```json { "filters": [ { "key": "activity_score", "gte": 5, "lte": 7 } ] } ``` -------------------------------- ### Complete WebSocket Implementation Source: https://api.circle.so/get-started/websockets-beta A comprehensive JavaScript implementation for establishing and managing a WebSocket connection, including connection, subscription, message handling, error handling, and closure. ```javascript const WebSocket = require("ws"); const channelName = "ChatRoomChannel"; function initializeWebSocket() { const socket = new WebSocket("wss://app.circle.so/cable", { headers: { Origin: "https://your-whitelisted-domain.com", Authorization: "Bearer HEADLESS_MEMBER_ACCESS_TOKEN" } }); // Handle connection open socket.on("open", function open() { console.log("WebSocket connection opened."); // Subscribe to channel const subscribeMessage = JSON.stringify({ command: "subscribe", identifier: JSON.stringify({ channel: channelName, community_member_id: COMMUNITY_MEMBER_ID }) }); socket.send(subscribeMessage); }); // Handle incoming messages socket.on("message", function incoming(data) { const message = JSON.parse(data); if (message.channel === channelName) { console.log(`Message from channel ${channelName}:`, message.data); } else { console.log("Message from server:", message); } }); // Handle errors socket.on("error", function error(err) { console.error("WebSocket error:", err); }); // Handle connection close socket.on("close", function close() { console.log("WebSocket connection closed."); // Optional: Implement reconnection logic here }); return socket; } // Initialize the WebSocket connection const socket = initializeWebSocket(); ``` -------------------------------- ### Custom Profile Field Filters Source: https://api.circle.so/apis/headless/member-api/community-member-search Example of filtering based on custom profile fields, including text and checkbox types. ```json { "filters": [ { "key": "profile_field", "filter_type": "is", "profile_field_type": "text", "profile_field_id": "123", "value": "Software Engineer" }, { "key": "profile_field", "profile_field_type": "checkbox", "profile_field_id": "456", "value": "true" } ] } ``` -------------------------------- ### Create a Discussion Space Source: https://api.circle.so/mcp/prompt-library Use this prompt to create a new basic discussion space with specified settings like name, group, display view, visibility, and emoji. ```prompt Create a new basic space called "[Name]" in the [Space Group] space group. Set it to the feed display view, make it public, and use the emoji [emoji]. ``` -------------------------------- ### Add Content to a Course Source: https://api.circle.so/mcp/prompt-library Add new sections and lessons (as drafts) to an existing course. Specify the course name, section name, and lesson titles. ```prompt In my [Course Name] course, create a section called "[Section Name]." Then add these lessons (all as drafts): "[Lesson 1]", "[Lesson 2]", "[Lesson 3]". ``` -------------------------------- ### Create Circle MCP App in ChatGPT Source: https://api.circle.so/mcp Configuration details for creating a custom Circle MCP app within ChatGPT. Requires Developer mode to be enabled. ```json { "Name": "Circle", "MCP Server URL": "https://app.circle.so/api/mcp", "Authentication": "OAuth" } ``` -------------------------------- ### Recap Live Room Session to Post and Email Source: https://api.circle.so/mcp/prompt-library Summarize a Circle Live Room session, create a recap post in your community, and send a follow-up email to attendees with the recap and a link to the community post. ```prompt Pull the transcript from my Circle Live Room for "[Event or Session Name]." Summarize the key takeaways, any action items or next steps, and the most common questions that came up during the session. Then: (1) draft a recap post for [space name] in my Circle community that includes the summary, key takeaways, and a Q&A section from the questions asked, and (2) draft a follow-up email via [Gmail] to attendees with the same recap and a link back to the community post. ``` -------------------------------- ### Get Member API Token from Email Source: https://api.circle.so/apis/headless/auth-sdk/node.js/methods Obtains member access and refresh tokens using the community member's email address. Requires the email parameter. ```javascript const response = await client.getMemberAPITokenFromEmail(email@community.com) ``` -------------------------------- ### Fetch Posts with Pagination (Admin API v1) Source: https://api.circle.so/apis/admin-api Use this endpoint to retrieve posts with specified pagination parameters. Ensure your API token is included in the Authorization header. ```bash curl -X GET "https://app.circle.so/api/headless/admin/v1/posts?page=2&per_page=30" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Member API Token from Community Member ID Source: https://api.circle.so/apis/headless/auth-sdk/node.js/methods Obtains member access and refresh tokens using the community member's ID. Requires the memberID as a parameter. ```javascript const response = await client.getMemberAPITokenFromCommunityMemberId(MemberID); ``` -------------------------------- ### Initiate File Upload Request Source: https://api.circle.so/get-started/concepts/file-uploads This endpoint initiates the file upload process by requesting a pre-signed URL from the storage service. It requires file metadata such as key, filename, content type, size, and checksum. ```APIDOC ## POST /api/headless/v1/direct_uploads ### Description Initiates the file upload process by requesting a pre-signed URL. The request body should contain metadata about the file to be uploaded. ### Method POST ### Endpoint `https://app.circle.so/api/headless/v1/direct_uploads` ### Parameters #### Request Body - **blob** (object) - Required - Contains file metadata. - **key** (string) - Required - A unique key for the file. - **filename** (string) - Required - The name of the file. - **content_type** (string) - Required - The MIME type of the file. - **byte_size** (integer) - Required - The size of the file in bytes. - **checksum** (string) - Required - The Base64 encoded MD5 checksum of the file. ### Request Example ```bash curl -X POST 'https://app.circle.so/api/headless/v1/direct_uploads' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ -d '{ "blob": { "key": "your_file_key", "filename": "your_filename.ext", "content_type": "your_content_type", "byte_size": 12345, "checksum": "your_file_checksum" } }' ``` ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the upload record. - **key** (string) - The key associated with the file. - **filename** (string) - The name of the file. - **content_type** (string) - The MIME type of the file. - **byte_size** (integer) - The size of the file in bytes. - **checksum** (string) - The MD5 checksum of the file. - **created_at** (string) - Timestamp when the upload record was created. - **metadata** (object) - Additional metadata about the file. - **service_name** (string) - The storage service used (e.g., 's3'). - **signed_id** (string) - Signed ID for the upload. - **attachable_sgid** (string) - Signed Global ID for the attachable. - **direct_upload** (object) - Contains the URL and headers for direct upload. - **url** (string) - The pre-signed URL for uploading the file. - **headers** (object) - Headers required for the PUT request to the direct upload URL. - **url** (string) - The final URL of the uploaded file. #### Response Example ```json { "id": 12345, "key": "file_key_123", "filename": "example.jpg", "content_type": "image/jpeg", "byte_size": 1048576, "checksum": "abcdef1234567890", "created_at": "2024-09-12T14:30:00Z", "metadata": { "identified": true }, "service_name": "s3", "signed_id": "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--abcdef1234567890", "attachable_sgid": "BAh7CEkiCGdpZAY6BkVUSSIpZ2lkOi8vbXktYXBwL0Jsb2IvMTIzNDU2Nzg5MAY7AFRJIgxwdXJwb3NlBjsAVEkiD2F0dGFjaGFibGUGOwBUSSIPZXhwaXJlc19hdAY7AFQw", "direct_upload": { "url": "https://your-bucket.s3.amazonaws.com/uploads/123456789", "headers": { "Content-Type": "image/jpeg", "Content-MD5": "abcdef1234567890=" } }, "url": "https://your-cdn.com/uploads/123456789/example.jpg" } ``` ``` -------------------------------- ### Comparing Good and Bad API Requests Source: https://api.circle.so/apis/admin-api/usage-and-limits/optimizing-usage Illustrates the difference between a valid API request and common malformed requests that result in 4XX errors. Ensure parameters are correctly formatted and present to avoid unnecessary billing. ```bash // good request GET /api/admin/v2/community_members/123 ``` ```bash // bad request GET /api/admin/v2/community_members/undefined GET /api/admin/v2/community_members ``` -------------------------------- ### window.webview.setAppearance() Source: https://api.circle.so/apis/circle-plus/custom-html-api-reference Enables custom HTML content to dynamically switch between light and dark themes to align with the native application's current appearance settings. ```APIDOC ## window.webview.setAppearance(appearance) ### Description Allows your custom HTML to switch between light and dark themes to match the native app's appearance. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **appearance** (string) - Required - Either "light" or "dark" ### Request Example ```javascript // Set dark mode if (window.webview.setAppearance) { window.webview.setAppearance("dark"); } // Match system preference const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches; if (window.webview.setAppearance) { window.webview.setAppearance(prefersDark ? "dark" : "light"); } ``` ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### Add Circle MCP Connector via CLI Source: https://api.circle.so/mcp Use this command to add the Circle MCP connector using the command-line interface. Ensure you have the 'claude' CLI tool installed. ```bash claude mcp add --transport http circle https://app.circle.so/api/mcp ``` -------------------------------- ### Get Member API Token from SSO ID Source: https://api.circle.so/apis/headless/auth-sdk/node.js/methods Obtains member access and refresh tokens using the member's Single Sign-On (SSO) ID. Requires the SSOID parameter. ```javascript const response = await client.getMemberAPITokenFromSSOId(SSOID); ``` -------------------------------- ### Create Calendar Events from Workshops Source: https://api.circle.so/mcp/prompt-library This prompt checks your Google Calendar for upcoming workshops and creates corresponding events in your specified space, including date, time, and Zoom link. ```prompt Check my Google Calendar for upcoming workshops this month. For each one, create a matching event in my [events space] with the correct date, time, and Zoom link from the calendar invite. ``` -------------------------------- ### Create a Chat Room Space Source: https://api.circle.so/mcp/prompt-library Use this prompt to create a new chat space, specifying its name, group, and whether to show chat history to new members. ```prompt Create a chat space called "[Name]" in the [Space Group] space group. Show chat history to new members. ``` -------------------------------- ### Navigate to URL Source: https://api.circle.so/apis/circle-plus/custom-html-api-reference Open a URL using the app's navigation system. The app handles different URL types, including deep links and external URLs. ```javascript // Navigate to an external website window.navigateToUrl('https://example.com/resource'); // Navigate using a Circle deep link window.navigateToUrl('https://community.circle.so/c/announcements'); // Use in a link click handler document.querySelectorAll('a.native-nav').forEach(function(link) { link.addEventListener('click', function(e) { e.preventDefault(); window.navigateToUrl(this.href); }); }); ```