This package has been deprecated

Author message:

WARNING: We renamed this module to @webex/webex-server. Please install it instead. See https://github.com/webex/spark-js-sdk#the-cisco-webex-js-sdk for more information.

@webex/sparkd

1.32.1 • Public • Published

@webex/sparkd

standard-readme compliant

HTTP frontend to the Cisco Webex JS SDK

Why would we put an http server in front of our SDK? Encryption is hard and this lets all of our client test suites (potentially written in languages for which we do not have sdks) do encrypted things without a major time expenditure

Install

  npm install -g @webex/sparkd

Usage

Start the daemon

sparkd

Create a session (make sure to copy your set cookie header)

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"clientId":"<your client id>","clientSecret":"<your client secret>","redirectUri":"<your  redirect_uri>","scope":"<your scopes>"}' \
  http://localhost:3000/api/v1/session

(optional) Create a conversation

SDK: spark.internal.conversation.create({comment: 'first comment', displayName: 'title', participants: ['', '', '']})

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Cookie: <connect.sid cookie from step one>" \
  -d '[{"comment":"first message","displayName":"title","participants":["userId1","userId2","userId3"]}]'
  -v \
  http://localhost:3000/api/v1/session/invoke/internal/conversation/create

(optional) Post a message

SDK: spark.inernal.conversation.post({url: '<conversation url>', {displayName: 'second comment'}})

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Cookie: <connect.sid cookie from step one>" \
  -d [{"url":"<conversation url>"},{"displayName":"second comment"}]
  -v \
  http://localhost:3000/api/v1/session/invoke/internal/conversation/post

(optional) Fetch a conversation

SDK: spark.internal.conversation.get({url: '<conversation url>'}) SDK: spark.internal.conversation.get({url: '<conversation url>'})

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Cookie: <connect.sid cookie from step one>" \
  -d [{"url":"<conversation url>"}]
  -v \
  http://localhost:3000/api/v1/session/invoke/internal/conversation/get

Clean up your session (If you don't do this, you'll have a bunch of long-running web socket connections)

curl -X DELETE \
  -H "Content-Type: application/json" \
  -H "Cookie: <connect.sid cookie from step one>" \
  -v \
  http://localhost:3000/api/v1/session

Maintainers

This package is maintained by Cisco Webex for Developers.

Contribute

Pull requests welcome. Please see CONTRIBUTING.md for more details.

License

© 2016-2018 Cisco and/or its affiliates. All Rights Reserved.

Dependencies (33)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @webex/sparkd

    Weekly Downloads

    0

    Version

    1.32.1

    License

    MIT

    Unpacked Size

    63.2 kB

    Total Files

    19

    Last publish

    Collaborators