### Install Go SDK Source: https://docs.linqapp.com/channel/imessage/api Install the LinqApp Go SDK version 0.70.0 using go get. ```bash go get -u 'github.com/linq-team/linq-go@v0.70.0' ``` -------------------------------- ### Install Go SDK with go get Source: https://docs.linqapp.com/channel/imessage/getting-started/sdks Install the official Linq SDK for Go using go get. Requires Go 1.22+. ```bash go get -u github.com/linq-team/linq-go ``` -------------------------------- ### Install linq-go v0.70.0 with go get Source: https://docs.linqapp.com/channel/imessage/api/go Pins the SDK to version v0.70.0 when installing with go get. ```bash go get -u 'github.com/linq-team/linq-go@v0.70.0' ``` -------------------------------- ### Install Linq MCP server via npx Source: https://docs.linqapp.com/channel/imessage/guides/resources/faq Run this command to start the Linq MCP server without installing it locally. Requires Node.js and npx. ```bash npx -y @linqapp/sdk-mcp@latest ``` -------------------------------- ### Quickstart: Create Linq adapter and handle messages/reactions Source: https://docs.linqapp.com/channel/imessage/guides/integrations/chat-sdk Set up a Chat instance with the Linq adapter, subscribe to direct messages, and handle thumbs_up reactions. Requires `LINQ_API_KEY` and `LINQ_WEBHOOK_SECRET` environment variables. ```typescript import { createLinqAdapter } from "@linqapp/chat-sdk-adapter"; import { Chat } from "chat"; const chat = new Chat({ userName: "mybot", adapters: { linq: createLinqAdapter({ apiKey: process.env.LINQ_API_KEY!, signingSecret: process.env.LINQ_WEBHOOK_SECRET!, }), }, }); chat.onDirectMessage(async (thread, message) => { await thread.subscribe(); await thread.post(`you said: ${message.text}`); }); chat.onReaction(["thumbs_up"], async (event) => { await event.thread.post("appreciate the tapback 🫡"); }); ``` -------------------------------- ### cURL example for Get Chat Message Reaction Source: https://docs.linqapp.com/channel/imessage/llms-full.txt Uses curl with the --request GET flag and the required X-LINQ-INTEGRATION-TOKEN header. The example uses reaction_id 1. ```shell curl --request GET \ --url https://api.linqapp.com/api/partner/v2/chat_message_reactions/1 \ --header 'X-LINQ-INTEGRATION-TOKEN: ' ``` -------------------------------- ### Python: Start payment-provider onboarding with LinqAPIV3 Source: https://docs.linqapp.com/channel/imessage/api/python/resources/payment_providers/methods/connect Uses the `payment_providers.connect` method to begin connecting to a payment provider. Requires an API key (defaults to `LINQ_API_V3_API_KEY` environment variable) and provides a `return_url` for redirect after authorization. Prints the `session_id` from the response. ```python import os from linq import LinqAPIV3 client = LinqAPIV3( api_key=os.environ.get("LINQ_API_V3_API_KEY"), # This is the default and can be omitted ) response = client.payment_providers.connect( provider="provider", return_url="https://partner.example/settings/payments", ) print(response.session_id) ``` -------------------------------- ### 200 example response Source: https://docs.linqapp.com/channel/imessage/api/go/resources/available_number/methods/retrieve Example response for a successful request to get an available sending number. ```json { "phone_number": "+12025551234", "vcf_url": "https://s3.us-east-1.amazonaws.com/linq-attachments/vcf/9716d5c5/12025551234.vcf?X-Amz-Signature=..." } ``` -------------------------------- ### Install Linq CLI and authenticate Source: https://docs.linqapp.com/channel/imessage/getting-started/quickstart Install the Linq CLI globally and log in with your bearer token. Both the CLI and the plugin read the same credential. ```bash npm install -g @linqapp/cli@latest linq login --token ``` -------------------------------- ### Go SDK example for PaymentProviders.Connect Source: https://docs.linqapp.com/channel/imessage/api/go/resources/payment_providers/methods/connect Uses the linq-go client to call PaymentProviders.Connect with a provider and PaymentProviderConnectParams containing a ReturnURL. Requires an API key and prints the returned SessionID. ```Go package main import ( "context" "fmt" "github.com/linq-team/linq-go" "github.com/linq-team/linq-go/option" ) func main() { client := linqgo.NewClient( option.WithAPIKey("My API Key"), ) response, err := client.PaymentProviders.Connect( context.TODO(), "provider", linqgo.PaymentProviderConnectParams{ ReturnURL: "https://partner.example/settings/payments", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.SessionID) } ``` -------------------------------- ### location.sharing.started webhook payload Source: https://docs.linqapp.com/channel/imessage/guides/webhooks/events Example payload for the location.sharing.started event. Fires when a participant starts sharing their location. The payload includes shared_by, shared_with, began_at, ends_at (always present, null for indefinite sharing), and chat_id. After this event, call Read shared locations to get current coordinates. ```json { "api_version": "v3", "webhook_version": "2026-02-03", "event_type": "location.sharing.started", "event_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2026-02-04T12:00:00Z", "trace_id": "2eff5df5c6f688733c007523c4d61cd9", "partner_id": "your-partner-id", "data": { "shared_by": "+15551234567", "shared_with": "+15559876543", "began_at": "2026-02-04T12:00:00Z", "ends_at": "2026-02-04T13:00:00Z", "chat_id": "550e8400-e29b-41d4-a716-446655440000" } } ``` -------------------------------- ### Install the Linq API V3 SDK with npm Source: https://docs.linqapp.com/channel/imessage/api/typescript Install the @linqapp/sdk package using npm. This is the first step before using the library. ```bash npm install @linqapp/sdk ``` -------------------------------- ### Get Chat Message - JavaScript fetch example Source: https://docs.linqapp.com/channel/imessage/llms-full.txt JavaScript example using fetch to send a GET request to the Linq API endpoint. Requires an X-LINQ-INTEGRATION-TOKEN header. The response is parsed as JSON and logged, with errors caught and logged. ```javascript const url = 'https://api.linqapp.com/api/partner/v2/chats/1/chat_messages/1'; const options = { method: 'GET', headers: {'X-LINQ-INTEGRATION-TOKEN': ''} }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` -------------------------------- ### cURL example for GET /api/partner/v2/webhook_subscriptions Source: https://docs.linqapp.com/channel/imessage/llms-full.txt Uses curl with the --request GET flag and the X-LINQ-INTEGRATION-TOKEN header to retrieve webhook subscriptions. ```shell curl --request GET \ --url https://api.linqapp.com/api/partner/v2/webhook_subscriptions \ --header 'X-LINQ-INTEGRATION-TOKEN: ' ``` -------------------------------- ### Try the plugin with plain-language prompts Source: https://docs.linqapp.com/channel/imessage/getting-started/ai-agents Ask your agent in plain language to use Linq. The agent picks the right skill automatically. ```text Add Linq messaging to this app — I already have an API key ``` ```text What are my Linq phone numbers? ``` ```text Write me an Express webhook handler for Linq ``` -------------------------------- ### 200 example - audit started response Source: https://docs.linqapp.com/channel/imessage/api/go/resources/phone_numbers/methods/start_reputation_audit HTTP 200 response body showing a successful audit start with audit_id and status pending. ```json { "audit_id": "audit_id", "status": "pending" } ``` -------------------------------- ### cURL example for GET contact Source: https://docs.linqapp.com/channel/imessage/llms-full.txt Uses curl to send a GET request with the integration token header. The response is the contact details or an error. ```shell curl --request GET \ --url https://api.linqapp.com/api/partner/v2/contacts/1 \ --header 'X-LINQ-INTEGRATION-TOKEN: ' ```