Skip to content
petrohi edited this page Feb 15, 2013 · 2 revisions

The CloudStore Pub/Sub API allows for app servers to receive webhook callbacks whenever specific data changes.

Subscribe

PUT /subscriptions/[CLIENT GENERATED SUBSCRIPTION ID]?token=[CloudStore ACCESS TOKEN]

{
  "path": "[CloudStore path]",
  "callback": "[CALLBACK URL]"
}

The callback URL will receive a POST with the data referenced at CloudStore path whenever the data changes.

The CloudStore access token must have read access to the path. The token can be passed in as a query param or cookie.

As a best practice, the callback URL should contain a unique token generated by the client to prevent unauthorized posting.

Unsubscribe

DELETE /subscriptions/[SUBSCRIPTION ID]

Deletes the specific subscription.

DELETE /subscriptions?path=[CloudStore path]

Delete all subscriptions for the CloudStore path.

DELETE /subscriptions?token=[CloudStore ACCESS TOKEN]

Delete all subscriptions for given access token.

DELETE /subscriptions?callback=[CALLBACK URL]

Delete all subscriptions for given callback URL. The callback must be URL encoded.

Clone this wiki locally