技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
intercom-hello-world【数据与研究】Create a minimal working Intercom example with contacts, conversations, and messages. Use when starting a new Intercom integration, testing your setup, or learning the core Intercom API data model. Trigger with phrases like "intercom hello world", "intercom example", "intercom quick start", "simple intercom code", "first intercom API call".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: intercom-hello-world description: 'Create a minimal working Intercom example with contacts, conversations, and messages.
Use when starting a new Intercom integration, testing your setup,
or learning the core Intercom API data model.
Trigger with phrases like "intercom hello world", "intercom example",
"intercom quick start", "simple intercom code", "first intercom API call".
' allowed-tools: Read, Write, Edit version: 1.6.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
Minimal working examples covering the Intercom core data model: contacts (users and leads), conversations, messages, and tags. This skill gives you the first end-to-end round trip against the Intercom REST API — create a contact, search it, message it, open a conversation, and tag it — so you can confirm your credentials work and internalize how the entities relate before building anything real.
Before running any snippet below, make sure the following are in place. Each is verified once during the intercom-install-auth setup step:
intercom-install-auth setup (installs the SDK and stores your token).intercom-client npm package installed in your project (npm install intercom-client).INTERCOM_ACCESS_TOKEN in your environment. The SDK reads this token to authenticate every request; there is no separate login call.The workflow is five short steps against the core data model. The first —
creating a contact — is shown in full here so you can run immediately. Steps 2
through 5 (search, message, conversation, tag) follow the identical
client.<resource>.<verb>(...) shape and live in the walkthrough reference.
Contacts are the core entity. They have a role of either user (identified) or lead (anonymous).
import { IntercomClient } from "intercom-client";
const client = new IntercomClient({
token: process.env.INTERCOM_ACCESS_TOKEN!,
});
// Create a user contact
const user = await client.contacts.create({
role: "user",
externalId: "user-12345",
email: "jane@example.com",
name: "Jane Smith",
});
console.log(`Created contact: ${user.id} (${user.role})`);
Continue in the full walkthrough, which covers, with complete code and response shapes:
client.contacts.search)client.messages.create, admin → contact)client.conversations.create)client.tags.create + client.contacts.tag)The walkthrough also carries the full Core Data Model reference table (Contact, Conversation, Message, Tag, Company, Admin and their key fields).
Running the snippets produces:
id, role, email, external_id, custom_attributes, and timestamps (see the full response shape in the walkthrough).Created contact: 6657add46abd0167d9419c3a (user).Nothing is written to disk — every result is an in-memory API object plus the
console.log lines above. A successful run means every call returned without
throwing.
| Error | Cause | Solution |
|---|---|---|
not_found (404) | Contact/conversation ID invalid | Verify the ID exists |
parameter_invalid | Missing required field | Check required params in docs |
conflict (409) | Duplicate external_id | Use unique identifiers |
unauthorized (401) | Invalid token | Regenerate access token (re-run intercom-install-auth) |
Both are copy-paste runnable once the Prerequisites above are met.
Proceed to the intercom-local-dev-loop skill to set up a fast local
development workflow (watch mode, sandbox workspace, and safe test data) once
this hello-world round trip succeeds.