Skip to content

Commit 551f8eb

Browse files
levindixonclaude
andauthored
Add Macros API endpoints to OpenAPI spec (#286)
* feat(api): Add Macro schema definition to OpenAPI spec (intercom/intercom#420117) Add the Macro object schema to the Unstable API specification. This schema represents saved replies (macros) that can be used for quick responses in conversations. Schema includes: - Basic fields: type, id, name - Content fields: body (HTML with transformed placeholders), body_text - Timestamps: created_at, updated_at (Unix timestamps) - Visibility controls: visible_to, visible_to_team_ids - Availability: available_on array for inbox/messenger The schema follows the implementation in MacroPresenter and includes the placeholder transformation feature where mustache-style placeholders are converted to XML-like attribute tags. Part of: intercom/intercom#420117 * feat: Add MacroList schema for paginated macro responses (intercom/intercom#420117) - Add MacroList schema to support paginated list responses for macros - Follow established pattern with type "list" and data array - Implement cursor-based pagination with starting_after parameter - Include Base64-encoded cursor for stable pagination ([updated_at, id] tuples) - Reference existing macro schema for data items - Add x-tags: Unstable to match macro visibility This schema will be used by the GET /macros endpoint to return paginated lists of saved reply templates. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * feat(api): Add Macros API endpoints to OpenAPI spec (intercom/intercom#420117) Add GET /macros and GET /macros/{id} endpoint definitions to the Unstable OpenAPI specification for the new Macros API. Changes: - Add GET /macros endpoint with cursor-based pagination - Query parameters: per_page (1-150, default 50), starting_after (Base64 cursor), updated_since (Unix timestamp) - Returns paginated list of macros with MacroList schema - Documents placeholder transformation from Intercom to XML-like format - Add GET /macros/{id} endpoint for single macro retrieval - Path parameter: id (macro identifier) - Returns single macro with Macro schema - Add Macros tag to tags section in alphabetical order - Include comprehensive examples and error responses (400, 401, 403, 404) - Document OAuth scope requirement (read_conversations) The endpoints follow existing patterns in the OpenAPI spec and accurately reflect the implementation in PR #419604. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs(api): Enhance macro retrieval endpoint documentation (intercom/intercom#420117) - Clarify macro visibility rules and team-based access control - Add detailed explanation of when macros are accessible vs return 404 - Expand examples to show team-restricted and complex placeholder scenarios - Document HTML escaping behavior for placeholder default values - Improve parameter description for clarity 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * feat(postman): Add Macros API collection with comprehensive examples (intercom/intercom#420117) Add complete Postman collection for the new Macros API endpoints including: - List all macros endpoint with basic pagination - List macros with cursor-based pagination example - List macros filtered by update timestamp - Complex example combining multiple query parameters - Get single macro by ID with error responses Each request includes: - Proper Bearer token authentication setup - Required Intercom-Version header for Unstable API - Detailed parameter descriptions and usage notes - Example responses showcasing placeholder transformation - Test scripts for response validation and cursor handling The collection provides developers with executable examples to quickly test and integrate the Macros API without writing code first. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * fix(api): Correct Macros API timestamp formats and required fields (intercom/intercom#420117) - Changed timestamp fields from integer/int64 to string/date-time format - Updated all timestamp examples to ISO 8601 format - Added body_text and visible_to_team_ids to required fields - Clarified placeholder transformation behavior in documentation - Regenerated Postman collection with corrected schema 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs(api): Add code samples and comprehensive examples to Macros API endpoints (intercom/intercom#420117) - Add code samples in cURL, Node.js, Python, and Ruby for both endpoints - Expand response examples with multiple scenarios including pagination, filtering, and various macro types - Improve error response examples with clearer messaging - Fix tags from 'Unstable' to 'Macros' for proper categorization - Enhance tag description for better API documentation navigation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * fix(api): Remove incorrect required field constraints from Macros API schemas (intercom/intercom#420117) - Remove overly restrictive required field definitions from macro and macro_list schemas - Update Postman collection timestamps - Simplify placeholder transformation descriptions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 33da172 commit 551f8eb

File tree

3 files changed

+1327
-23
lines changed

3 files changed

+1327
-23
lines changed

0 commit comments

Comments
 (0)