https://github.com/maxchehab/user-sync-api
https://github.com/maxchehab/user-sync-api
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/maxchehab/user-sync-api
- Owner: maxchehab
- Created: 2019-04-17T04:21:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-17T18:58:21.000Z (about 6 years ago)
- Last Synced: 2025-01-30T21:57:07.603Z (3 months ago)
- Language: Go
- Size: 167 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# user-sync-api
This api syncs a workspace's Slack directory while making use of Slack's web api and webhooks.## Getting started
```bash
cd $GOPATH/src && git clone https://github.com/maxchehab/user-sync-api.git && cd user-sync-api
govendor sync
```## `secrets.env`
At this point you will want to create your `secrets.env` file. This file is placed at the **root** of the project. It's contents are structured like so...
```bash
# secrets.env
export DATABASE_URL=postgres://xxxxxxx:xxxxx@xxxxx:5432/xxxxxxxx
export botToken=xoxb-xxxxxxx-xxxx-xxxxxx
export token=xxxxxxxxxx
export PORT=8080
export apiKey=xxxxxx
```
`botToken` is the `Bot User OAuth Access Token` generated by Slack.`token` is the `Verification Token` generated by Slack.
`apiKey` is an unique string you create for the api to be accessed from a client.
## Running
After you have created `secrets.env` you can procede to run the api.```bash
source secrets.env
make
```## Webhook
This api offers a webhook endpoint for Slack's event monitoring. It accepts `team_join` and `user_change` event types.
This endpoint is available at `/`.## Users api
A single endpoint `/users` is available to access the list of synced users. All requests must be authenticated using the generated `apiKey` specified in `secrets.env`.
An example request would look like: `https://usersync-max.herokuapp.com/users?apikey=xxxxxxxx`. This is a `GET` request.