-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,392 additions
and
1,238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ | |
/.idea | ||
.lein-* | ||
pom.xml | ||
|
||
/datomic* | ||
/data | ||
/voices | ||
.nrepl-* | ||
*~ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,86 @@ Start a back channeling. | |
|
||
The default port is 3009. | ||
|
||
## API | ||
|
||
When you signup, select a type of bot account. | ||
You must remember the authorization code. | ||
|
||
![Imgur](http://i.imgur.com/diJJjhT.png) | ||
|
||
First, you get token by authorization code. | ||
|
||
``` | ||
POST /api/token | ||
code=[authorization code] | ||
``` | ||
|
||
You will get a response as follows: | ||
|
||
``` | ||
{"access_token": , "name": "bot", "email": "[email protected]"} | ||
``` | ||
|
||
You must add the token to HTTP headers when you request to BackChanneling web APIs. | ||
|
||
``` | ||
curl -H 'Accept: application/json' -H 'Authorization: Token xxxxxxxxxxxxxxxx' [API url] | ||
``` | ||
|
||
And if you send a POST request, Add `Content-Type` to the request header. | ||
|
||
``` | ||
curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'Authorization: Token xxxxxxxxxxxxxxxx' [API url] | ||
``` | ||
|
||
### Board | ||
|
||
Get a board data. | ||
|
||
``` | ||
GET /api/board/:board-name | ||
``` | ||
|
||
An example of response as follows: | ||
|
||
``` | ||
{ | ||
"id":17592186045424, | ||
"name":"default", | ||
"description":"Default board", | ||
"threads":[ | ||
{"id":17592186045428, | ||
"title":"aaa", | ||
"since":"20150722T101724.515Z", | ||
"last-updated":"20150722T110108.015Z", | ||
"resnum":1000,"watchers":[]}, | ||
{"id":17592186045651,"title":"hohoho", | ||
"since":"20150722T104559.129Z", | ||
"last-updated":"20150929T123754.988Z", | ||
"watchers":["bot2"],"resnum":1000} | ||
] | ||
} | ||
``` | ||
|
||
### Thread | ||
|
||
``` | ||
GET /api/thread/:thread-id | ||
``` | ||
|
||
### New thread | ||
|
||
``` | ||
POST /api/board/:board-name/threads | ||
{"thread/name": "New thread", "comment/content": "Hello"} | ||
``` | ||
|
||
### Post comment | ||
|
||
``` | ||
POST /api/thread/:thread-id/comments | ||
{"comment/content": "Hello"} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0 | ||
0.2.0-beta1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.