Árvore de páginas

CONTEÚDO

  1. Visão Geral
  2. Serviços Disponíveis
  3. Exemplo de utilização
    1. GET
  4. Assuntos Relacionados

01. VISÃO GERAL

Para clientes que possuem rotinas ou aplicativos customizados e precisam consultar as informações na rotina Consulta Rateio de Múltiplas Naturezas(FINA040RT), foram disponibilizados métodos Web Service REST.

02. SERVIÇOS DISPONÍVEIS

GET
Consulta

POST
Inclusão

PUT
Alteração
DELETE
Exclusão
(seleção)(erro)(erro)(erro)

03. EXEMPLO DE UTILIZAÇÃO

Para realizar testes, pode ser utilizado qualquer programa de sua preferência, que teste API Web Service REST.

Como exemplos de programas, podemos citar o SoapUI ou Postman . Ambos são excelentes aplicativos.

Os exemplo a seguir serão demonstrados utilizando programa Postman, executando os métodos GET, POST, PUT e DELETE.

Para inclusão ou alteração do registro, pode utilizar a mesma estrutura (body), os campos podem ser adicionados dentro da tag FIELDS.
Maiores detalhes referente a montagem da estrutura, verificar modelo abaixo.

Onde:

id: é id da API

operation: é o código da operação, valor padrão: 1,

pk: é a chave primária do alias do modelo de dados encodado em base64,

models: são os modelos de negócios de cada API, ou seja, modelo de dados do MVC, que é definido por:

id: é o modelo de dados definido no MVC

modeltype: é tipo de modelo de dados, "FIELDS" ou "GRID"

                     fields: é um vetor com os campos, definido por: 

id: é nome do campo

order: ordem do campo na tabela SBE

value: é o valor do campo


Importante

Por padrão, para realizar consulta, alteração ou deleção de um determinado dado do servidor através dos métodos GET, PUT ou DELETE, é necessário informar a PK (Primary Key), valor da chave primaria do alias do modelo, encodado em base64, caso contrário não informado, serão retornado os registros conforme sua paginação.


a. GET

Retorno - Modelo Estrutura 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 PADRAO"
                },
                {
                    "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
                        }
                    ],
                    "items": [
                        {
                            "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
                                        }
                                    ],
                                    "items": [
                                        {
                                            "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
                                        }
                                    ],
                                    "items": [
                                        {
                                            "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 recebido s/ Titulo"
                                                },
                                                {
                                                    "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. ASSUNTOS RELACIONADOS

FWRestModel - API RESTful dos modelos de dados do Protheus

Integração do Easy Import Control via API REST