"Platform API skill. Use when working with Platform for channels, push, keys. Covers 22 endpoints."
Resources
1Install
npx skillscat add lap-platform/claude-marketplace/platform-api Install via the SkillsCat registry.
SKILL.md
Platform API
API version: 1.1.1
Auth
Bearer basic | Bearer bearer
Base URL
Setup
- Set Authorization header with your Bearer token
- GET /channels -- verify access
- POST /channels/{channel_id}/messages -- create first messages
Endpoints
22 endpoints across 5 groups. See references/api-spec.lap for full details.
channels
| Method | Path | Description |
|---|---|---|
| GET | /channels/{channel_id}/messages | Get message history for a channel |
| POST | /channels/{channel_id}/messages | Publish a message to a channel |
| GET | /channels/{channel_id}/presence | Get presence of a channel |
| GET | /channels/{channel_id}/presence/history | Get presence history of a channel |
| GET | /channels/{channel_id} | Get metadata of a channel |
| GET | /channels | Enumerate all active channels of the application |
push
| Method | Path | Description |
|---|---|---|
| GET | /push/deviceRegistrations | List devices registered for receiving push notifications |
| POST | /push/deviceRegistrations | Register a device for receiving push notifications |
| DELETE | /push/deviceRegistrations | Unregister matching devices for push notifications |
| GET | /push/deviceRegistrations/{device_id} | Get a device registration |
| PUT | /push/deviceRegistrations/{device_id} | Update a device registration |
| PATCH | /push/deviceRegistrations/{device_id} | Update a device registration |
| DELETE | /push/deviceRegistrations/{device_id} | Unregister a single device for push notifications |
| GET | /push/deviceRegistrations/{device_id}/resetUpdateToken | Reset a registered device's update token |
| GET | /push/channelSubscriptions | List channel subscriptions |
| POST | /push/channelSubscriptions | Subscribe a device to a channel |
| DELETE | /push/channelSubscriptions | Delete a registered device's update token |
| GET | /push/channels | List all channels with at least one subscribed device |
| POST | /push/publish | Publish a push notification to device(s) |
keys
| Method | Path | Description |
|---|---|---|
| POST | /keys/{keyName}/requestToken | Request an access token |
stats
| Method | Path | Description |
|---|---|---|
| GET | /stats | Retrieve usage statistics for an application |
time
| Method | Path | Description |
|---|---|---|
| GET | /time | Get the service time |
Enhanced Skill Content
Question Mapping
- "How do I publish a message to a channel?" -> POST /channels/{channel_id}/messages
- "What messages were sent on a channel recently?" -> GET /channels/{channel_id}/messages
- "Who is currently present on a channel?" -> GET /channels/{channel_id}/presence
- "Show me the presence history for a channel" -> GET /channels/{channel_id}/presence/history
- "How many subscribers does a channel have?" -> GET /channels/{channel_id}
- "List all active channels" -> GET /channels
- "List channels that start with a specific prefix" -> GET /channels
- "How do I register a device for push notifications?" -> POST /push/deviceRegistrations
- "Send a push notification to a specific device" -> POST /push/publish
- "What devices are registered for push for a given client?" -> GET /push/deviceRegistrations
- "How do I subscribe a device to push on a channel?" -> POST /push/channelSubscriptions
- "Remove a device's push registration" -> DELETE /push/deviceRegistrations/{device_id}
- "Generate a temporary auth token for a key?" -> POST /keys/{keyName}/requestToken
- "What is the current server time?" -> GET /time
- "Show me usage stats for the past hour" -> GET /stats
Response Tips
- Channels (list/messages/presence): Responses are arrays; use
limit(max 100) anddirectionfor pagination. Pass the timestamp of the last item asstartorendto page through results. - Channel metadata (GET /channels/{id}): Returns a nested
status.occupancyobject with separate counts for publishers, subscribers, presenceMembers, presenceConnections, and presenceSubscribers -- do not conflate these. - Push device registrations: Responses nest recipient config under
push.recipient(dot-notation key, not a nested object path). Thepush.statefield is one of Active/Failing/Failed -- check this to determine delivery health. - Push publish: Returns 2XX with no body on success. Any non-2XX means the notification was not delivered.
- Token requests: The response includes
issuedandexpiresas Unix timestamps (int64). Computeexpires - issuedto know the token TTL. - Stats: Returns an array of stat objects bucketed by
unit(minute/hour/day/month). Empty buckets may be omitted rather than returned as zeros. - Time: Returns a single-element array containing the server time as a Unix timestamp in milliseconds.
Anomaly Flags
- push.state = "Failing" or "Failed": Surface immediately when reading device registrations -- the device is not receiving push notifications and may need re-registration.
- Token expiry approaching: When a requested token's
expirestimestamp is within 5 minutes of current time, warn that re-authentication will be needed soon. - Empty channel list with prefix filter: If GET /channels with a
prefixreturns zero results, flag that the prefix may be misspelled or no matching channels are active. - Presence count mismatch: If
presenceMembersdiffers significantly frompresenceConnectionson a channel, flag it -- this may indicate stale presence entries or connection issues. - Limit capping: When a response returns exactly
limititems (default 100), warn that results are likely truncated and pagination is needed for complete data. - Device registration without deviceSecret: If a POST/PUT to device registrations omits
deviceSecret, flag that the device may not be able to authenticate future updates.
Playbook
1. Send a Push Notification to All Devices for a Client
- GET /push/deviceRegistrations with
clientIdto list all registered devices for the client. - Verify each device has
push.state= "Active". Flag any in Failing/Failed state. - POST /push/publish with
recipient.clientIdset to the target client ID, along with thepush.notificationpayload (title, body, sound). - Confirm 2XX response. If non-2XX, check error body for details.
2. Monitor Channel Activity and Presence
- GET /channels with optional
prefixto discover active channels. - For each channel of interest, GET /channels/{channel_id} to check
status.isActiveandstatus.occupancycounts. - GET /channels/{channel_id}/presence to see who is currently connected.
- GET /channels/{channel_id}/presence/history with
start/endto review presence changes over a time window.
3. Register a Mobile Device for Push and Subscribe to a Channel
- POST /push/deviceRegistrations with
platform(ios/android),formFactor, andpush.recipientcontaining the device token or registration token. - Capture the returned
id(device ID) anddeviceSecretfrom the response. - POST /push/channelSubscriptions with the
deviceIdand targetchannelname. - Verify with GET /push/channelSubscriptions using
deviceIdto confirm the subscription is active.
4. Retrieve and Page Through Message History
- GET /channels/{channel_id}/messages with
direction=backwardsandlimit=100to get the most recent messages. - If 100 results are returned, extract the timestamp of the oldest message.
- Repeat the request with
endset to that timestamp to fetch the next page. - Continue until fewer than
limitresults are returned, indicating the end of history.
5. Generate a Temporary Token for Client-Side Use
- POST /keys/{keyName}/requestToken with the key name (format:
appId.keyId). - Extract the
token,issued, andexpiresfields from the response. - Compute remaining TTL:
expires - issued. Default is typically 60 minutes. - Pass the
tokenvalue to the client application for use as a Bearer token. - Schedule token refresh before
expiresto avoid authentication interruptions.
Response Tips
- Check response schemas in references/api-spec.lap for field details
- List endpoints may support pagination; check for limit, offset, or cursor params
- Create/update endpoints typically return the created/updated object
References
- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas
Generated from the official API spec by LAP