Browse Source

add curl test url

Outsider 10 years ago
parent
commit
0fa86c7fb5
2 changed files with 23 additions and 9 deletions
  1. 18 9
      README.md
  2. 5 0
      config.js

+ 18 - 9
README.md

@@ -15,20 +15,29 @@ fill out `config.js` as your infomation.
 * `slackUrl` : your slack team url (ex: socketio.slack.com)
 * `slacktoken` : access token of slack.
   You can generate it in <https://api.slack.com/web#auth>
+
+  You can test your token via curl:
+
+  ```shell
+   curl -X POST 'https://YOUR-SLACK-TEAM.slack.com/api/users.admin.invite' \
+   --data 'email=EMAIL&channels=CHANNEL_ID&token=TOKEN&set_active=true' \
+   --compressed
+  ```
+
 * `channels` : channels to join when the user is invited.(Array)
   You can find id of channels in your slack.(look at sidebar on the left)
 
   channel list's HTML looks like:
 
-    ```html
-    <li class="channel_C024R4462 channel ">
-      <a class="channel_name" data-channel-id="C024R4462">
-        <span class="unread_just_C024R4462 unread_just hidden">0</span>
-        <span class="unread_highlight_C024R4462 unread_highlight hidden">0</span>
-        <span class="overflow-ellipsis"><span class="prefix">#</span>codeport</span>
-      </a>
-    </li>
-    ```
+  ```html
+  <li class="channel_C024R4462 channel ">
+    <a class="channel_name" data-channel-id="C024R4462">
+      <span class="unread_just_C024R4462 unread_just hidden">0</span>
+      <span class="unread_highlight_C024R4462 unread_highlight hidden">0</span>
+      <span class="overflow-ellipsis"><span class="prefix">#</span>codeport</span>
+    </a>
+  </li>
+  ```
 
   the value of `data-channel-id` is channel id.(`C024R44` in above example)
 

+ 5 - 0
config.js

@@ -5,6 +5,11 @@ module.exports = {
   slackUrl: 'YOUR-TEAM.slack.com',
   // access token of slack
   // You can generate it in https://api.slack.com/web#auth
+  //
+  // You can test your token via curl:
+  //   curl -X POST 'https://YOUR-SLACK-TEAM.slack.com/api/users.admin.invite' \
+  //   --data 'email=EMAIL&channels=CHANNEL_ID&token=TOKEN&set_active=true' \
+  //   --compressed
   slacktoken: 'YOUR-ACCESS-TOKEN',
   // channels to join when the user is invited.(Array of channel-id)
   // You can find id of channels in your slack.(look at sidebar on the left)