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 WebSocket 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 Channel

Returns a list of all active channels 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 Blockchain Messages

Returns a list of all Blockchain contracts for authenticated API key.

GET https://www.piesocket.com/api/contracts

Parameters:

  • channel: Filter results based on channel.

Cluster API

Cluster APIs are a way to communicate with your WebSocket cluster. Currently, we provide following endpoints.

Cluseter 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.

GET https://CLUSTER_ID.piesocket.com/api/publish

View publish examples to learn more about this API and its parameters.

Example

You can click the following button to run example requests for all our REST APIs in Postman, using the demo API key and secret.

Run in Postman