Rest API
REST APIs are powerful features to enable data-sharing between your servers and ours, this helps in better intregration of services and gives you more power over your PieSocket data.
We provide following API endpoints.
| Name | Endpoint | Purpose |
|---|---|---|
| Account API | https://www.piesocket.com/api | To communicate with your PieSocket account |
| Cluster API | https://CLUSTER_ID.piesocket.com/api | To communicate with your PieSocket Cluster |
Account API
You can use the Account API to fetch your API key domains, get total number of connections, etc.
Account API Authentication
You need to pass your API key as key and API secret as secret, in HTTP headers to be able to communicate with the Account API.
List API Key Domains
Returns a list of all allowed domains for an API key
GET https://www.piesocket.com/api/domains
This API endpoint accepts no parameters.
List Active Connections By Room
Returns a list of all active Channel rooms and their connection count for the authenticated API key.
GET https://www.piesocket.com/api/connections
Total Active Connections
Returns a count of total active connections for the authenticated API key.
GET https://www.piesocket.com/api/connections/sum
List channel logs
Returns a list of most recent 500 messages from a PieSocket cluster, for the specified API key.
GET https://www.piesocket.com/api/logs
List channel members
Returns a list of channels and presence members inside them - please note, only members with presence=1 will be listed.
GET https://www.piesocket.com/api/members
Cluster API
Cluster APIs are a way to communicate with your WebSocket cluster. Currently, we provide following endpoints.
Cluster API Authentication
Cluster APIs do not require Authorization headers, but api key and secret is required in the request body.
Publish messages
Use the following endpoint to publish a message on a WebSocket channel.
POST https://CLUSTER_ID.piesocket.com/api/publish
View publish examples to learn more about this API and its parameters.
On this page
