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 Riscos, são eles:

1.1 - GET


1.1.1 - Get All (Recuperar todos os conectores)


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

Domínio: localhost

Porta: 8051

Url Utilizada: http://localhost:8051/api/framework/v1/filerepo/connectors

{
    "hasNext": false,
    "items": [
        {
            "id": 3,
            "name": "gdrive-teste-altered",
            "companyId": 0,
            "description": "Teste Google Drive altered",
            "type": 1,
            "status": true
        }
    ],
    "total": 1
}

1.1.2 - GetOne (Recuperar conector pelo Identificador)


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

Domínio: localhost

Porta: 8051

Id: 3

Url Utilizada: http://localhost:8051/api/framework/v1/filerepo/connectors/3

{
    "id": 3,
    "name": "gdrive-teste",
    "description": "Teste Google Drive",
    "type": "GoogleDrive",
    "companyID": 1,
	"global": false,
    "systemCode": "",
	"multiSystem": true,
    "status": true,
	"credentials": "data:application/json;base64,eqrwefasdfas...",
	"filesNumber": 0
}


1.2 - POST


1.2.1 - Post (Inserir um conector)


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

Domínio: localhost

Porta: 8051

Url Utilizada: http://localhost:8051/api/framework/v1/filerepo/connectors

{
    "Name": "gdrive-teste",
    "Description": "Teste Google Drive",
    "Type": "GoogleDrive",
    "CompanyID": 1,
	"Global": false,
    "SystemCode": "",
	"MultiSystem": true,
    "Status": 1,
	"Credentials": "data:application/json;base64,eqrwefasdfas..."
}
{
    "id": 3,
    "name": "gdrive-teste",
    "description": "Teste Google Drive",
    "type": "GoogleDrive",
    "companyID": 1,
	"global": false,
    "systemCode": "",
	"multiSystem": true,
    "status": true,
	"Credentials": "data:application/json;base64,eqrwefasdfas...",
	"filesNumber": 0
}

1.3 - PUT


1.3.1 - Put (Atualizar um conector)


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

Domínio: localhost

Porta: 8051

Id: 3

Url Utilizada: http://localhost:8051/api/framework/v1/filerepo/connectors/3

{
    "Name": "gdrive-teste Alterado",
    "Description": "Teste Google Drive Alterado",
    "Type": 1,
    "CompanyID": 0,
    "Status": 1
}
{
    "id": 3,
    "name": "gdrive-teste-altered",
    "companyId": 0,
    "description": "Teste Google Drive altered",
    "type": 1,
    "status": true
}

1.4 - PATCH


1.4.1 - Patch (Altera algumas propriedades de um conector)


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

Domínio: localhost

Porta: 8051

Id: 3

Url Utilizada: http://localhost:8051/api/framework/v1/filerepo/connectors/3

{
    "Description": "Teste Google Drive Alterado"
}
{
    "id": 3,
    "name": "gdrive-teste-altered",
    "companyId": 0,
    "description": "Teste Google Drive Alterado",
    "type": 1,
    "status": true
}

1.5 - DELETE


1.5.1 - Delete (Deletar um conector)


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

Domínio: localhost

Porta: 8051

Id: 3

Url Utilizada: http://localhost:8051/api/framework/v1/filerepo/connectors/3

Será retornado o respondeCode = 204 e a resposta em branco.