Code Monkey home page Code Monkey logo

sprinkle-bulk-add-users's Introduction

Sprinkle: Bulk Add Users to Chatrooms for Symphony

A very simple javascript script that will help you bulk add users in your Symphony pod into chatrooms.

Requirements

  • Your own pod
  • API Agent Library installed either on the cloud or on-premise
  • A Service Account for the Bot that can be created in your pod's Admin Portal
  • Security Certificates for Bot Authentication, with one of the certificate upload to the Admin Portal^
  • Symphony REST API Documentation Access @ https://developers.symphony.com
  • NodeJS/NPM installed. This is only tested to work on v6.9.1
  • Email addresses of the users you want to add into chatrooms
  • The chatroom ID (streamId) that you want to add users into
  • A REST API client such as Postman to make API requests

^ (certificates should be obtained from your internal PKI infrastructure, or refer to Certificate Generator for Windows PDF Instructions for more information)

Instructions

  1. Run npm install to install all the node modules dependencies.

  2. Place your .pem and .p12 certificates in the /certs folder

  3. In the config.js file, fill in your own pod and agent API library endpoints (POD_URL, SESSION_ENDPOINT)

  4. In the same config.js file, fill in the filepath to the appropriate certificate and certificate key as well as the certificate passphrase (CERT_FILE_PATH, CERT_KEY_FILE_PATH, CERT_PASSPHRASE)

  5. You may now run npm start. This runs the server that can be accessed on localhost:4000

  6. The script will attempt to authenticate to your pod to obtain both the pod session token.

  7. Create the chatroom(s) that you want to bulk add users to if not yet done so. Obtain the streamId of the chatroom by clicking on a read receipt for a message in that chatroom.

  8. Create a .txt file with the streamId of the chatroom in the first line, and the email addresses of the users you want to add to the stream in separate lines following the first line. An example is included in this repository in bulk_add_users.txt

  9. Using a REST API client such as Postman, make a GET request to localhost:4000/addMemberWithEmailToStream/:nameOfTxtFile where :nameOfTextFile should be the name of your .txt file in Step 7. For example, localhost:4000/addMemberWithEmailToStream/bulk_add_users

Credits

Sprinkle: Bulk Add Users to Chatrooms for Symphony is created by Jeff Lam Tian Hung. It can be used and modified freely, with no expectation of any support whatsoever.

Contributing

  1. Fork it (https://github.com/symphonyoss/sprinkle-bulk-add-users/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Read our contribution guidelines and Community Code of Conduct
  4. Commit your changes (git commit -am 'Add some fooBar')
  5. Push to the branch (git push origin feature/fooBar)
  6. Create a new Pull Request

License

The code in this repository is distributed under the Apache License, Version 2.0.

Copyright 2019 Symphony LLC

sprinkle-bulk-add-users's People

Contributors

jefflam avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.