123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- {
- "swagger": "2.0",
- "info": {
- "description": "API REST para Flowdat Base.",
- "version": "1.0.0",
- "title": "Base Flowdat"
- },
- "host": "flowdatHost",
- "basePath": "/api",
- "schemes": [
- "https"
- ],
- "paths": {
- "/tenancies.json": {
- "get": {
- "tags": [
- "Tenancy"
- ],
- "summary": "Lista las tenencias",
- "operationId": "getList",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "limit",
- "in": "query",
- "description": "Cantidad de registros por página.",
- "default": 20,
- "type": "integer"
- },
- {
- "name": "page",
- "in": "query",
- "description": "Número de página a buscar.",
- "default": 0,
- "type": "integer"
- }
- ],
- "responses": {
- "200": {
- "description": "Operación existosa.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Tenancy"
- }
- }
- },
- "400": {
- "description": "Valor incorrecto."
- }
- }
- }
- },
- "/tenancies/{id}.json": {
- "get": {
- "tags": [
- "Tenancy"
- ],
- "summary": "Obtiene los datos de la tenencia",
- "operationId": "getById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "Id de la tenencia.",
- "required": true,
- "type": "integer"
- }
- ],
- "responses": {
- "200": {
- "description": "Operación existosa.",
- "schema": {
- "$ref": "#/definitions/Tenancy"
- }
- },
- "400": {
- "description": "Valor incorrecto."
- }
- }
- }
- },
- "/clients.json": {
- "get": {
- "tags": [
- "Client"
- ],
- "summary": "Encuentra Clientes por Id, externalID, nombre, companía, email, dirección, estado o tenencia.",
- "operationId": "getList",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "filters[id]",
- "in": "query",
- "description": "Id del cliente.",
- "required": false,
- "type": "integer"
- },
- {
- "name": "filters[name]",
- "in": "query",
- "description": "Nombre del cliente.",
- "required": false,
- "type": "string"
- },
- {
- "name": "filters[externalId]",
- "in": "query",
- "description": "ExternalID del cliente.",
- "required": false,
- "type": "string"
- },
- {
- "name": "filters[company]",
- "in": "query",
- "description": "Companía del cliente.",
- "required": false,
- "type": "string"
- },
- {
- "name": "filters[address]",
- "in": "query",
- "description": "Dirección del cliente.",
- "required": false,
- "type": "string"
- },
- {
- "name": "filters[email]",
- "in": "query",
- "description": "Email del cliente.",
- "required": false,
- "type": "string"
- },
- {
- "name": "filters[currentState]",
- "in": "query",
- "description": "Estado del cliente.",
- "required": false,
- "type": "string",
- "enum": [
- "active",
- "suspend"
- ]
- },
- {
- "name": "filters[tenancyId]",
- "in": "query",
- "description": "Id de la tenencia donde se encuentra cargado el cliente. Por defecto se utiliza la tenencia base.",
- "required": false,
- "type": "integer",
- "default": 2
- },
- {
- "name": "filters[qb-criteria]",
- "in": "query",
- "description": "Criteria = 1 > Permite filtrar por parte del nombre al momento de buscar por este campo.",
- "required": false,
- "type": "integer",
- "default": 1
- },
- {
- "name": "limit",
- "in": "query",
- "description": "Cantidad de registros por página.",
- "default": 20,
- "type": "integer"
- },
- {
- "name": "page",
- "in": "query",
- "description": "Número de página a buscar.",
- "default": 0,
- "type": "integer"
- }
- ],
- "responses": {
- "200": {
- "description": "Operación existosa.",
- "schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Client"
- }
- }
- },
- "400": {
- "description": "Valor incorrecto."
- }
- }
- },
- "post": {
- "tags": [
- "Client"
- ],
- "summary": "Crear Cliente",
- "description": "Creación de un cliente. Dentro del objeto tenency solo se debe pasar el id.",
- "operationId": "create",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "body",
- "name": "body",
- "description": "Crea un cliente a partir del objeto.",
- "required": true,
- "schema": {
- "$ref": "#/definitions/ClientCRUD"
- }
- }
- ],
- "responses": {
- "default": {
- "description": "Operación exitosa."
- }
- }
- }
- },
- "/clients/{id}.json": {
- "put": {
- "tags": [
- "Client"
- ],
- "summary": "Actualiza un cliente.",
- "description": "Modificación de un cliente. Dentro del objeto tenency solo se debe pasar el id.",
- "operationId": "update",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "Ingresar el Id del cliente que va a editar.",
- "type": "string",
- "required": true
- },
- {
- "in": "body",
- "name": "body",
- "description": "Objeto cliente que necesita ser modificado.",
- "required": true,
- "schema": {
- "$ref": "#/definitions/ClientCRUD"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Operación exitosa."
- },
- "400": {
- "description": "Se produjo un error al ejecutar la acción."
- },
- "404": {
- "description": "Cliente no encontrado."
- },
- "405": {
- "description": "Validation exception."
- }
- }
- },
- "delete": {
- "tags": [
- "Client"
- ],
- "summary": "Eliminar Cliente",
- "description": "Elimina un cliente. Dentro del objeto tenency solo se debe pasar el id.",
- "operationId": "delete",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "Id del cliente que necesita eliminar.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "Operación exitosa."
- },
- "400": {
- "description": "Cliente no válido."
- },
- "404": {
- "description": "Cliente no encontrado."
- }
- }
- },
- "get": {
- "tags": [
- "Client"
- ],
- "summary": "Obtener Clientes por Id",
- "description": "",
- "operationId": "getById",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "Id del cliente a consultar.",
- "required": true,
- "type": "string"
- }
- ],
- "responses": {
- "200": {
- "description": "Operación exitosa.",
- "schema": {
- "$ref": "#/definitions/Client"
- }
- },
- "400": {
- "description": "Id de cliente inválido."
- },
- "404": {
- "description": "Cliente no encontrado."
- }
- }
- }
- },
- "/clients/{id}/apply/{workflow}/{transition}": {
- "get": {
- "tags": [
- "Client"
- ],
- "summary": "Aplicar acción sobre Cliente.",
- "description": "",
- "operationId": "apply",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "Id del Cliente",
- "required": true,
- "type": "integer"
- },
- {
- "name": "workflow",
- "in": "path",
- "description": "Workflow del cliente",
- "required": true,
- "type": "string",
- "enum": [
- "administrative_state"
- ]
- },
- {
- "name": "transition",
- "in": "path",
- "description": "Acción del Workflow",
- "required": true,
- "type": "string",
- "enum": [
- "suspend_to_active",
- "active_to_suspend",
- "active_to_pre_notice",
- "pre_notice_to_suspend",
- "delete"
- ]
- }
- ],
- "responses": {
- "200": {
- "description": "Operación exitosa.",
- "schema": {
- "$ref": "#/definitions/Client"
- }
- },
- "400": {
- "description": "Alguno de los datos no es correcto. Verifique el id, workflow o acción."
- },
- "404": {
- "description": "Error al aplicar la transición."
- }
- }
- }
- }
- },
- "security": [
- {
- "basicAuth": []
- }
- ],
- "securityDefinitions": {
- "basicAuth": {
- "type": "basic"
- }
- },
- "definitions": {
- "Client": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "Id del cliente."
- },
- "externalId": {
- "type": "string",
- "description": "Permite identificar un cliente en un sistema externo."
- },
- "name": {
- "type": "string",
- "description": "Nombre del cliente."
- },
- "address": {
- "type": "string",
- "description": "Dirección del cliente."
- },
- "company": {
- "type": "string",
- "description": "Compañia del cliente."
- },
- "email": {
- "type": "string",
- "description": "Email del cliente."
- },
- "phoneNumber": {
- "type": "string",
- "description": "Teléfono del cliente."
- },
- "currentState": {
- "type": "string",
- "enum": [
- "active",
- "suspend"
- ],
- "description": "Estado del cliente al momento de crearlo."
- },
- "tenancy": {
- "$ref": "#/definitions/Tenancy"
- }
- },
- "xml": {
- "name": "Client"
- }
- },
- "ClientCRUD": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "Id del cliente."
- },
- "externalId": {
- "type": "string",
- "description": "Permite identificar un cliente en un sistema externo."
- },
- "name": {
- "type": "string",
- "description": "Nombre del cliente."
- },
- "address": {
- "type": "string",
- "description": "Dirección del cliente."
- },
- "company": {
- "type": "string",
- "description": "Compañia del cliente."
- },
- "email": {
- "type": "string",
- "description": "Email del cliente."
- },
- "phoneNumber": {
- "type": "string",
- "description": "Teléfono del cliente."
- },
- "currentState": {
- "type": "string",
- "enum": [
- "active",
- "suspend"
- ],
- "description": "Estado del cliente al momento de crearlo."
- },
- "tenancy": {
- "type": "integer",
- "description": "Id de tenencia del cliente.",
- "default": 2
- }
- },
- "xml": {
- "name": "Client"
- }
- },
- "Tenancy": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "Id de la tenencia.",
- "default": 2
- },
- "name": {
- "type": "string",
- "description": "Nombre de la tenencia."
- },
- "enabled": {
- "type": "string",
- "description": "Me dice si la tenencia esta activa."
- }
- },
- "xml": {
- "name": "Tenancy"
- }
- }
- }
- }
|