https://github.com/eyedea-io/syncano-socket-slack
Syncano Socket for integration with Slack
https://github.com/eyedea-io/syncano-socket-slack
serverless slack syncano syncano-socket
Last synced: 10 months ago
JSON representation
Syncano Socket for integration with Slack
- Host: GitHub
- URL: https://github.com/eyedea-io/syncano-socket-slack
- Owner: eyedea-io
- License: mit
- Created: 2016-09-19T08:55:24.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-05T14:55:17.000Z (about 2 years ago)
- Last Synced: 2025-03-17T22:52:52.059Z (10 months ago)
- Topics: serverless, slack, syncano, syncano-socket
- Language: JavaScript
- Homepage: https://syncano.io
- Size: 350 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Syncano Socket for Slack
[](https://syncano.io)
[](https://circleci.com/gh/eyedea-io/syncano-socket-slack/tree/master)

[](https://standardjs.com)
[](https://www.npmjs.com/package/@eyedea-sockets/)

Main Socket features:
* **slack/invite** — handle invitations
* **slack/list** — list all Slack users
## Getting Started
Install package in your project:
```sh
cd my_project
npm install @syncano/cli --save-dev
npm install @eyedea-sockets/slack --save
npx s deploy
```
Use it:
```js
import Syncano from @syncano/client
const s = new Syncano()
// Invitation
const params = {
email: 'john@doe.com',
token: 'xoxp-17802080787-17802080963-23787252214-e634269418'
}
const invitationStatus = await s.get('slack/invite', params)
// Listing users
const params = {
token: 'xoxp-17802080787-17802080963-23787252214-e634269418'
}
const usersList = await s.get('slack/list', params)
```
## Endpoints
### slack/list
#### Input:
No input parameters.
#### Outputs:
**success** - **Operation Successful**
- Code: 200
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|-----------------------|---------------------------------------------|
| users | array | List of users | `[{"id": "1234", "username": "mkucharz"}]` |
**fail** - **Operation failed**
- Code: 400
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|------------------------|----------------------|
| message | string | Invitation failed | `Internal error.` |
### slack/invite
#### Input:
|Parameter | Type | Required | Example |
|----------|------|-----------|-----------------------|
|email |string| Yes | `john.snow@eyedea.io` |
#### Outputs:
**success** - **Operation Successful**
- Code: 200
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|-----------------------|------------------------------|
| message | string | Invitation successful | `User invited successfully!` |
**fail** - **Operation failed**
- Code: 400
- Mimetype: application/json
| Parameter | Type | Description | Example |
|-----------|--------|------------------------|-------------------------|
| message | string | Invitation failed | `User already invited!` |