Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Demystifying deepstream's HTTP API

Demystifying deepstream's HTTP API

The fourth one from the webinar series by deepstream, exploring it's features and concepts.

Srushtika Neelakantam

November 17, 2017
Tweet

More Decks by Srushtika Neelakantam

Other Decks in Technology

Transcript

  1. • IoT, FTW. • Bulk dump. • No deepstream? No

    problem! • Fan of CGI languages? - We got you covered.
  2. HTTP isn’t realtime. Hence: Receive a Pub/Sub event Get record

    updates for Data-Sync Presence Subscribe Anything else that requires persistent connections. x x x x
  3. with deepstream.io localhost://8080/auth with deepstreamHub <HTTP AUTH URL> No Auth

    File Auth Webhook Auth No Auth Token Auth Email Auth Webhook Auth
  4. POST requests: • Emit an event. • Read a record.

    • Create and update a record. • Delete a record. • Make an RPC. • Query presence.
  5. reading a record { "topic": "record", "action": "read", "recordName": "my-record"

    } { "success": true, "version": 2, "data": { "foo": "bar" } } request response
  6. record heads { "topic": "record", "action": "head", "recordName": "my-record" }

    { "success": true, "version": 2 } request response
  7. creating and updating a record { "topic": "record", "action": "write",

    "recordName": "users/123", "path": "firstname", "version": 6, "data": "Bob" }
  8. creating and updating a record { "success": false, "error": "Record

    update failed. Version 6 exists for record \"users/123\".", "errorTopic": "record", "errorEvent": "VERSION_EXISTS", "currentVersion": 6, "currentData": { "firstname": "Alan", "lastname": "Smith" } } response
  9. making an RPC { "topic": "rpc", "action": "make", "rpcName": "add-two",

    "data": { "numA": 2, "numB": 5 } } { "success": true, "data": 7 } request response