Sumário



Objetivo


Esse documento tem o objetivo de exemplificar o uso da API utilizando todos os métodos implementados.

Para mais informações sobre consumo de Licença, Veja Aqui.


1 - Métodos



Serão apresentados 4 métodos, os quais foram implementados na API de Usuários, são eles:

  • GET
  • POST
  • PUT
  • DELETE

1.1 - GET


1.1.1 - Get All (Recuperar todos os usuários)


1.1.1 GetAll

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Url Utilizada: http://localhost:8051/api/framework/v1/users

Exemplo de Resultado

Resultado (JSON)
{
    "hasNext": true,
    "items": [
        {
            "id": "00001",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00001",
            "name": {
                "formatted": "ITAMAR MENDES DA SILVEIRA"
            },
            "userName": "00001",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00001-02-98",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00001-02-98",
            "name": {
                "formatted": "ALONSO LIGORIO PINTO"
            },
            "userName": "00001-02-98",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "0000125",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "0000125",
            "name": {
                "formatted": "RUDIVAL JOSE DOS SANTOS"
            },
            "userName": "0000125",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00002",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00002",
            "name": {
                "formatted": "JOAO DA SILVA JORDAM"
            },
            "userName": "00002",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00003",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00003",
            "name": {
                "formatted": "MARIA CONCEICAO DE ASSIS"
            },
            "userName": "00003",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00004",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00004",
            "name": {
                "formatted": "ADALBERTO DE JESUS LIMA"
            },
            "userName": "00004",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00005",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00005",
            "name": {
                "formatted": "ALESSANDRA LOPES DE ABREU"
            },
            "userName": "00005",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00006",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00006",
            "name": {
                "formatted": "FERNANDO HENRIQUE VALLE KURTEN"
            },
            "userName": "00006",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00007",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00007",
            "name": {
                "formatted": "JOAQUIM FARIAS DAMASCENO"
            },
            "userName": "00007",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00008",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00008",
            "name": {
                "formatted": "ZELIA APARECIDA DA SILVA"
            },
            "userName": "00008",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00009",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00009",
            "name": {
                "formatted": "BEATRIZ MENGA"
            },
            "userName": "00009",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00010",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00010",
            "name": {
                "formatted": "ANTONIO GATES BILL"
            },
            "userName": "00010",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00011",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00011",
            "name": {
                "formatted": "MARCELO MATTAR DINIZ"
            },
            "userName": "00011",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00012",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00012",
            "name": {
                "formatted": "ANA LUIZA  DE SOUZA PRATES"
            },
            "userName": "00012",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00013",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00013",
            "name": {
                "formatted": "ALEXANDRE COTTA LEAO"
            },
            "userName": "00013",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00014",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00014",
            "name": {
                "formatted": "PEDRO DE ALCANTARA"
            },
            "userName": "00014",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00015",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00015",
            "name": {
                "formatted": "LEOPOLDO DOS SANTOS DE OLIVEIRA NETO"
            },
            "userName": "00015",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00038-02-105",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00038-02-105",
            "name": {
                "formatted": "WILMAN MAIA CABRAL"
            },
            "userName": "00038-02-105",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00039",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00039",
            "name": {
                "formatted": "ANTONIO CARLOS DE BRAGANÇA"
            },
            "userName": "00039",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00047",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00047",
            "name": {
                "formatted": "RODRIGO FIALHO BARRICHELLO"
            },
            "userName": "00047",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        }
    ]
}


1.1.2 - Order (Resultado Ordenado)

Parâmetros

Order: parâmetro responsável pela ordenação do resultado, podendo ser ascendente ou descendente. O resultado com a ordem descendente deve ser precedida do caractere "-" (menos).

Exemplo 1: ?order=campo1 (Ascendente)

Exemplo 2: ?order=-campo1 (Descendente)

Múltiplos campos de ordenação: ?order=[-]campo1, [-]campo2, [-]campo3 ...


Padrão scim:

SortBy: define o campo que será ordenado.

SortOrder: parâmetro responsável pela ordenação do resultado, podendo ser ascendente ou descendente.

Exemplo 1: ?sortBy=campo1&sortOrder=ascending (Ascendente)

Exemplo 2: ?sortBy=campo1&sortOrder=descending (Descendente)

1.1.2 Order (Asc)

Configuração

Máscara de Url: http://{domínio}:{porta}/api/glb/v1/framework?order=[-]{campo}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: active

Tipo de Ordenação: Ascendente

Url Utilizada: http://localhost:8051/api/framework/v1/users?order=active

Exemplo de Resultado

Resultado (JSON)
{
    "hasNext": true,
    "items": [
        {
            "id": "00001",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00001",
            "name": {
                "formatted": "ITAMAR MENDES DA SILVEIRA"
            },
            "userName": "00001",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00001-02-98",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00001-02-98",
            "name": {
                "formatted": "ALONSO LIGORIO PINTO"
            },
            "userName": "00001-02-98",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "0000125",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "0000125",
            "name": {
                "formatted": "RUDIVAL JOSE DOS SANTOS"
            },
            "userName": "0000125",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00002",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00002",
            "name": {
                "formatted": "JOAO DA SILVA JORDAM"
            },
            "userName": "00002",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00003",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00003",
            "name": {
                "formatted": "MARIA CONCEICAO DE ASSIS"
            },
            "userName": "00003",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00004",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00004",
            "name": {
                "formatted": "ADALBERTO DE JESUS LIMA"
            },
            "userName": "00004",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00005",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00005",
            "name": {
                "formatted": "ALESSANDRA LOPES DE ABREU"
            },
            "userName": "00005",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00006",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00006",
            "name": {
                "formatted": "FERNANDO HENRIQUE VALLE KURTEN"
            },
            "userName": "00006",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00007",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00007",
            "name": {
                "formatted": "JOAQUIM FARIAS DAMASCENO"
            },
            "userName": "00007",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00008",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00008",
            "name": {
                "formatted": "ZELIA APARECIDA DA SILVA"
            },
            "userName": "00008",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00009",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00009",
            "name": {
                "formatted": "BEATRIZ MENGA"
            },
            "userName": "00009",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00010",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00010",
            "name": {
                "formatted": "ANTONIO GATES BILL"
            },
            "userName": "00010",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00011",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00011",
            "name": {
                "formatted": "MARCELO MATTAR DINIZ"
            },
            "userName": "00011",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00012",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00012",
            "name": {
                "formatted": "ANA LUIZA  DE SOUZA PRATES"
            },
            "userName": "00012",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00013",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00013",
            "name": {
                "formatted": "ALEXANDRE COTTA LEAO"
            },
            "userName": "00013",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00014",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00014",
            "name": {
                "formatted": "PEDRO DE ALCANTARA"
            },
            "userName": "00014",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00015",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00015",
            "name": {
                "formatted": "LEOPOLDO DOS SANTOS DE OLIVEIRA NETO"
            },
            "userName": "00015",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00038-02-105",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00038-02-105",
            "name": {
                "formatted": "WILMAN MAIA CABRAL"
            },
            "userName": "00038-02-105",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00039",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00039",
            "name": {
                "formatted": "ANTONIO CARLOS DE BRAGANÇA"
            },
            "userName": "00039",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        },
        {
            "id": "00047",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00047",
            "name": {
                "formatted": "RODRIGO FIALHO BARRICHELLO"
            },
            "userName": "00047",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        }
    ]
}

1.1.2 Order (Desc)

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users?order=[-]{campo}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: active

Tipo de Ordenação: Descendente

Url Utilizada: http://localhost:8051/api/framework/v1/users?order=-active

Exemplo de Resultado

Resultado (JSON)
{
    "hasNext": true,
    "items": [
        {
            "id": "agapito",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "agapito",
            "name": {
                "formatted": "Anderson Teixeira Agapito"
            },
            "userName": "agapito",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "alan",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "alan",
            "name": {
                "formatted": "Alan de Jesus"
            },
            "userName": "alan",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Andreia Valquiria",
            "meta": {
                "resourceType": "User",
                "created": "2011-10-10T13:52:19",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Andreia Valquiria",
            "name": {
                "formatted": "Andreia Valquiria Pereira"
            },
            "userName": "Andreia Valquiria",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Aracelle",
            "meta": {
                "resourceType": "User",
                "created": "2011-03-31T15:44:57",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Aracelle",
            "name": {
                "formatted": "Aracelle Soares Ramos"
            },
            "userName": "Aracelle",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "astoni",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "astoni",
            "name": {
                "formatted": "Adriano Astoni"
            },
            "userName": "astoni",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Bartira",
            "meta": {
                "resourceType": "User",
                "created": "2011-10-10T13:53:14",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Bartira",
            "name": {
                "formatted": "Bartira Sofia Da Silva Carvalho"
            },
            "userName": "Bartira",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "carlosphilippe",
            "meta": {
                "resourceType": "User",
                "created": "2018-10-05T09:41:20",
                "lastModified": "2018-10-05T09:41:20"
            },
            "externalId": "280c4852-9222-4983-be6f-f7a275d63111",
            "name": {
                "formatted": ""
            },
            "userName": "carlosphilippe",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "cecilia",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "cecilia",
            "name": {
                "formatted": "Cecília Franco"
            },
            "userName": "cecilia",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "charles",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "charles",
            "name": {
                "formatted": "Charles Pierre"
            },
            "userName": "charles",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "cintia",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "cintia",
            "name": {
                "formatted": "Cintia Cristina de Moura"
            },
            "userName": "cintia",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "claudia",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "claudia",
            "name": {
                "formatted": "Claudia Leontina Martins"
            },
            "userName": "claudia",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Coutinho",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Coutinho",
            "name": {
                "formatted": "Rodrigo Coutinho"
            },
            "userName": "Coutinho",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "cristiano",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "cristiano",
            "name": {
                "formatted": "Cristiano Cesar Figueiredo Soares"
            },
            "userName": "cristiano",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Cristiliane",
            "meta": {
                "resourceType": "User",
                "created": "2011-10-10T13:56:01",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Cristiliane",
            "name": {
                "formatted": "Cristiliane Moreira Mariano Feitoza"
            },
            "userName": "Cristiliane",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Amanda",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Amanda",
            "name": {
                "formatted": "Amanda Miranda de Oliveira"
            },
            "userName": "Amanda",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Breno",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Breno",
            "name": {
                "formatted": "Breno José Agostinho Batista"
            },
            "userName": "Breno",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Cristina.Almeida",
            "meta": {
                "resourceType": "User",
                "created": "2011-03-31T12:39:42",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Cristina.Almeida",
            "name": {
                "formatted": "Cristina de Almeida"
            },
            "userName": "Cristina.Almeida",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Daniela",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Daniela",
            "name": {
                "formatted": "Daniela Silvia Pereira"
            },
            "userName": "Daniela",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Davi",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Davi",
            "name": {
                "formatted": "Davi Leles"
            },
            "userName": "Davi",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        },
        {
            "id": "Denise",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "Denise",
            "name": {
                "formatted": "Denise Gentiluomo Diniz"
            },
            "userName": "Denise",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        }
    ]
}

1.1.3 - Filter (Resultado filtrado)


1.1.3 Filter

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users?{campo}={valor}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: userName

Valor: carlosphilippe

Url Utilizada: http://localhost:8051/api/framework/v1/users?userName=carlosphilippe

Exemplo de Resultado

Resultado (JSON)
{
    "hasNext": false,
    "items": [
        {
            "id": "carlosphilippe",
            "meta": {
                "resourceType": "User",
                "created": "2018-10-05T09:41:20",
                "lastModified": "2018-10-05T09:41:20"
            },
            "externalId": "280c4852-9222-4983-be6f-f7a275d63111",
            "name": {
                "formatted": ""
            },
            "userName": "carlosphilippe",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": true
        }
    ]
}

1.1.4 - Paginação


Parâmetros

Page: Página que será apresentada.

PageSize: Quantidade máxima de registros por página que serão apresentados.

Exemplo: ?page=valor1&pageSize=1

Valores padrão: Caso não sejam preenchidos os parâmetros evidenciados acima serão preenchidos com valores padrão.

Page: 1

PageSize: 20


Padrão scim:

StartIndex: valor inicial do índice do registro que será retornado.

Count: quantidade máxima de registros que serão apresentados.

Exemplo 1: ?startIndex=7&count=8

1.1.4 Paginacao

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users?page={valor1}&pageSize={valor2}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Valor1: 1

Valor2: 1

Url Utilizada: http://localhost:8051/api/framework/v1/users?page=1&pageSize=1

Exemplo de Resultado

Resultado (JSON)
{
    "hasNext": true,
    "items": [
        {
            "id": "00001",
            "meta": {
                "resourceType": "User",
                "created": "2014-07-07T15:32:15",
                "lastModified": "2018-10-05T09:34:53"
            },
            "externalId": "00001",
            "name": {
                "formatted": "ITAMAR MENDES DA SILVEIRA"
            },
            "userName": "00001",
            "emails": [
                {
                    "value": "[email protected]",
                    "primary": true
                }
            ],
            "active": false
        }
    ]
}

1.1.5 - Fields (Retorno de campos específicos no resultado)


Parâmetros

Fields: parâmetro responsável pela especialização de campos em um resultado, ou seja, o usuário define quais campos serão apresentados no resultado.

Exemplo: ?fields=campo1

Múltiplos campos de ordenação: ?fields=campo1, campo2, campo3 ...


Padrão scim:

Attributes: define quais campos serão apresentados no resultado.

Exemplo 1: ?attributes=campo1

Múltiplos campos de ordenação: ?fields=campo1, campo2, campo3 ...



Obs.: Ainda não é possível utilizar campos complexos no filtro de Fields. Por exemplo: ?fields=name.givenName não irá funcionar.

Entretando, é possível utilizar ?fields=name, onde as 3 propriedades serão retornadas (givenName, familyName e formattedName)

1.1.5 Fields

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users?fields={campo}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Campo: userName

Url Utilizada: http://localhost:8051/api/framework/v1/users?fields=userName

Exemplo de Resultado

Resultado (JSON)
{
    "hasNext": true,
    "items": [
        {
            "userName": "00001"
        },
        {
            "userName": "00001-02-98"
        },
        {
            "userName": "0000125"
        },
        {
            "userName": "00002"
        },
        {
            "userName": "00003"
        },
        {
            "userName": "00004"
        },
        {
            "userName": "00005"
        },
        {
            "userName": "00006"
        },
        {
            "userName": "00007"
        },
        {
            "userName": "00008"
        },
        {
            "userName": "00009"
        },
        {
            "userName": "00010"
        },
        {
            "userName": "00011"
        },
        {
            "userName": "00012"
        },
        {
            "userName": "00013"
        },
        {
            "userName": "00014"
        },
        {
            "userName": "00015"
        },
        {
            "userName": "00038-02-105"
        },
        {
            "userName": "00039"
        },
        {
            "userName": "00047"
        }
    ]
}

1.1.6 - GetOne (Recuperar usuário pelo Identificador)


Parâmetros

Expand: Parâmetro opcional, usado para determinar a(s) propriedade(s) expandables que devem ser retornadas expandidas.

Exemplo: ?expand=roles - Nesse exemplo, os perfis associados ao usuário serão retornados na resposta da requisição.

Valores padrão: Caso não sejam preenchidos todas as propriedades expandables serão retornadas sem serem expandidas.


Padrão scim:

O padrão scim não adota o expandable. Por isso, ao adotar esse padrão, para retornar um registro com todas as propriedades expandables expandidas, é necessário utilizar uma propriedade do padrão scim (sortBy/sortOrder ou startIndex/count).

Exemplos: /api/glb/v1/users/id?sortBy=campo1&sortOrder=descending - O retorno dessa chamada exibirá todas as propriedades expandidas.

1.1.6 GetOne



Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users/{id}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Id: 00001

Url Utilizada: http://localhost:8051/api/framework/v1/users/00001

Resultado (JSON)
{
    "_expandables": [
        "roles"
    ],
    "id": "00001",
    "meta": {
        "resourceType": "User",
        "created": "2014-07-07T15:32:15",
        "lastModified": "2018-10-04T17:02:10"
    },
    "externalId": "82cca8a8-9198-4508-95c3-a0a40dc34fa2",
    "name": {
        "formatted": "ITAMAR",
        "givenName": "ITAMAR"
    },
    "userName": "00001",
    "emails": [
        {
            "value": "[email protected]",
            "primary": true
        }
    ],
    "active": true
}

1.1.6 GetOne expandable



Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users/{id}?expand={campo}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Id: 00001

Url Utilizada: http://localhost:8051/api/framework/v1/users/00001?expand=roles

Resultado (JSON)
{
    "_expandables": [
        "roles"
    ],
    "id": "00001",
    "meta": {
        "resourceType": "User",
        "created": "2014-07-07T15:32:15",
        "lastModified": "2018-10-04T17:02:10"
    },
    "externalId": "82cca8a8-9198-4508-95c3-a0a40dc34fa2",
    "name": {
        "formatted": "ITAMAR",
        "givenName": "ITAMAR"
    },
    "userName": "00001",
    "emails": [
        {
            "value": "[email protected]",
            "primary": true
        }
    ],
    "active": true,
    "roles": [
        {
            "company": "1",
            "value": "DBA Custo"
        },
        {
            "company": "1",
            "value": "_eq_1EquipeNet_A"
        },
        {
            "company": "1",
            "value": "_me_1FeriasNet_A"
        },
        {
            "company": "1",
            "value": "DBA_A"
        },
        {
            "company": "12",
            "value": "DBA_G"
        }
    ]
}

1.2 - POST


1.2.1 - Post (Inserir um usuário)


1.2.1 Post

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users

Exemplo de Configuração

Domínio: localhost

Porta: 8099

Url Utilizada: http://localhost:8051/api/framework/v1/users

Exemplo de Entrada

Resultado (JSON)
{
  "id": "testeapiusuario",
  "meta": {
    "resourceType": "User",
    "created": "2018-09-21T16:49:57.336Z",
    "lastModified": "2018-09-21T16:49:57.336Z"
  },
  "externalId": "0001e",
  "name": {
    "givenName": "TesteAPI",
    "familyName": "Usuário"
  },
  "userName": "testeapiusuario",
  "phoneNumbers": [
    {
      "value": "31974964158"
    }
  ],
  "emails": [
    {
      "value": "[email protected]",
      "type": "string",
      "primary": true
    }
  ],
  "active": true,
  "groups": [
    {
      "value": "01",
      "display": "geral"
    }
  ],
  "title": "Mr",
  "manager": [
    {
      "managerId": "01",
      "displayName": "Geral"
    }
  ]
}

Exemplo de Resultado Positivo

Resultado (JSON)
{
    "id": "testeapiusuario",
    "meta": {
        "resourceType": "User",
        "created": "2018-09-21T16:49:57.336Z",
        "lastModified": "2018-09-21T16:49:57.336Z"
    },
    "externalId": "0001e",
    "name": {
        "givenName": "TesteAPI",
        "familyName": "Usuário"
    },
    "userName": "testeapiusuario",
    "phoneNumbers": [
        {
            "value": "31974964158"
        }
    ],
    "emails": [
        {
            "value": "[email protected]",
            "type": "string",
            "primary": true
        }
    ],
    "active": true,
    "groups": [
        {
            "value": "01",
            "display": "geral"
        }
    ],
    "title": "Mr",
    "manager": [
        {
            "managerId": "01",
            "displayName": "Geral"
        }
    ]
}

Exemplo de Resultado Negativo

Resultado (JSON)
{
    "Code": "RMSDbKeyException",
    "Message": "Chave duplicada\r\n\r\nPossíveis causas:\r\n  - inclusão de registro cujo valor da chave primária já existe\r\n  - inclusão de registro cujo valor do índice único já existe",
    "DetailMessage": "   em RM.Lib.Data.DbServices.UpdateTable(DataTable table, UpdateMode mode, Boolean logOperation, String userName, Int32 batchSize) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Data\\RMSData.cs:linha 897\r\n   em RM.Lib.Data.DbServices.UpdateTable(DataTable table, UpdateMode mode, String userName, Int32 batchSize) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Data\\RMSData.cs:linha 865\r\n   em RM.Lib.Data.DbServices.QueryUpdate(DataSet dataSet, String tableName, String codUsuario) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Data\\RMSData.cs:linha 3429\r\n   em RM.Lib.Data.DbServices.QueryUpdate(DataSet dataSet, String tableName) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Data\\RMSData.cs:linha 3423\r\n   em RM.Glb.Seguranca.GlbUsuarioData.DoSaveRecord(DataSet dataSet, Int32& rowsAffected, Object ownerData) na C:\\RM\\Atual\\Release\\Glb-Globais\\RM.Glb.Seguranca.Data\\GlbUsuarioData.cs:linha 473\r\n   em RM.Lib.Server.RMSDataServer.InternalSaveRecord(RMSContext context, DataSet& dataSet, Object ownerData, Boolean skipSecurity, Boolean skipSecurityCollumns) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\RMSDataServer.cs:linha 1477\r\n   em RM.Lib.Server.RMSDataServer.SaveRecord(RMSContext context, DataSet& dataSet, Object ownerData) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\RMSDataServer.cs:linha 651\r\n   em RM.Glb.Api.UserControllerServer.Save(String id, User record) na C:\\RM\\Atual\\Release\\Glb-Globais\\RM.Glb.Api\\UserController.Server.cs:linha 336\r\n   em RM.Glb.Api.UserControllerServer.OnPost(User record) na C:\\RM\\Atual\\Release\\Glb-Globais\\RM.Glb.Api\\UserController.Server.cs:linha 269\r\n   em RM.Lib.Server.RMSCrudServer`1.Post(T record) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\Api\\RMSCrudServer.cs:linha 80\r\n   em RM.Lib.Api.RMSCrudController`1.OnPost(T record) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Api\\Controllers\\RMSCrudController.cs:linha 135\r\n   em RM.Lib.Api.RMSCrudController`1.Post(T record) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Api\\Controllers\\RMSCrudController.cs:linha 125\r\n   em lambda_method(Closure , Object , Object[] )\r\n   em System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   em System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   em RM.Lib.Api.Server.ApiAuthenticationFilter.ResultWithChallenge.<ExecuteAsync>d__2.MoveNext() na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Api.Server\\Filters\\Api.AuthenticationFilter.cs:linha 193\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()",
    "HelpUrl": null,
    "Details": [
        {
            "Code": "Exception",
            "Message": "Violation of PRIMARY KEY constraint 'PKGUSUARIO'. Cannot insert duplicate key in object 'dbo.GUSUARIO'. The duplicate key value is (testeapiusuario).\r\nThe statement has been terminated.",
            "DetailMessage": null,
            "HelpUrl": null,
            "Details": [
                {
                    "Code": "Exception",
                    "Message": "INSERT INTO [GUSUARIO] ([CODUSUARIO], [NOME], [STATUS], [DATAINICIO], [IGNORARAUTENTICACAOLDAP], [DATAEXPIRACAO], [CONFIRMABTNOK], [SENHA], [CONTROLE], [ULTIMACOLIGADA], [CODACESSO], [DTAEXPSENHA], [DIASEXPSENHA], [OBRIGAALTERARSENHA], [NUMLOGININVALIDO], [DATALOGININVALIDO], [EMAIL], [ACESSONET], [INTERNO1], [DATAULTIMOACESSO], [CODUSUARIOREDE], [DOMINIOREDE], [DATAULTIMOACESSOVALIDO], [USUARIOTWITTER], [SENHATWITTER], [USUARIOFACEBOOK], [SENHAFACEBOOK], [USUARIOLINKEDIN], [SENHALINKEDIN], [USERIDFLUIGIDENTITY], [NOMESOCIAL], [USERID], [RECCREATEDBY], [RECCREATEDON], [RECMODIFIEDBY], [RECMODIFIEDON]) VALUES ('testeapiusuario', null, 1, '08/10/2018 00:00:00', 'F', null, 1, 'jcmaAAAA', -17702, , 'Acesso01', null, , 'T', , null, '[email protected]', 'F', null, null, null, null, null, null, '\\FEz\\1B\\7F1\\18\\B7\\27', null, '\\FEz\\1B\\7F1\\18\\B7\\27', null, '\\FEz\\1B\\7F1\\18\\B7\\27', null, null, '9b69c210-8d20-45b6-afae-534ce10fd4b7', 'mestre', CONVERT ( DATETIME, CONVERT ( VARCHAR, GETDATE(), 120) ), 'mestre', CONVERT ( DATETIME, CONVERT ( VARCHAR, GETDATE(), 120) ))",
                    "DetailMessage": null,
                    "HelpUrl": null,
                    "Details": null
                }
            ]
        },
        {
            "Code": "Exception",
            "Message": "INSERT INTO [GUSUARIO] ([CODUSUARIO], [NOME], [STATUS], [DATAINICIO], [IGNORARAUTENTICACAOLDAP], [DATAEXPIRACAO], [CONFIRMABTNOK], [SENHA], [CONTROLE], [ULTIMACOLIGADA], [CODACESSO], [DTAEXPSENHA], [DIASEXPSENHA], [OBRIGAALTERARSENHA], [NUMLOGININVALIDO], [DATALOGININVALIDO], [EMAIL], [ACESSONET], [INTERNO1], [DATAULTIMOACESSO], [CODUSUARIOREDE], [DOMINIOREDE], [DATAULTIMOACESSOVALIDO], [USUARIOTWITTER], [SENHATWITTER], [USUARIOFACEBOOK], [SENHAFACEBOOK], [USUARIOLINKEDIN], [SENHALINKEDIN], [USERIDFLUIGIDENTITY], [NOMESOCIAL], [USERID], [RECCREATEDBY], [RECCREATEDON], [RECMODIFIEDBY], [RECMODIFIEDON]) VALUES ('testeapiusuario', null, 1, '08/10/2018 00:00:00', 'F', null, 1, 'jcmaAAAA', -17702, , 'Acesso01', null, , 'T', , null, '[email protected]', 'F', null, null, null, null, null, null, '\\FEz\\1B\\7F1\\18\\B7\\27', null, '\\FEz\\1B\\7F1\\18\\B7\\27', null, '\\FEz\\1B\\7F1\\18\\B7\\27', null, null, '9b69c210-8d20-45b6-afae-534ce10fd4b7', 'mestre', CONVERT ( DATETIME, CONVERT ( VARCHAR, GETDATE(), 120) ), 'mestre', CONVERT ( DATETIME, CONVERT ( VARCHAR, GETDATE(), 120) ))",
            "DetailMessage": null,
            "HelpUrl": null,
            "Details": null
        }
    ]
}

1.3 - PUT


1.3.1 - Put (Atualizar um usuário)


1.3.1 Post

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users/{id}

Exemplo de Configuração

Domínio: localhost

Porta: 8099

Id: 00001

Url Utilizada: http://localhost:8051/api/framework/v1/users/testeapiusuario

Exemplo de Entrada

Resultado (JSON)
{
  "id": "testeapiusuario",
  "meta": {
    "resourceType": "User",
    "created": "2018-09-21T16:49:57.336Z",
    "lastModified": "2018-09-21T16:49:57.336Z"
  },
  "externalId": "0001e",
  "name": {
    "givenName": "TesteAPI",
    "familyName": "Usuário"
  },
  "userName": "testeapiusuario",
  "phoneNumbers": [
    {
      "value": "31974964158"
    }
  ],
  "emails": [
    {
      "value": "[email protected]",
      "type": "string",
      "primary": true
    }
  ],
  "active": true,
  "groups": [
    {
      "value": "01",
      "display": "geral"
    }
  ],
  "title": "Mr",
  "manager": [
    {
      "managerId": "01",
      "displayName": "Geral"
    }
  ]
}

Exemplo de Resultado Positivo

Resultado (JSON)
{
    "id": "testeapiusuario",
    "meta": {
        "resourceType": "User",
        "created": "2018-09-21T16:49:57.336Z",
        "lastModified": "2018-09-21T16:49:57.336Z"
    },
    "externalId": "0001e",
    "name": {
        "givenName": "TesteAPI",
        "familyName": "Usuário"
    },
    "userName": "testeapiusuario",
    "phoneNumbers": [
        {
            "value": "31974964158"
        }
    ],
    "emails": [
        {
            "value": "[email protected]",
            "type": "string",
            "primary": true
        }
    ],
    "active": true,
    "groups": [
        {
            "value": "01",
            "display": "geral"
        }
    ],
    "title": "Mr",
    "manager": [
        {
            "managerId": "01",
            "displayName": "Geral"
        }
    ]
}

Exemplo de Resultado Negativo

Resultado (JSON)
{
    "Code": "RMSApplicationException",
    "Message": "Já existe um usuário com esse e-mail",
    "DetailMessage": "   em RM.Lib.RMSException.Throw(String message) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib\\Utils\\RMSException.cs:linha 131\r\n   em RM.Glb.Seguranca.GlbUsuarioData.ValidateRow(DataRow row) na C:\\RM\\Atual\\Release\\Glb-Globais\\RM.Glb.Seguranca.Data\\GlbUsuarioData.cs:linha 759\r\n   em RM.Lib.Server.RMSDataServer.ValidateTableRows(DataTable masterTable) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\RMSDataServer.cs:linha 2509\r\n   em RM.Lib.Server.RMSDataServer.DoValidateRows(DataSet dataSet) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\RMSDataServer.cs:linha 2449\r\n   em RM.Lib.Server.RMSDataServer.InternalSaveRecord(RMSContext context, DataSet& dataSet, Object ownerData, Boolean skipSecurity, Boolean skipSecurityCollumns) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\RMSDataServer.cs:linha 1413\r\n   em RM.Lib.Server.RMSDataServer.SaveRecord(RMSContext context, DataSet& dataSet, Object ownerData) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\RMSDataServer.cs:linha 651\r\n   em RM.Glb.Api.UserControllerServer.Save(String id, User record) na C:\\RM\\Atual\\Release\\Glb-Globais\\RM.Glb.Api\\UserController.Server.cs:linha 336\r\n   em RM.Glb.Api.UserControllerServer.OnPut(String id, User record) na C:\\RM\\Atual\\Release\\Glb-Globais\\RM.Glb.Api\\UserController.Server.cs:linha 274\r\n   em RM.Lib.Server.RMSCrudServer`1.Put(String id, T record) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Server\\Api\\RMSCrudServer.cs:linha 99\r\n   em RM.Lib.Api.RMSCrudController`1.OnPut(String id, T record) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Api\\Controllers\\RMSCrudController.cs:linha 163\r\n   em RM.Lib.Api.RMSCrudController`1.Put(String id, T record) na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Api\\Controllers\\RMSCrudController.cs:linha 152\r\n   em lambda_method(Closure , Object , Object[] )\r\n   em System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   em System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   em RM.Lib.Api.Server.ApiAuthenticationFilter.ResultWithChallenge.<ExecuteAsync>d__2.MoveNext() na C:\\RM\\Atual\\Release\\Lib\\RM.Lib.Api.Server\\Filters\\Api.AuthenticationFilter.cs:linha 193\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---\r\n   em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   em System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()",
    "HelpUrl": null,
    "Details": null
}

1.4 - DELETE


1.4.1 - Delete (Deletar um usuário)


1.4.1 Delete

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users/{id}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Id: Teste_01

Url Utilizada: http://localhost:8051/api/framework/v1/users/Teste_01

Exemplo de Resultado Positivo Postman

Obs.: Em caso de sucesso, será retornado o respondeCode = 204 e a resposta em branco.

Exemplo de Resultado Negativo

Resultado (JSON)
{
    "Code": "FE006",
    "Message": "Violação de chave estrangeira\r\n\r\nPossíveis causas:\r\n  - exclusão de registro que possui outros registros associados\r\n  - inclusão de registro detalhe sem um registro mestre associado",
    "DetailMessage": "The DELETE statement conflicted with the REFERENCE constraint \"FKGMESSAGECHAT_GUSUARIOTO\". The conflict occurred in database \"Base_12123\", table \"dbo.GMESSAGECHAT\", column 'CODUSUARIOTO'.\r\nThe statement has been terminated.\r\n\r\n--GlbUsuarioData\r\nDELETE GUSUARIO WHERE CODUSUARIO = '00001'",
    "HelpUrl": "",
    "Details": null
}

1.5 - PATCH


1.5.1 - Patch (Atualizar alguns campos de um usuário)


1.5.1 Patch

Configuração

Máscara de Url: http://{domínio}:{porta}/api/framework/v1/users/{id}

Exemplo de Configuração

Domínio: localhost

Porta: 8051

Id: Teste_01

Url Utilizada: http://localhost:8051/api/framework/v1/users/Teste_01

Exemplo de Entrada

Resultado (JSON)
{
	"name":
	{
            "givenName": {{givenName_formatted}}
    },
    "emails": [
        {
            "value": {{email_formatted}},
            "primary": true
        }
    ],
    "active": {{active}}
}

Exemplo de Resultado Positivo

Resultado (JSON)
{
    "id": "Teste_01",
    "meta": {
        "resourceType": "User",
        "created": "2018-12-05T15:03:07.28",
        "lastModified": "2018-12-05T15:03:08.5546578"
    },
    "externalId": "IDTeste_01External",
    "name": {
        "formatted": "NOME SOCIAL DO TESTE_01",
        "givenName": "Igor",
        "familyName": "Automatizado"
    },
    "userName": "Teste_01",
    "emails": [
        {
            "value": "[email protected]",
            "primary": true
        }
    ],
    "active": true
}


Referências (Links)


Roles (Manipulação de Perfis) A partir da versão 12.1.2306


Associação de Perfis (Roles)

Para adicionar e remover perfis á um usuário é necessário realizar as operações de Post/Delete nas rotas de perfis conforme abaixo

Método HTTP: Post

Máscara de Url:  http://{domínio}:{porta}/api/framework/v1/users/{user}/roles


Exemplo de Configuração

Url Utilizada: http://localhost:8051/api/framework/v1/users/apiteste/roles

VariávelDescriçãoValor
domínioendereço do serviço de webservicelocalhost
portaporta do serviço8051
usercódigo do usuárioapiteste

Request Body

Json
{
	"roles": [
		{
			"company": "0",
			"value": "DBA_G"
		}
	]
}

Response

HttpStatus: 200

Json
{
    "id": "apiteste",
    "roles": [
        {
            "company": "1",
            "value": "DBA_G"
        },
        {
            "company": "6",
            "value": "DBA_G"
        },
        {
            "company": "7",
            "value": "DBA_G"
        }
    ]
}

Atenção

Ao enviar o codigo da coligada (Company) como 0 o sistema irá adicionar o perfil para todas as coligadas que o usuário possuir permissão.

Como no exemplo da resposta, o perfil DBA_G foi associado para as coligadas 1,6 e 7.

Request Body

Json
{
	"roles": [
		{
			"company": "0",
			"value": "DBA_G"
		}
	]
}

HttpStatus: 400

Response

{
    "Code""FE019",
    "Message""Usuário APITESTE já está associado ao perfil 'CodColigada:'1'|Sistema:'G'|CodPerfil:'DBA'|IdPerfil:DBA_G'!",
    "DetailMessage""",
    "HelpUrl""",
    "Details"null
}

Request Body

Json
{
	"roles": [
		{
			"company": "0",
			"value": "DBA_S"
		}
	]
}

HttpStatus: 401

Response

{
    "Code""FE005",
    "Message""O Usuário informado não tem permissão para associar perfis na coligada 1 sistema S!",
    "DetailMessage""",
    "HelpUrl""",
    "Details"null
}


Método HTTP: Delete

Máscara de Url:  http://{domínio}:{porta}/api/framework/v1/users/{user}/roles/company/{company}/role/{role}

Exemplo de Configuração

Url Utilizada: http://localhost:8051/api/framework/v1/users/apiteste/roles/company/0/role/DBA_S

VariávelDescriçãoValor
domínioendereço do serviço de webservicelocalhost
portaporta do serviço8051
usercódigo do usuárioapiteste
companycódigo da coligada que será utilizada0
roleIdentificador(IDPERFIL) do perfil que será atribuído

DBA_S

Response (Sucesso ou Erro)

HttpStatus: 204

Response Body: Vazio 

Atenção

Por padrão, nas mensagens de DELETE, a resposta deve ser enviada com HTTP Code 204 (No content) e sem corpo no retorno, mesmo se não obtiver sucesso.