AMI/ARI: Update version to 2.5.0/1.5.0 respectively
[asterisk/asterisk.git] / rest-api / api-docs / endpoints.json
1 {
2         "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3         "_author": "David M. Lee, II <dlee@digium.com>",
4         "_svn_revision": "$Revision$",
5         "apiVersion": "1.5.0",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/stasis",
8         "resourcePath": "/api-docs/endpoints.{format}",
9         "apis": [
10                 {
11                         "path": "/endpoints",
12                         "description": "Asterisk endpoints",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "summary": "List all endpoints.",
17                                         "nickname": "list",
18                                         "responseClass": "List[Endpoint]"
19                                 }
20                         ]
21                 },
22                 {
23                         "path": "/endpoints/sendMessage",
24                         "description": "Send a message to some technology URI or endpoint.",
25                         "operations": [
26                                 {
27                                         "httpMethod": "PUT",
28                                         "summary": "Send a message to some technology URI or endpoint.",
29                                         "nickname": "sendMessage",
30                                         "responseClass": "void",
31                                         "parameters": [
32                                                 {
33                                                         "name": "to",
34                                                         "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp.",
35                                                         "paramType": "query",
36                                                         "required": true,
37                                                         "allowMultiple": false,
38                                                         "dataType": "string"
39                                                 },
40                                                 {
41                                                         "name": "from",
42                                                         "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.",
43                                                         "paramType": "query",
44                                                         "required": true,
45                                                         "allowMultiple": false,
46                                                         "dataType": "string"
47                                                 },
48                                                 {
49                                                         "name": "body",
50                                                         "description": "The body of the message",
51                                                         "paramType": "query",
52                                                         "required": false,
53                                                         "allowMultiple": false,
54                                                         "dataType": "string"
55                                                 },
56                                                 {
57                                                         "name": "variables",
58                                                         "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,",
59                                                         "paramType": "body",
60                                                         "required": false,
61                                                         "dataType": "containers",
62                                                         "allowMultiple": false
63                                                 }
64                                         ],
65                                         "errorResponses": [
66                                                 {
67                                                         "code": 404,
68                                                         "reason": "Endpoint not found"
69                                                 }
70                                         ]
71                                 }
72                         ]
73                 },
74                 {
75                         "path": "/endpoints/{tech}",
76                         "description": "Asterisk endpoints",
77                         "operations": [
78                                 {
79                                         "httpMethod": "GET",
80                                         "summary": "List available endoints for a given endpoint technology.",
81                                         "nickname": "listByTech",
82                                         "responseClass": "List[Endpoint]",
83                                         "parameters": [
84                                                 {
85                                                         "name": "tech",
86                                                         "description": "Technology of the endpoints (sip,iax2,...)",
87                                                         "paramType": "path",
88                                                         "dataType": "string"
89                                                 }
90                                         ],
91                                         "errorResponses": [
92                                                 {
93                                                         "code": 404,
94                                                         "reason": "Endpoints not found"
95                                                 }
96                                         ]
97                                 }
98                         ]
99                 },
100                 {
101                         "path": "/endpoints/{tech}/{resource}",
102                         "description": "Single endpoint",
103                         "operations": [
104                                 {
105                                         "httpMethod": "GET",
106                                         "summary": "Details for an endpoint.",
107                                         "nickname": "get",
108                                         "responseClass": "Endpoint",
109                                         "parameters": [
110                                                 {
111                                                         "name": "tech",
112                                                         "description": "Technology of the endpoint",
113                                                         "paramType": "path",
114                                                         "dataType": "string"
115                                                 },
116                                                 {
117                                                         "name": "resource",
118                                                         "description": "ID of the endpoint",
119                                                         "paramType": "path",
120                                                         "dataType": "string"
121                                                 }
122                                         ],
123                                         "errorResponses": [
124                                                 {
125                                                         "code": 400,
126                                                         "reason": "Invalid parameters for sending a message."
127                                                 },
128                                                 {
129                                                         "code": 404,
130                                                         "reason": "Endpoints not found"
131                                                 }
132                                         ]
133                                 }
134                         ]
135                 },
136                 {
137                         "path": "/endpoints/{tech}/{resource}/sendMessage",
138                         "description": "Send a message to some endpoint in a technology.",
139                         "operations": [
140                                 {
141                                         "httpMethod": "PUT",
142                                         "summary": "Send a message to some endpoint in a technology.",
143                                         "nickname": "sendMessageToEndpoint",
144                                         "responseClass": "void",
145                                         "parameters": [
146                                                 {
147                                                         "name": "tech",
148                                                         "description": "Technology of the endpoint",
149                                                         "paramType": "path",
150                                                         "dataType": "string"
151                                                 },
152                                                 {
153                                                         "name": "resource",
154                                                         "description": "ID of the endpoint",
155                                                         "paramType": "path",
156                                                         "dataType": "string"
157                                                 },
158                                                 {
159                                                         "name": "from",
160                                                         "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.",
161                                                         "paramType": "query",
162                                                         "required": true,
163                                                         "allowMultiple": false,
164                                                         "dataType": "string"
165                                                 },
166                                                 {
167                                                         "name": "body",
168                                                         "description": "The body of the message",
169                                                         "paramType": "query",
170                                                         "required": false,
171                                                         "allowMultiple": false,
172                                                         "dataType": "string"
173                                                 },
174                                                 {
175                                                         "name": "variables",
176                                                         "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,",
177                                                         "paramType": "body",
178                                                         "required": false,
179                                                         "dataType": "containers",
180                                                         "allowMultiple": false
181                                                 }
182                                         ],
183                                         "errorResponses": [
184                                                 {
185                                                         "code": 400,
186                                                         "reason": "Invalid parameters for sending a message."
187                                                 },
188                                                 {
189                                                         "code": 404,
190                                                         "reason": "Endpoint not found"
191                                                 }
192                                         ]
193                                 }
194                         ]
195                 }
196         ],
197         "models": {
198                 "Endpoint": {
199                         "id": "Endpoint",
200                         "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.",
201                         "properties": {
202                                 "technology": {
203                                         "type": "string",
204                                         "description": "Technology of the endpoint",
205                                         "required": true
206                                 },
207                                 "resource": {
208                                         "type": "string",
209                                         "description": "Identifier of the endpoint, specific to the given technology.",
210                                         "required": true
211                                 },
212                                 "state": {
213                                         "type": "string",
214                                         "description": "Endpoint's state",
215                                         "required": false,
216                                         "allowableValues": {
217                                                 "valueType": "LIST",
218                                                 "values": [
219                                                         "unknown",
220                                                         "offline",
221                                                         "online"
222                                                 ]
223                                         }
224                                 },
225                                 "channel_ids": {
226                                         "type": "List[string]",
227                                         "description": "Id's of channels associated with this endpoint",
228                                         "required": true
229                                 }
230                         }
231                 },
232                 "TextMessageVariable": {
233                         "id": "TextMessageVariable",
234                         "description": "A key/value pair variable in a text message.",
235                         "properties": {
236                                 "key": {
237                                         "type": "string",
238                                         "description": "A unique key identifying the variable.",
239                                         "required": true
240                                 },
241                                 "value": {
242                                         "type": "string",
243                                         "description": "The value of the variable.",
244                                         "required": true
245                                 }
246                         }
247                 },
248                 "TextMessage": {
249                         "id": "TextMessage",
250                         "description": "A text message.",
251                         "properties": {
252                                 "from": {
253                                         "type": "string",
254                                         "description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.",
255                                         "required": true
256                                 },
257                                 "to": {
258                                         "type": "string",
259                                         "description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.",
260                                         "required": true
261                                 },
262                                 "body": {
263                                         "type": "string",
264                                         "description": "The text of the message.",
265                                         "required": true
266                                 },
267                                 "variables": {
268                                         "type": "List[TextMessageVariable]",
269                                         "description": "Technology specific key/value pairs associated with the message.",
270                                         "required": false
271                                 }
272                         }
273                 }
274         }
275 }