base.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "API REST para Flowdat Base.",
  5. "version": "1.0.0",
  6. "title": "Base Flowdat"
  7. },
  8. "host": "flowdatHost",
  9. "basePath": "/api",
  10. "schemes": [
  11. "https"
  12. ],
  13. "paths": {
  14. "/tenancies.json": {
  15. "get": {
  16. "tags": [
  17. "Tenancy"
  18. ],
  19. "summary": "Lista las tenencias",
  20. "operationId": "getList",
  21. "produces": [
  22. "application/json"
  23. ],
  24. "parameters": [
  25. {
  26. "name": "limit",
  27. "in": "query",
  28. "description": "Cantidad de registros por página.",
  29. "default": 20,
  30. "type": "integer"
  31. },
  32. {
  33. "name": "page",
  34. "in": "query",
  35. "description": "Número de página a buscar.",
  36. "default": 0,
  37. "type": "integer"
  38. }
  39. ],
  40. "responses": {
  41. "200": {
  42. "description": "Operación existosa.",
  43. "schema": {
  44. "type": "array",
  45. "items": {
  46. "$ref": "#/definitions/Tenancy"
  47. }
  48. }
  49. },
  50. "400": {
  51. "description": "Valor incorrecto."
  52. }
  53. }
  54. }
  55. },
  56. "/tenancies/{id}.json": {
  57. "get": {
  58. "tags": [
  59. "Tenancy"
  60. ],
  61. "summary": "Obtiene los datos de la tenencia",
  62. "operationId": "getById",
  63. "produces": [
  64. "application/json"
  65. ],
  66. "parameters": [
  67. {
  68. "name": "id",
  69. "in": "path",
  70. "description": "Id de la tenencia.",
  71. "required": true,
  72. "type": "integer"
  73. }
  74. ],
  75. "responses": {
  76. "200": {
  77. "description": "Operación existosa.",
  78. "schema": {
  79. "$ref": "#/definitions/Tenancy"
  80. }
  81. },
  82. "400": {
  83. "description": "Valor incorrecto."
  84. }
  85. }
  86. }
  87. },
  88. "/clients.json": {
  89. "get": {
  90. "tags": [
  91. "Client"
  92. ],
  93. "summary": "Encuentra Clientes por Id, externalID, nombre, companía, email, dirección, estado o tenencia.",
  94. "operationId": "getList",
  95. "produces": [
  96. "application/json"
  97. ],
  98. "parameters": [
  99. {
  100. "name": "filters[id]",
  101. "in": "query",
  102. "description": "Id del cliente.",
  103. "required": false,
  104. "type": "integer"
  105. },
  106. {
  107. "name": "filters[name]",
  108. "in": "query",
  109. "description": "Nombre del cliente.",
  110. "required": false,
  111. "type": "string"
  112. },
  113. {
  114. "name": "filters[externalId]",
  115. "in": "query",
  116. "description": "ExternalID del cliente.",
  117. "required": false,
  118. "type": "string"
  119. },
  120. {
  121. "name": "filters[company]",
  122. "in": "query",
  123. "description": "Companía del cliente.",
  124. "required": false,
  125. "type": "string"
  126. },
  127. {
  128. "name": "filters[address]",
  129. "in": "query",
  130. "description": "Dirección del cliente.",
  131. "required": false,
  132. "type": "string"
  133. },
  134. {
  135. "name": "filters[email]",
  136. "in": "query",
  137. "description": "Email del cliente.",
  138. "required": false,
  139. "type": "string"
  140. },
  141. {
  142. "name": "filters[currentState]",
  143. "in": "query",
  144. "description": "Estado del cliente.",
  145. "required": false,
  146. "type": "string",
  147. "enum": [
  148. "active",
  149. "suspend"
  150. ]
  151. },
  152. {
  153. "name": "filters[tenancyId]",
  154. "in": "query",
  155. "description": "Id de la tenencia donde se encuentra cargado el cliente. Por defecto se utiliza la tenencia base.",
  156. "required": false,
  157. "type": "integer",
  158. "default": 2
  159. },
  160. {
  161. "name": "filters[qb-criteria]",
  162. "in": "query",
  163. "description": "Criteria = 1 > Permite filtrar por parte del nombre al momento de buscar por este campo.",
  164. "required": false,
  165. "type": "integer",
  166. "default": 1
  167. },
  168. {
  169. "name": "limit",
  170. "in": "query",
  171. "description": "Cantidad de registros por página.",
  172. "default": 20,
  173. "type": "integer"
  174. },
  175. {
  176. "name": "page",
  177. "in": "query",
  178. "description": "Número de página a buscar.",
  179. "default": 0,
  180. "type": "integer"
  181. }
  182. ],
  183. "responses": {
  184. "200": {
  185. "description": "Operación existosa.",
  186. "schema": {
  187. "type": "array",
  188. "items": {
  189. "$ref": "#/definitions/Client"
  190. }
  191. }
  192. },
  193. "400": {
  194. "description": "Valor incorrecto."
  195. }
  196. }
  197. },
  198. "post": {
  199. "tags": [
  200. "Client"
  201. ],
  202. "summary": "Crear Cliente",
  203. "description": "Creación de un cliente. Dentro del objeto tenency solo se debe pasar el id.",
  204. "operationId": "create",
  205. "produces": [
  206. "application/json"
  207. ],
  208. "parameters": [
  209. {
  210. "in": "body",
  211. "name": "body",
  212. "description": "Crea un cliente a partir del objeto.",
  213. "required": true,
  214. "schema": {
  215. "$ref": "#/definitions/ClientCRUD"
  216. }
  217. }
  218. ],
  219. "responses": {
  220. "default": {
  221. "description": "Operación exitosa."
  222. }
  223. }
  224. }
  225. },
  226. "/clients/{id}.json": {
  227. "put": {
  228. "tags": [
  229. "Client"
  230. ],
  231. "summary": "Actualiza un cliente.",
  232. "description": "Modificación de un cliente. Dentro del objeto tenency solo se debe pasar el id.",
  233. "operationId": "update",
  234. "consumes": [
  235. "application/json"
  236. ],
  237. "produces": [
  238. "application/json"
  239. ],
  240. "parameters": [
  241. {
  242. "name": "id",
  243. "in": "path",
  244. "description": "Ingresar el Id del cliente que va a editar.",
  245. "type": "string",
  246. "required": true
  247. },
  248. {
  249. "in": "body",
  250. "name": "body",
  251. "description": "Objeto cliente que necesita ser modificado.",
  252. "required": true,
  253. "schema": {
  254. "$ref": "#/definitions/ClientCRUD"
  255. }
  256. }
  257. ],
  258. "responses": {
  259. "200": {
  260. "description": "Operación exitosa."
  261. },
  262. "400": {
  263. "description": "Se produjo un error al ejecutar la acción."
  264. },
  265. "404": {
  266. "description": "Cliente no encontrado."
  267. },
  268. "405": {
  269. "description": "Validation exception."
  270. }
  271. }
  272. },
  273. "delete": {
  274. "tags": [
  275. "Client"
  276. ],
  277. "summary": "Eliminar Cliente",
  278. "description": "Elimina un cliente. Dentro del objeto tenency solo se debe pasar el id.",
  279. "operationId": "delete",
  280. "produces": [
  281. "application/json"
  282. ],
  283. "parameters": [
  284. {
  285. "name": "id",
  286. "in": "path",
  287. "description": "Id del cliente que necesita eliminar.",
  288. "required": true,
  289. "type": "string"
  290. }
  291. ],
  292. "responses": {
  293. "200": {
  294. "description": "Operación exitosa."
  295. },
  296. "400": {
  297. "description": "Cliente no válido."
  298. },
  299. "404": {
  300. "description": "Cliente no encontrado."
  301. }
  302. }
  303. },
  304. "get": {
  305. "tags": [
  306. "Client"
  307. ],
  308. "summary": "Obtener Clientes por Id",
  309. "description": "",
  310. "operationId": "getById",
  311. "produces": [
  312. "application/json"
  313. ],
  314. "parameters": [
  315. {
  316. "name": "id",
  317. "in": "path",
  318. "description": "Id del cliente a consultar.",
  319. "required": true,
  320. "type": "string"
  321. }
  322. ],
  323. "responses": {
  324. "200": {
  325. "description": "Operación exitosa.",
  326. "schema": {
  327. "$ref": "#/definitions/Client"
  328. }
  329. },
  330. "400": {
  331. "description": "Id de cliente inválido."
  332. },
  333. "404": {
  334. "description": "Cliente no encontrado."
  335. }
  336. }
  337. }
  338. },
  339. "/clients/{id}/apply/{workflow}/{transition}": {
  340. "get": {
  341. "tags": [
  342. "Client"
  343. ],
  344. "summary": "Aplicar acción sobre Cliente.",
  345. "description": "",
  346. "operationId": "apply",
  347. "produces": [
  348. "application/json"
  349. ],
  350. "parameters": [
  351. {
  352. "name": "id",
  353. "in": "path",
  354. "description": "Id del Cliente",
  355. "required": true,
  356. "type": "integer"
  357. },
  358. {
  359. "name": "workflow",
  360. "in": "path",
  361. "description": "Workflow del cliente",
  362. "required": true,
  363. "type": "string",
  364. "enum": [
  365. "administrative_state"
  366. ]
  367. },
  368. {
  369. "name": "transition",
  370. "in": "path",
  371. "description": "Acción del Workflow",
  372. "required": true,
  373. "type": "string",
  374. "enum": [
  375. "suspend_to_active",
  376. "active_to_suspend",
  377. "active_to_pre_notice",
  378. "pre_notice_to_suspend",
  379. "delete"
  380. ]
  381. }
  382. ],
  383. "responses": {
  384. "200": {
  385. "description": "Operación exitosa.",
  386. "schema": {
  387. "$ref": "#/definitions/Client"
  388. }
  389. },
  390. "400": {
  391. "description": "Alguno de los datos no es correcto. Verifique el id, workflow o acción."
  392. },
  393. "404": {
  394. "description": "Error al aplicar la transición."
  395. }
  396. }
  397. }
  398. }
  399. },
  400. "security": [
  401. {
  402. "basicAuth": []
  403. }
  404. ],
  405. "securityDefinitions": {
  406. "basicAuth": {
  407. "type": "basic"
  408. }
  409. },
  410. "definitions": {
  411. "Client": {
  412. "type": "object",
  413. "properties": {
  414. "id": {
  415. "type": "integer",
  416. "description": "Id del cliente."
  417. },
  418. "externalId": {
  419. "type": "string",
  420. "description": "Permite identificar un cliente en un sistema externo."
  421. },
  422. "name": {
  423. "type": "string",
  424. "description": "Nombre del cliente."
  425. },
  426. "address": {
  427. "type": "string",
  428. "description": "Dirección del cliente."
  429. },
  430. "company": {
  431. "type": "string",
  432. "description": "Compañia del cliente."
  433. },
  434. "email": {
  435. "type": "string",
  436. "description": "Email del cliente."
  437. },
  438. "phoneNumber": {
  439. "type": "string",
  440. "description": "Teléfono del cliente."
  441. },
  442. "currentState": {
  443. "type": "string",
  444. "enum": [
  445. "active",
  446. "suspend"
  447. ],
  448. "description": "Estado del cliente al momento de crearlo."
  449. },
  450. "tenancy": {
  451. "$ref": "#/definitions/Tenancy"
  452. }
  453. },
  454. "xml": {
  455. "name": "Client"
  456. }
  457. },
  458. "ClientCRUD": {
  459. "type": "object",
  460. "properties": {
  461. "id": {
  462. "type": "integer",
  463. "description": "Id del cliente."
  464. },
  465. "externalId": {
  466. "type": "string",
  467. "description": "Permite identificar un cliente en un sistema externo."
  468. },
  469. "name": {
  470. "type": "string",
  471. "description": "Nombre del cliente."
  472. },
  473. "address": {
  474. "type": "string",
  475. "description": "Dirección del cliente."
  476. },
  477. "company": {
  478. "type": "string",
  479. "description": "Compañia del cliente."
  480. },
  481. "email": {
  482. "type": "string",
  483. "description": "Email del cliente."
  484. },
  485. "phoneNumber": {
  486. "type": "string",
  487. "description": "Teléfono del cliente."
  488. },
  489. "currentState": {
  490. "type": "string",
  491. "enum": [
  492. "active",
  493. "suspend"
  494. ],
  495. "description": "Estado del cliente al momento de crearlo."
  496. },
  497. "tenancy": {
  498. "type": "integer",
  499. "description": "Id de tenencia del cliente.",
  500. "default": 2
  501. }
  502. },
  503. "xml": {
  504. "name": "Client"
  505. }
  506. },
  507. "Tenancy": {
  508. "type": "object",
  509. "properties": {
  510. "id": {
  511. "type": "integer",
  512. "description": "Id de la tenencia.",
  513. "default": 2
  514. },
  515. "name": {
  516. "type": "string",
  517. "description": "Nombre de la tenencia."
  518. },
  519. "enabled": {
  520. "type": "string",
  521. "description": "Me dice si la tenencia esta activa."
  522. }
  523. },
  524. "xml": {
  525. "name": "Tenancy"
  526. }
  527. }
  528. }
  529. }