ÍNDICE

  1. Visión general
  2. Servicios disponibles
  3. Ejemplo de utilización
    1. GET
  4. Asuntos relacionados

01. VISIÓN GENERAL

Para clientes que tienen rutinas o aplicaciones personalizadas y necesitan consultar las informaciones en la rutina Consulta prorrateo de múltiples modalidades(FINA040RT), se pusieron a disposición métodos Web Service REST.

02. SERVICIOS DISPONIBLES

GET
Consulta

POST
Inclusión

PUT
Modificación
DELETE
Borrado
(seleção)(erro)(erro)(erro)

03. EJEMPLO DE UTILIZACIÓN

Para realizar pruebas, puede utilizarse cualquier programa de su preferencia, que pruebe API Web Service REST.

Como ejemplos de programas, podemos citar el SoapUI o Postman . Ambas son excelentes aplicaciones.

Los siguientes ejemplos se mostrarán utilizando el programa Postman, ejecutando los métodos GET, POST, PUT y DELETE.

Para inclusión o modificación del registro, puede utilizar la misma estructura (body), los campos pueden incluirse dentro de la tag FIELDS.
Para más detalles referentes al montaje de la estructura, vea el siguiente modelo.

Donde:

id: es la id de la API

operation: es el código de la operación, valor estándar: 1,

pk: es la clave primaria del alias del modelo de datos codificado en base64,

models: son los modelos de negocio de cada API, es decir, modelo de datos de MVC, que está definido por:

id: es el modelo de datos definido en MVC

modeltype: es tipo de modelo de datos, "FIELDS" o "GRID"

                     fields: es un vector con los campos, definido por: 

id: es el nombre del campo

order: orden del campo en la tabla SBE

value: es el valor del campo


Importante

Por estándar, para realizar una consulta, modificación o borrado de un determinado dato del servidor por medio de los métodos GET, PUT o DELETE, es necesario informar la PK (Primary Key), valor de la clave primaria del alias del modelo, codificado en base64, en caso contrario no informado, se devolverán los registros de acuerdo con su paginación.


a. GET

Devolución - Modelo estructura GET 
{
    "id": "FINA040RT",
    "operation": 1,
    "pk": "RCBNRyAwMSBEIE1HIDAxIEZJTkZJTjAwMDM5NCBEUCAwMDAwMDEwMQ==",
    "models": [
        {
            "id": "SE1MASTER",
            "modeltype": "FIELDS",
            "fields": [
                {
                    "id": "E1_FILIAL",
                    "order": 1,
                    "value": "D MG 01"
                },
                {
                    "id": "E1_PREFIXO",
                    "order": 2,
                    "value": "FIN"
                },
                {
                    "id": "E1_NUM",
                    "order": 3,
                    "value": "FIN000394"
                },
                {
                    "id": "E1_TIPO",
                    "order": 5,
                    "value": "DP"
                },
                {
                    "id": "E1_NATUREZ",
                    "order": 6,
                    "value": "000001"
                },
                {
                    "id": "E1_CLIENTE",
                    "order": 9,
                    "value": "000001"
                },
                {
                    "id": "E1_LOJA",
                    "order": 10,
                    "value": "01"
                },
                {
                    "id": "E1_NOMCLI",
                    "order": 11,
                    "value": "CLIENTE ESTÁNDAR"
                },
                {
                    "id": "E1_EMISSAO",
                    "order": 12,
                    "value": "20220602"
                },
                {
                    "id": "E1_VENCTO",
                    "order": 13,
                    "value": "20220602"
                },
                {
                    "id": "E1_VENCREA",
                    "order": 14,
                    "value": "20220602"
                },
                {
                    "id": "E1_VALOR",
                    "order": 15,
                    "value": "140.00"
                },
                {
                    "id": "E1_BAIXA",
                    "order": 21,
                    "value": "20220602"
                },
                {
                    "id": "E1_EMIS1",
                    "order": 24,
                    "value": "20220602"
                },
                {
                    "id": "E1_MOVIMEN",
                    "order": 29,
                    "value": "20220602"
                },
                {
                    "id": "E1_SITUACA",
                    "order": 31,
                    "value": "0"
                },
                {
                    "id": "E1_MOEDA",
                    "order": 48,
                    "value": "1"
                },
                {
                    "id": "E1_VLCRUZ",
                    "order": 62,
                    "value": "140.00"
                },
                {
                    "id": "E1_STATUS",
                    "order": 64,
                    "value": "B"
                },
                {
                    "id": "E1_ORIGEM",
                    "order": 65,
                    "value": "FINA040"
                },
                {
                    "id": "E1_FLUXO",
                    "order": 68,
                    "value": "S"
                },
                {
                    "id": "E1_TIPODES",
                    "order": 71,
                    "value": "1"
                },
                {
                    "id": "E1_FILORIG",
                    "order": 85,
                    "value": "D MG 01"
                },
                {
                    "id": "E1_MULTNAT",
                    "order": 101,
                    "value": "1"
                },
                {
                    "id": "E1_PROJPMS",
                    "order": 102,
                    "value": "2"
                },
                {
                    "id": "E1_DESDOBR",
                    "order": 103,
                    "value": "2"
                },
                {
                    "id": "E1_MODSPB",
                    "order": 105,
                    "value": "1"
                },
                {
                    "id": "E1_SCORGP",
                    "order": 146,
                    "value": "2"
                },
                {
                    "id": "E1_RELATO",
                    "order": 177,
                    "value": "2"
                },
                {
                    "id": "E1_APLVLMN",
                    "order": 187,
                    "value": "1"
                },
                {
                    "id": "E1_VLMINIS",
                    "order": 196,
                    "value": "1"
                },
                {
                    "id": "E1_TPDESC",
                    "order": 200,
                    "value": "C"
                },
                {
                    "id": "E1_RATFIN",
                    "order": 201,
                    "value": "2"
                },
                {
                    "id": "E1_TCONHTL",
                    "order": 219,
                    "value": "3"
                },
                {
                    "id": "E1_MSUIDT",
                    "order": 231,
                    "value": "5226BBE5-237A-ED11-9236-005056ACF625"
                }
            ],
            "models": [
                {
                    "id": "FK7DETAIL",
                    "modeltype": "GRID",
                    "optional": 1,
                    "struct": [
                        {
                            "id": "FK7_FILIAL",
                            "order": 1
                        },
                        {
                            "id": "FK7_IDDOC",
                            "order": 2
                        },
                        {
                            "id": "FK7_ALIAS",
                            "order": 3
                        },
                        {
                            "id": "FK7_CHAVE",
                            "order": 4
                        },
                        {
                            "id": "FK7_FILTIT",
                            "order": 5
                        },
                        {
                            "id": "FK7_PREFIX",
                            "order": 6
                        },
                        {
                            "id": "FK7_NUM",
                            "order": 7
                        },
                        {
                            "id": "FK7_PARCEL",
                            "order": 8
                        },
                        {
                            "id": "FK7_TIPO",
                            "order": 9
                        },
                        {
                            "id": "FK7_CLIFOR",
                            "order": 10
                        }
                    ],
                    "ítems": [
                        {
                            "id": 1,
                            "deleted": 0,
                            "fields": [
                                {
                                    "id": "FK7_FILIAL",
                                    "value": "D MG 01"
                                },
                                {
                                    "id": "FK7_IDDOC",
                                    "value": "c414f400935347328D259b8f77e45dbc"
                                },
                                {
                                    "id": "FK7_ALIAS",
                                    "value": "SE1"
                                },
                                {
                                    "id": "FK7_CHAVE",
                                    "value": "D MG 01 |FIN|FIN000394| |DP |000001|01"
                                },
                                {
                                    "id": "FK7_FILTIT",
                                    "value": "D MG 01"
                                },
                                {
                                    "id": "FK7_PREFIX",
                                    "value": "FIN"
                                },
                                {
                                    "id": "FK7_NUM",
                                    "value": "FIN000394"
                                },
                                {
                                    "id": "FK7_TIPO",
                                    "value": "DP"
                                },
                                {
                                    "id": "FK7_CLIFOR",
                                    "value": "000001"
                                }
                            ],
                            "models": [
                                {
                                    "id": "SEVDETAIL",
                                    "modeltype": "GRID",
                                    "optional": 1,
                                    "struct": [
                                        {
                                            "id": "EV_FILIAL",
                                            "order": 1
                                        },
                                        {
                                            "id": "EV_PARCELA",
                                            "order": 2
                                        },
                                        {
                                            "id": "EV_CLIFOR",
                                            "order": 3
                                        },
                                        {
                                            "id": "EV_LOJA",
                                            "order": 4
                                        },
                                        {
                                            "id": "EV_VALOR",
                                            "order": 5
                                        },
                                        {
                                            "id": "EV_NATUREZ",
                                            "order": 6
                                        },
                                        {
                                            "id": "EV_PERC",
                                            "order": 7
                                        },
                                        {
                                            "id": "EV_LA",
                                            "order": 8
                                        },
                                        {
                                            "id": "EV_RATEICC",
                                            "order": 9
                                        },
                                        {
                                            "id": "EV_IDENT",
                                            "order": 10
                                        },
                                        {
                                            "id": "EV_SEQ",
                                            "order": 11
                                        },
                                        {
                                            "id": "EV_IDDOC",
                                            "order": 12
                                        },
                                        {
                                            "id": "EV_PORCENT",
                                            "order": 13
                                        }
                                    ],
                                    "ítems": [
                                        {
                                            "id": 1,
                                            "deleted": 0,
                                            "fields": [
                                                {
                                                    "id": "EV_FILIAL",
                                                    "value": "D MG 01"
                                                },
                                                {
                                                    "id": "EV_CLIFOR",
                                                    "value": "000001"
                                                },
                                                {
                                                    "id": "EV_LOJA",
                                                    "value": "01"
                                                },
                                                {
                                                    "id": "EV_VALOR",
                                                    "value": "70.00"
                                                },
                                                {
                                                    "id": "EV_NATUREZ",
                                                    "value": "0000000001"
                                                },
                                                {
                                                    "id": "EV_PERC",
                                                    "value": "0.5000000"
                                                },
                                                {
                                                    "id": "EV_RATEICC",
                                                    "value": "2"
                                                },
                                                {
                                                    "id": "EV_IDENT",
                                                    "value": "1"
                                                },
                                                {
                                                    "id": "EV_IDDOC",
                                                    "value": "c414f400935347328D259b8f77e45dbc"
                                                },
                                                {
                                                    "id": "EV_PORCENT",
                                                    "value": "0"
                                                }
                                            ],
                                            "models": [
                                                {
                                                    "id": "SEZDETAIL",
                                                    "modeltype": "GRID",
                                                    "optional": 1,
                                                    "struct": [
                                                        {
                                                            "id": "EZ_FILIAL",
                                                            "order": 1
                                                        },
                                                        {
                                                            "id": "EZ_VALOR",
                                                            "order": 2
                                                        },
                                                        {
                                                            "id": "EZ_CCUSTO",
                                                            "order": 3
                                                        },
                                                        {
                                                            "id": "EZ_PERC",
                                                            "order": 4
                                                        },
                                                        {
                                                            "id": "EZ_ITEMCTA",
                                                            "order": 5
                                                        },
                                                        {
                                                            "id": "EZ_CLVL",
                                                            "order": 6
                                                        },
                                                        {
                                                            "id": "EZ_SEQ",
                                                            "order": 7
                                                        },
                                                        {
                                                            "id": "EZ_CONTA",
                                                            "order": 8
                                                        },
                                                        {
                                                            "id": "EZ_EC05DB",
                                                            "order": 9
                                                        },
                                                        {
                                                            "id": "EZ_EC05CR",
                                                            "order": 10
                                                        },
                                                        {
                                                            "id": "EZ_EC06DB",
                                                            "order": 11
                                                        },
                                                        {
                                                            "id": "EZ_EC06CR",
                                                            "order": 12
                                                        },
                                                        {
                                                            "id": "EZ_IDDOC",
                                                            "order": 13
                                                        },
                                                        {
                                                            "id": "EZ_EC07DB",
                                                            "order": 14
                                                        },
                                                        {
                                                            "id": "EZ_EC07CR",
                                                            "order": 15
                                                        },
                                                        {
                                                            "id": "EZ_EC08DB",
                                                            "order": 16
                                                        },
                                                        {
                                                            "id": "EZ_EC08CR",
                                                            "order": 17
                                                        },
                                                        {
                                                            "id": "EZ_EC09DB",
                                                            "order": 18
                                                        },
                                                        {
                                                            "id": "EZ_EC09CR",
                                                            "order": 19
                                                        },
                                                        {
                                                            "id": "EZ_PORCENT",
                                                            "order": 20
                                                        },
                                                        {
                                                            "id": "EZ_MSUIDT",
                                                            "order": 21
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        {
                                            "id": 2,
                                            "deleted": 0,
                                            "fields": [
                                                {
                                                    "id": "EV_FILIAL",
                                                    "value": "D MG 01"
                                                },
                                                {
                                                    "id": "EV_CLIFOR",
                                                    "value": "000001"
                                                },
                                                {
                                                    "id": "EV_LOJA",
                                                    "value": "01"
                                                },
                                                {
                                                    "id": "EV_VALOR",
                                                    "value": "70.00"
                                                },
                                                {
                                                    "id": "EV_NATUREZ",
                                                    "value": "0000000002"
                                                },
                                                {
                                                    "id": "EV_PERC",
                                                    "value": "0.5000000"
                                                },
                                                {
                                                    "id": "EV_RATEICC",
                                                    "value": "2"
                                                },
                                                {
                                                    "id": "EV_IDENT",
                                                    "value": "1"
                                                },
                                                {
                                                    "id": "EV_IDDOC",
                                                    "value": "c414f400935347328D259b8f77e45dbc"
                                                },
                                                {
                                                    "id": "EV_PORCENT",
                                                    "value": "0"
                                                }
                                            ],
                                            "models": [
                                                {
                                                    "id": "SEZDETAIL",
                                                    "modeltype": "GRID",
                                                    "optional": 1,
                                                    "struct": [
                                                        {
                                                            "id": "EZ_FILIAL",
                                                            "order": 1
                                                        },
                                                        {
                                                            "id": "EZ_VALOR",
                                                            "order": 2
                                                        },
                                                        {
                                                            "id": "EZ_CCUSTO",
                                                            "order": 3
                                                        },
                                                        {
                                                            "id": "EZ_PERC",
                                                            "order": 4
                                                        },
                                                        {
                                                            "id": "EZ_ITEMCTA",
                                                            "order": 5
                                                        },
                                                        {
                                                            "id": "EZ_CLVL",
                                                            "order": 6
                                                        },
                                                        {
                                                            "id": "EZ_SEQ",
                                                            "order": 7
                                                        },
                                                        {
                                                            "id": "EZ_CONTA",
                                                            "order": 8
                                                        },
                                                        {
                                                            "id": "EZ_EC05DB",
                                                            "order": 9
                                                        },
                                                        {
                                                            "id": "EZ_EC05CR",
                                                            "order": 10
                                                        },
                                                        {
                                                            "id": "EZ_EC06DB",
                                                            "order": 11
                                                        },
                                                        {
                                                            "id": "EZ_EC06CR",
                                                            "order": 12
                                                        },
                                                        {
                                                            "id": "EZ_IDDOC",
                                                            "order": 13
                                                        },
                                                        {
                                                            "id": "EZ_EC07DB",
                                                            "order": 14
                                                        },
                                                        {
                                                            "id": "EZ_EC07CR",
                                                            "order": 15
                                                        },
                                                        {
                                                            "id": "EZ_EC08DB",
                                                            "order": 16
                                                        },
                                                        {
                                                            "id": "EZ_EC08CR",
                                                            "order": 17
                                                        },
                                                        {
                                                            "id": "EZ_EC09DB",
                                                            "order": 18
                                                        },
                                                        {
                                                            "id": "EZ_EC09CR",
                                                            "order": 19
                                                        },
                                                        {
                                                            "id": "EZ_PORCENT",
                                                            "order": 20
                                                        },
                                                        {
                                                            "id": "EZ_MSUIDT",
                                                            "order": 21
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "id": "FK1DETAIL",
                                    "modeltype": "GRID",
                                    "optional": 1,
                                    "struct": [
                                        {
                                            "id": "FK1_FILIAL",
                                            "order": 1
                                        },
                                        {
                                            "id": "FK1_IDFK1",
                                            "order": 2
                                        },
                                        {
                                            "id": "FK1_DATA",
                                            "order": 3
                                        },
                                        {
                                            "id": "FK1_VALOR",
                                            "order": 4
                                        },
                                        {
                                            "id": "FK1_MOEDA",
                                            "order": 5
                                        },
                                        {
                                            "id": "FK1_NATURE",
                                            "order": 6
                                        },
                                        {
                                            "id": "FK1_VENCTO",
                                            "order": 7
                                        },
                                        {
                                            "id": "FK1_RECPAG",
                                            "order": 8
                                        },
                                        {
                                            "id": "FK1_TPDOC",
                                            "order": 9
                                        },
                                        {
                                            "id": "FK1_HISTOR",
                                            "order": 10
                                        },
                                        {
                                            "id": "FK1_VLMOE2",
                                            "order": 11
                                        },
                                        {
                                            "id": "FK1_LOTE",
                                            "order": 12
                                        },
                                        {
                                            "id": "FK1_MOTBX",
                                            "order": 13
                                        },
                                        {
                                            "id": "FK1_ORDREC",
                                            "order": 14
                                        },
                                        {
                                            "id": "FK1_FILORI",
                                            "order": 15
                                        },
                                        {
                                            "id": "FK1_ARCNAB",
                                            "order": 16
                                        },
                                        {
                                            "id": "FK1_CNABOC",
                                            "order": 17
                                        },
                                        {
                                            "id": "FK1_TXMOED",
                                            "order": 18
                                        },
                                        {
                                            "id": "FK1_SITCOB",
                                            "order": 19
                                        },
                                        {
                                            "id": "FK1_SERREC",
                                            "order": 20
                                        },
                                        {
                                            "id": "FK1_MULNAT",
                                            "order": 21
                                        },
                                        {
                                            "id": "FK1_AUTBCO",
                                            "order": 22
                                        },
                                        {
                                            "id": "FK1_CCUSTO",
                                            "order": 23
                                        },
                                        {
                                            "id": "FK1_ORIGEM",
                                            "order": 24
                                        },
                                        {
                                            "id": "FK1_SEQ",
                                            "order": 25
                                        },
                                        {
                                            "id": "FK1_DIACTB",
                                            "order": 26
                                        },
                                        {
                                            "id": "FK1_NODIA",
                                            "order": 27
                                        },
                                        {
                                            "id": "FK1_LA",
                                            "order": 28
                                        },
                                        {
                                            "id": "FK1_IDDOC",
                                            "order": 29
                                        },
                                        {
                                            "id": "FK1_DOC",
                                            "order": 30
                                        },
                                        {
                                            "id": "FK1_IDCOMP",
                                            "order": 31
                                        },
                                        {
                                            "id": "FK1_IDPROC",
                                            "order": 32
                                        },
                                        {
                                            "id": "FK1_DTDISP",
                                            "order": 33
                                        },
                                        {
                                            "id": "FK1_DTDIGI",
                                            "order": 34
                                        },
                                        {
                                            "id": "FK1_NUMBOR",
                                            "order": 35
                                        }
                                    ],
                                    "ítems": [
                                        {
                                            "id": 1,
                                            "deleted": 0,
                                            "fields": [
                                                {
                                                    "id": "FK1_FILIAL",
                                                    "value": "D MG 01"
                                                },
                                                {
                                                    "id": "FK1_IDFK1",
                                                    "value": "def213ca6c54471081650310f40f91a0"
                                                },
                                                {
                                                    "id": "FK1_DATA",
                                                    "value": "20220602"
                                                },
                                                {
                                                    "id": "FK1_VALOR",
                                                    "value": "140.00"
                                                },
                                                {
                                                    "id": "FK1_MOEDA",
                                                    "value": "01"
                                                },
                                                {
                                                    "id": "FK1_NATURE",
                                                    "value": "000001"
                                                },
                                                {
                                                    "id": "FK1_VENCTO",
                                                    "value": "20220602"
                                                },
                                                {
                                                    "id": "FK1_RECPAG",
                                                    "value": "R"
                                                },
                                                {
                                                    "id": "FK1_TPDOC",
                                                    "value": "VL"
                                                },
                                                {
                                                    "id": "FK1_HISTOR",
                                                    "value": "Valor cobrado s/ Título"
                                                },
                                                {
                                                    "id": "FK1_VLMOE2",
                                                    "value": "140.00"
                                                },
                                                {
                                                    "id": "FK1_MOTBX",
                                                    "value": "NOR"
                                                },
                                                {
                                                    "id": "FK1_FILORI",
                                                    "value": "D MG 01"
                                                },
                                                {
                                                    "id": "FK1_TXMOED",
                                                    "value": "1.0000"
                                                },
                                                {
                                                    "id": "FK1_SITCOB",
                                                    "value": "0"
                                                },
                                                {
                                                    "id": "FK1_MULNAT",
                                                    "value": "2"
                                                },
                                                {
                                                    "id": "FK1_ORIGEM",
                                                    "value": "FINA070"
                                                },
                                                {
                                                    "id": "FK1_SEQ",
                                                    "value": "01"
                                                },
                                                {
                                                    "id": "FK1_LA",
                                                    "value": "N"
                                                },
                                                {
                                                    "id": "FK1_IDDOC",
                                                    "value": "c414f400935347328D259b8f77e45dbc"
                                                },
                                                {
                                                    "id": "FK1_DTDISP",
                                                    "value": "20220602"
                                                },
                                                {
                                                    "id": "FK1_DTDIGI",
                                                    "value": "20220602"
                                                }
                                            ],
                                            "models": [
                                                {
                                                    "id": "SEV1DETAIL",
                                                    "modeltype": "GRID",
                                                    "optional": 1,
                                                    "struct": [
                                                        {
                                                            "id": "EV_FILIAL",
                                                            "order": 1
                                                        },
                                                        {
                                                            "id": "EV_PARCELA",
                                                            "order": 2
                                                        },
                                                        {
                                                            "id": "EV_CLIFOR",
                                                            "order": 3
                                                        },
                                                        {
                                                            "id": "EV_LOJA",
                                                            "order": 4
                                                        },
                                                        {
                                                            "id": "EV_VALOR",
                                                            "order": 5
                                                        },
                                                        {
                                                            "id": "EV_NATUREZ",
                                                            "order": 6
                                                        },
                                                        {
                                                            "id": "EV_PERC",
                                                            "order": 7
                                                        },
                                                        {
                                                            "id": "EV_LA",
                                                            "order": 8
                                                        },
                                                        {
                                                            "id": "EV_RATEICC",
                                                            "order": 9
                                                        },
                                                        {
                                                            "id": "EV_IDENT",
                                                            "order": 10
                                                        },
                                                        {
                                                            "id": "EV_SEQ",
                                                            "order": 11
                                                        },
                                                        {
                                                            "id": "EV_IDDOC",
                                                            "order": 12
                                                        },
                                                        {
                                                            "id": "EV_PORCENT",
                                                            "order": 13
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}


04. ASUNTOS RELACIONADOS

FWRestModel - API RESTful de los modelos de datos del Protheus

Integración del Easy Import Control vía API REST