-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
120 lines (89 loc) · 2.69 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# OrizonHub
See also: https://github.com/gumblex/orizonhub
## Group Messenging
### General Settings [/settings]
#### Get Current Setting [GET]
+ Headers
X-APIKey: <Your_API_KEY>
+ Response 200 (application/json)
+ Attributes (object)
+ id (number, required) - Bot ID
+ name (string, required) - Bot name
+ type (enum[string], required) - Bot type
+ Members
+ `protocol_bridge`
+ `public_service`
+ `logger`
+ admin (string, required) - userID of bot admin
+ hooks (array) - what message should the bot get
+ scope (array) - permissions of api request
+ mode (enum[string]) - bot mode
+ Members
+ `online`
+ `offline`
+ `maintenance`
+ Body
{
"id": 0,
"name": "Tox",
"type": "protocol_bridge",
"admin": "tox: quininer",
"hooks": ["protocol.all.message"],
"scope": ["userdb.get", "userdb.put"],
"mode": "online"
}
#### Update Settings [POST]
+ Headers
X-APIKey: <Your_API_KEY>
+ Request (application/json)
{
"id": 0,
"name": "Tox",
"type": "protocol_bridge",
"admin": "tox: quininer",
"hooks": ["protocol.all.message"],
"scope": ["userdb.get", "userdb.put"],
"mode": "online"
}
+ Response 200 (application/json)
{
"result": 200
}
### Universal GET [/getUpdates?offset={offset}&timeout={timeout}]
#### Get Message [GET]
+ Headers
X-APIKey: <Your_API_KEY>
+ Parameters
+ offset: 15 (number) ... Polling Offset
+ timeout: 15 (number) ... Polling time(sec)
+ Response 200 (application/json)
{
"type": "net_message",
"message_id": 0,
"user": "<USERID>",
"content": "<CONTENT>"
"reply_to": <message_id_optional>
}
### Messenging across networks [/message/all]
#### Post Message [POST]
+ Request (application/json)
+ Headers
X-APIKey: <Your_API_KEY>
+ Body
{
"user": "<USERID>",
"message": "<message_content>",
"reply_to": <message_id>
}
+ Response 200 (application/json)
{
"result": 200,
"message": {
"type": "net_message",
"message_id": 0,
"user": "<USERID>",
"content": "<CONTENT>"
}
}