endpoints.json 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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.10.0",
  6. "swaggerVersion": "1.1",
  7. "basePath": "http://localhost:8088/ari",
  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": 400,
  68. "reason": "Invalid parameters for sending a message."
  69. },
  70. {
  71. "code": 404,
  72. "reason": "Endpoint not found"
  73. }
  74. ]
  75. }
  76. ]
  77. },
  78. {
  79. "path": "/endpoints/{tech}",
  80. "description": "Asterisk endpoints",
  81. "operations": [
  82. {
  83. "httpMethod": "GET",
  84. "summary": "List available endoints for a given endpoint technology.",
  85. "nickname": "listByTech",
  86. "responseClass": "List[Endpoint]",
  87. "parameters": [
  88. {
  89. "name": "tech",
  90. "description": "Technology of the endpoints (sip,iax2,...)",
  91. "paramType": "path",
  92. "dataType": "string"
  93. }
  94. ],
  95. "errorResponses": [
  96. {
  97. "code": 404,
  98. "reason": "Endpoints not found"
  99. }
  100. ]
  101. }
  102. ]
  103. },
  104. {
  105. "path": "/endpoints/{tech}/{resource}",
  106. "description": "Single endpoint",
  107. "operations": [
  108. {
  109. "httpMethod": "GET",
  110. "summary": "Details for an endpoint.",
  111. "nickname": "get",
  112. "responseClass": "Endpoint",
  113. "parameters": [
  114. {
  115. "name": "tech",
  116. "description": "Technology of the endpoint",
  117. "paramType": "path",
  118. "dataType": "string"
  119. },
  120. {
  121. "name": "resource",
  122. "description": "ID of the endpoint",
  123. "paramType": "path",
  124. "dataType": "string"
  125. }
  126. ],
  127. "errorResponses": [
  128. {
  129. "code": 400,
  130. "reason": "Invalid parameters for sending a message."
  131. },
  132. {
  133. "code": 404,
  134. "reason": "Endpoints not found"
  135. }
  136. ]
  137. }
  138. ]
  139. },
  140. {
  141. "path": "/endpoints/{tech}/{resource}/sendMessage",
  142. "description": "Send a message to some endpoint in a technology.",
  143. "operations": [
  144. {
  145. "httpMethod": "PUT",
  146. "summary": "Send a message to some endpoint in a technology.",
  147. "nickname": "sendMessageToEndpoint",
  148. "responseClass": "void",
  149. "parameters": [
  150. {
  151. "name": "tech",
  152. "description": "Technology of the endpoint",
  153. "paramType": "path",
  154. "dataType": "string"
  155. },
  156. {
  157. "name": "resource",
  158. "description": "ID of the endpoint",
  159. "paramType": "path",
  160. "dataType": "string"
  161. },
  162. {
  163. "name": "from",
  164. "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.",
  165. "paramType": "query",
  166. "required": true,
  167. "allowMultiple": false,
  168. "dataType": "string"
  169. },
  170. {
  171. "name": "body",
  172. "description": "The body of the message",
  173. "paramType": "query",
  174. "required": false,
  175. "allowMultiple": false,
  176. "dataType": "string"
  177. },
  178. {
  179. "name": "variables",
  180. "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,",
  181. "paramType": "body",
  182. "required": false,
  183. "dataType": "containers",
  184. "allowMultiple": false
  185. }
  186. ],
  187. "errorResponses": [
  188. {
  189. "code": 400,
  190. "reason": "Invalid parameters for sending a message."
  191. },
  192. {
  193. "code": 404,
  194. "reason": "Endpoint not found"
  195. }
  196. ]
  197. }
  198. ]
  199. }
  200. ],
  201. "models": {
  202. "Endpoint": {
  203. "id": "Endpoint",
  204. "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.",
  205. "properties": {
  206. "technology": {
  207. "type": "string",
  208. "description": "Technology of the endpoint",
  209. "required": true
  210. },
  211. "resource": {
  212. "type": "string",
  213. "description": "Identifier of the endpoint, specific to the given technology.",
  214. "required": true
  215. },
  216. "state": {
  217. "type": "string",
  218. "description": "Endpoint's state",
  219. "required": false,
  220. "allowableValues": {
  221. "valueType": "LIST",
  222. "values": [
  223. "unknown",
  224. "offline",
  225. "online"
  226. ]
  227. }
  228. },
  229. "channel_ids": {
  230. "type": "List[string]",
  231. "description": "Id's of channels associated with this endpoint",
  232. "required": true
  233. }
  234. }
  235. },
  236. "TextMessageVariable": {
  237. "id": "TextMessageVariable",
  238. "description": "A key/value pair variable in a text message.",
  239. "properties": {
  240. "key": {
  241. "type": "string",
  242. "description": "A unique key identifying the variable.",
  243. "required": true
  244. },
  245. "value": {
  246. "type": "string",
  247. "description": "The value of the variable.",
  248. "required": true
  249. }
  250. }
  251. },
  252. "TextMessage": {
  253. "id": "TextMessage",
  254. "description": "A text message.",
  255. "properties": {
  256. "from": {
  257. "type": "string",
  258. "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.",
  259. "required": true
  260. },
  261. "to": {
  262. "type": "string",
  263. "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.",
  264. "required": true
  265. },
  266. "body": {
  267. "type": "string",
  268. "description": "The text of the message.",
  269. "required": true
  270. },
  271. "variables": {
  272. "type": "List[TextMessageVariable]",
  273. "description": "Technology specific key/value pairs associated with the message.",
  274. "required": false
  275. }
  276. }
  277. }
  278. }
  279. }