Authenticate the activity feed channel
POST
/api/v3/agents/activity/pusher-auth
const url = 'https://api.tryletterhead.com/api/v3/agents/activity/pusher-auth';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api":true,"socket_id":"123.456","channel_name":"private-org-482-agent-feed"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/agents/activity/pusher-auth \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api": true, "socket_id": "123.456", "channel_name": "private-org-482-agent-feed" }'Signs a subscription request for the private channel returned by Get the activity feed’s live channel. Your realtime client posts the socket_id and channel_name it wants to subscribe to here; a mismatched channel for your company is rejected.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
api
required
Required. Set to true to authenticate with an API key.
boolean
socket_id
required
The realtime client’s socket ID.
string
channel_name
required
The channel name from Get the activity feed’s live channel.
string
Example
{ "api": true, "socket_id": "123.456", "channel_name": "private-org-482-agent-feed"}Responses
Section titled “ Responses ”200 OK
Media type application/json
object
items
object
auth
string
message
string
total
integer
Example
{ "items": { "auth": "268a1b:c4e9d7f3a2b1e5d6f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1" }, "message": "", "total": 1}403 Forbidden — the channel name doesn’t belong to your company.
Media type application/json
object
items
Array
message
string
total
integer
Example
{ "items": [], "message": "Channel does not belong to this company.", "total": 0}Still can’t find what you need? Contact support.