Mudanças entre as edições de "Controllr/API/REST-HTTP/Área Administrativa"

De BrByte Wiki
< Controllr‎ | API‎ | REST-HTTP
Linha 450: Linha 450:
 
</pre></blockquote>
 
</pre></blockquote>
  
 +
==='''Listar Ordem de Serviço'''===
 +
 +
<div>
 +
<span class="label label-info">POST</span> <span class="label label-concrete">/controllrctl/service_order/list</span>
 +
</div>
 +
 +
<blockquote><pre>
 +
 +
  curl -i -X POST \
 +
        -H "Content-Type:application/x-www-form-urlencoded" \
 +
        -H "Accept:application/json" \ 
 +
        -d "where: [{"field":"os_done","oper":5,"value":0},{"field":"AND"},{"field":"os_deleted","oper":7,"value":false},{"field":"AND"},{"field":"support_deleted","oper":7,"value":false}]" \
 +
        -d "start: 0" \
 +
        -d "limit: 15" \
 +
        -d "sort: os_date_sched" \
 +
        -d "dir: DESC" \
 +
        <nowiki>'http://192.168.144.10:8080/controllrctl/service_order/list'</nowiki> 
 +
 +
</pre></blockquote>
 +
 +
<div>
 +
<span class="label label-success">Resposta</span> <span class="label label-concrete">JSON</span>
 +
</div>
 +
 +
<blockquote class="blockquote-neutral"><pre>
 +
 +
{
 +
    "success": true,
 +
    "total": 1,
 +
    "results": [
 +
        {
 +
            "os_pk": 1,
 +
            "os_obs": "",
 +
            "os_desc": "",
 +
            "os_date_entry": "2019-05-09 18:12:32.322203",
 +
            "os_date_soluction": null,
 +
            "os_date_sched": "2019-05-09 17:12:24",
 +
            "os_done": 0,
 +
            "os_deleted": false,
 +
            "os_date_close": null,
 +
            "os_date_last": null,
 +
            "os_amount": null,
 +
            "staff_pk": 1,
 +
            "task_pk": 2,
 +
            "os_create_type": 0,
 +
            "support_pk": 1,
 +
            "support_protocol": "201905091811259",
 +
            "support_phone": null,
 +
            "support_problem_desc": "",
 +
            "support_obs": "",
 +
            "support_date_signup": "2019-05-09 18:11:25.912607",
 +
            "support_date_done": null,
 +
            "support_status": null,
 +
            "support_deleted": false,
 +
            "support_priority": 0,
 +
            "support_amount": null,
 +
            "support_created_invoice_date": null,
 +
            "support_done": 0,
 +
            "support_create_type": 0,
 +
            "client_pk": 1,
 +
            "contract_pk": 1,
 +
            "staff_name": "Fulano de Tal",
 +
            "staff_cpf": "",
 +
            "staff_rg": "",
 +
            "staff_rg_orgexp": "",
 +
            "staff_mother_name": "",
 +
            "staff_father_name": "",
 +
            "staff_nationality": "",
 +
            "staff_spouse": null,
 +
            "staff_mail": "",
 +
            "staff_phone": "",
 +
            "staff_mobile": "",
 +
            "staff_cep": "",
 +
            "staff_address": "",
 +
            "staff_number": "",
 +
            "staff_completion": "",
 +
            "staff_neighborhood": "",
 +
            "staff_province": "",
 +
            "staff_state": "",
 +
            "staff_signupdate": null,
 +
            "staff_observations": "",
 +
            "staff_username": null,
 +
            "staff_password": null,
 +
            "staff_type": null,
 +
            "staff_contact": null,
 +
            "staff_maturity": null,
 +
            "staff_birthdate": "2019-05-09",
 +
            "staff_status": null,
 +
            "staff_deleted": false,
 +
            "staff_admission_date": "2019-05-09",
 +
            "staff_number_wallet": "",
 +
            "staff_ocupation": "",
 +
            "staff_income": "-1",
 +
            "staff_mk_access_enabled": 0,
 +
            "staff_mk_access_subnet": null,
 +
            "staff_mk_access_login": null,
 +
            "staff_mk_access_password": null,
 +
            "staff_mk_access_groupname": null,
 +
            "staff_mk_access_ontimes": "",
 +
            "staff_agent_username": null,
 +
            "staff_agent_password": "12345678",
 +
            "staff_agent_enabled": 1,
 +
            "client_status": 0,
 +
            "client_date_cad": "2018-08-01 00:00:00",
 +
            "client_date_birth": "2018-01-01 00:00:00",
 +
            "client_date_deactivation": null,
 +
            "client_name": "AAAAAAAA BrByte",
 +
            "client_lastname": "Exemplo",
 +
            "client_complete_name": "AAAAAAAA BrByte Exemplo",
 +
            "client_observations": "",
 +
            "client_username": "brbyte123",
 +
            "client_password": "brbyte123",
 +
            "client_type": 0,
 +
            "client_doc1": "",
 +
            "client_doc2": "",
 +
            "client_mail": null,
 +
            "client_passtext": null,
 +
            "group_pk": 1,
 +
            "offices_pk": 1,
 +
            "task_name": "Instalação",
 +
            "cli_addr_address": "BrByte",
 +
            "cli_addr_number": "",
 +
            "cli_addr_neighborhood": "",
 +
            "cli_addr_zipcode": "00000000",
 +
            "cli_addr_province": "Campo Grande",
 +
            "cli_addr_state": "MS",
 +
            "cli_addr_completation": "",
 +
            "ctt_addr_address": "BrByte",
 +
            "ctt_addr_number": "",
 +
            "ctt_addr_neighborhood": "",
 +
            "ctt_addr_zipcode": "00000000",
 +
            "ctt_addr_province": "Campo Grande",
 +
            "ctt_addr_state": "MS",
 +
            "ctt_addr_completation": ""
 +
        }
 +
    ]
 +
}
 +
 +
</pre></blockquote>
  
  
 
__NOEDITSECTION__
 
__NOEDITSECTION__

Edição das 15h30min de 9 de maio de 2019

Listagem dos Clientes

POST /controllrctl/client/list


  curl -i -X POST \
        -H "Content-Type:application/x-www-form-urlencoded" \
        -H "Accept:application/json" \  
        -d "where: [{"field":"client_status","oper":5,"value":0}]" \
        -d "username: admin" \
        -d "page: 1" \
        -d "start: 0" \
        -d "limit: 15" \
        -d "sort: client_complete_name" \
        -d "dir: ASC" \
        'http://192.168.144.10:8080/controllrctl/client/list'  

Resposta JSON

 
{
    "success": true,
    "total": 493,
    "results": [
        {
            "client_pk": 430,
            "client_status": 3,
            "client_type": 0,
            "client_username": "",
            "client_password": "",
            "client_name": "teste",
            "client_lastname": "brbyte",
            "client_mail": "",
            "client_doc1": "",
            "client_doc2": "",
            "client_date_cad": "2016-09-20 00:00:00",
            "client_date_deactivation": null,
            "client_date_birth": "2016-09-20 00:00:00",
            "client_observations": "",
            "offices_pk": 1,
            "offices_identification": "Matriz",
            "client_complete_name": "teste brbyte",
            "client_phones": null,
            "cli_addr_address": "Rua Oscar Ferreira Bugre",
            "cli_addr_number": "88",
            "cli_addr_neighborhood": "Vila Nasser",
            "cli_addr_zipcode": "79.117-101",
            "cli_addr_province": "Campo Grande",
            "cli_addr_state": "MS",
            "cli_addr_completation": ""
        }
    ]
}

Listagem dos Contratos

POST /controllrctl/contract/list


  curl -i -X POST \
        -H "Content-Type:application/x-www-form-urlencoded" \
        -H "Accept:application/json" \  
        -d "where: [{"field":"contract_deleted","oper":5,"value":false},{"field":"AND"},{"field":"contract_status","oper":5,"value":0}]" \
        -d "client_complete_name:" \
        -d "offices_pk: 0" \
        -d "username: admin" \
        -d "page: 1" \        
        -d "start: 0" \
        -d "limit: 15" \
        -d "sort: contract_number" \
        -d "dir: ASC" \
        'http://192.168.144.10:8080/controllrctl/contract/list'  

Resposta JSON


{
    "success": true,
    "total": 1,
    "results": [
        {
            "contract_pk": 466,
            "contract_number": 464,
            "contract_pay_day": 10,
            "contract_free": 0,
            "contract_amount": "45.00",
            "contract_pay_discount": null,
            "contract_date_cad": "2017-02-08 18:30:11",
            "contract_status": 0,
            "contract_deleted": false,
            "contract_observations": "",
            "contract_block_type": 0,
            "contract_date_last_paymentobservation": null,
            "contract_tax_cfop": 5307,
            "contract_tax_icms": "1.25",
            "contract_tax_ibpt": "13.45",
            "contract_block_auto": 1,
            "address_pk": 346,
            "client_pk": 464,
            "client_status": 0,
            "client_type": 0,
            "client_username": "admin",
            "client_password": "admin",
            "client_name": "Teste1",
            "client_lastname": "BrByte",
            "client_mail": "softov@brbyte.com",
            "client_doc1": "69120603070",
            "client_doc2": "",
            "client_date_cad": "2017-02-08 00:00:00",
            "client_date_birth": "2017-02-08 00:00:00",
            "client_complete_name": "Teste1 BrByte",
            "offices_pk": 1,
            "offices_identification": "Matriz",
            "bank_account_pk": 1,
            "bank_account_code": "756",
            "bank_account_identification": "Sicoob Credivale",
            "contract_layouts_pk": 1,
            "client_phones": "Fixo#-#67981234276",
            "cli_addr_address": "",
            "cli_addr_number": "",
            "cli_addr_neighborhood": "",
            "cli_addr_zipcode": "",
            "cli_addr_province": "Grão Pará",
            "cli_addr_state": "SC",
            "cli_addr_completation": "",
            "ctt_addr_address": "",
            "ctt_addr_number": "",
            "ctt_addr_neighborhood": "",
            "ctt_addr_zipcode": "",
            "ctt_addr_province": "Grão Pará",
            "ctt_addr_state": "SC",
            "ctt_addr_completation": ""
        }
    ]
}


Listar Autenticação de CPE

POST /controllrctl/networkcpe/list


  curl -i -X POST \
        -H "Content-Type:application/x-www-form-urlencoded" \
        -H "Accept:application/json" \  
        -d "where: [{"field":"network_cpe_deleted","oper":7,"value":false},{"field":"AND"},{"field":"contract_item_status","oper":6,"value":1}]" \
        -d "offices_pk: 0" \
        -d "start: 0" \
        -d "limit: 15" \
        -d "sort: client_complete_name" \
        -d "dir: ASC" \
        'http://192.168.144.10:8080/controllrctl/networkcpe/list'  

Resposta JSON


{
    "success": true,
    "total": 1,
    "results": [
        {
            "network_cpe_pk": 1,
            "network_cpe_circuit_id": "",
            "network_cpe_circuit_id_hex": null,
            "network_cpe_longitude": "0",
            "network_cpe_latitude": "0",
            "network_cpe_automac": false,
            "network_cpe_autoip": false,
            "network_cpe_status": 0,
            "network_cpe_ip": "",
            "network_cpe_mac": "",
            "network_cpe_username": "brbyte123",
            "network_cpe_password": "brbyte123",
            "network_cpe_fiber": 0,
            "network_cpe_fiber_onu_mac": null,
            "network_cpe_fiber_device_pk": null,
            "network_cpe_fiber_old_id": null,
            "network_cpe_authentication_type": 3,
            "network_cpe_date_cad": "2019-05-08 16:23:41",
            "network_cpe_deleted": false,
            "network_cpe_commom_interface": null,
            "network_cpe_commom_device_name": null,
            "network_cpe_commom_lastip": null,
            "network_cpe_commom_rates": null,
            "network_cpe_commom_rx_rate": null,
            "network_cpe_commom_tx_rate": null,
            "network_cpe_commom_distance": null,
            "network_cpe_commom_tx_ccq": null,
            "network_cpe_commom_signal_rx": null,
            "network_cpe_commom_signal_tx": null,
            "network_cpe_commom_noisefloor": null,
            "network_cpe_commom_idle": null,
            "network_cpe_commom_tx_bytes": null,
            "network_cpe_commom_rx_bytes": null,
            "network_cpe_especdata": null,
            "network_cpe_commom_rx_ccq": null,
            "network_cpe_commom_ping": null,
            "network_cpe_commom_uptime": null,
            "network_cpe_lastupdate": null,
            "suppliers_pk": null,
            "network_devices_pk": 1,
            "network_cpe_model_pk": null,
            "radius_plans_pk": 1,
            "contract_pk": 1,
            "network_subnets_pk": 1,
            "client_pk": 1,
            "network_cpe_lending": 0,
            "panel_pk": 1,
            "network_cpe_mac_status": 2,
            "network_cpe_ip_status": 2,
            "network_cpe_reduced_speed": false,
            "network_cpe_reduced_speed_date": null,
            "network_cpe_control_pk": 0,
            "network_cpe_turbo_active": false,
            "network_cpe_ip_text": "",
            "network_cpe_access_login": "",
            "network_cpe_access_password": "",
            "network_cpe_access_port": "22",
            "network_cpe_wifi_encryption_type": 0,
            "network_cpe_wifi_encryption_password": null,
            "radius_plans_name": "Exemplo 10M",
            "panel_name": "Painél Padrão",
            "panel_client_limit": 0,
            "network_devices_name": "Exemplo",
            "network_devices_fiber_name": null,
            "network_devices_vendor": 0,
            "network_subnets_subnet": "10.255.255.0/24",
            "network_subnets_pool_name": "Pool-Exemplo",
            "network_cpe_model_name": null,
            "address_pk": 1,
            "contract_number": 1,
            "contract_amount": "0",
            "contract_pay_day": 10,
            "contract_status": 0,
            "contract_deleted": false,
            "offices_pk": 1,
            "client_name": "AAAAAAAA BrByte",
            "client_lastname": "Exemplo",
            "client_mail": null,
            "client_doc2": "",
            "client_doc1": "",
            "client_status": 0,
            "client_complete_name": "AAAAAAAA BrByte Exemplo",
            "client_type": 0,
            "contract_item_status": 0,
            "contract_item_free": 0,
            "contract_item_pk": 1,
            "contract_item_type": 1,
            "contract_item_deleted": false,
            "contract_item_ref_pk": 1,
            "suppliers_name": null,
            "network_cpe_online": null,
            "ctt_addr_address": "BrByte",
            "ctt_addr_number": "",
            "ctt_addr_neighborhood": "",
            "ctt_addr_zipcode": "00000000",
            "ctt_addr_province": "Campo Grande",
            "ctt_addr_state": "MS",
            "ctt_addr_completation": ""
        }
    ]
}

Listar Planos de Acessos

POST /controllrctl/plan/list


  curl -i -X POST \
        -H "Content-Type:application/x-www-form-urlencoded" \
        -H "Accept:application/json" \  
        -d "where: [{"field":"radius_plans_deleted","oper":7,"value":false}]" \
        -d "start: 0" \
        -d "limit: 15" \
        -d "sort: radius_plans_name" \
        -d "dir: ASC" \
        'http://192.168.144.10:8080/controllrctl/plan/list'  

Resposta JSON


{
    "success": true,
    "total": 1,
    "results": [
        {
            "radius_plans_pk": 1,
            "radius_plans_name": "Exemplo 10M",
            "radius_plans_mikrotik_name": "exemplo-10",
            "radius_plans_download_speed": 10240,
            "radius_plans_download_burst": 0,
            "radius_plans_download_bursttime": 0,
            "radius_plans_upload_speed": 5120,
            "radius_plans_upload_burst": 0,
            "radius_plans_upload_bursttime": 0,
            "radius_plans_priority": 8,
            "radius_plans_download_burstthreshold": 0,
            "radius_plans_upload_burstthreshold": 0,
            "radius_plans_upload_limitat": 0,
            "radius_plans_download_limitat": 0,
            "radius_plans_reduction_download_speed": 5120,
            "radius_plans_reduction_upload_speed": 1024,
            "radius_plans_amount": "20",
            "radius_plans_deleted": false,
            "radius_plans_hotsite_active": 0,
            "radius_plans_hotsite_featured": -1,
            "radius_plans_franquia_limit_download": "0",
            "radius_plans_franquia_limit_type": 0,
            "radius_plans_franquia_limit_reduce_download": 0,
            "radius_plans_franquia_limit_reduce_upload": 0,
            "radius_plans_turbo_active": 0,
            "radius_plans_turbo_hour_start": null,
            "radius_plans_turbo_hour_end": null,
            "radius_plans_turbo_upload": -1,
            "radius_plans_turbo_download": -1,
            "radius_plans_hotsite_name": null,
            "radius_plans_hotsite_description": null,
            "radius_plans_addresslist_param": "",
            "offices_pk": 1,
            "total_referenced_cpe": 1
        }
    ]
}

Listar Suporte Técnico

POST /controllrctl/support/list


  curl -i -X POST \
        -H "Content-Type:application/x-www-form-urlencoded" \
        -H "Accept:application/json" \  
        -d "where: [{"field":"support_done","oper":5,"value":0},{"field":"AND"},{"field":"support_deleted","oper":7,"value":false}]" \
        -d "start: 0" \
        -d "limit: 15" \
        -d "sort: support_priority" \
        -d "dir: DESC" \
        'http://192.168.144.10:8080/controllrctl/support/list'  

Resposta JSON


{
    "success": true,
    "total": 1,
    "results": [
        {
            "support_pk": 1,
            "support_protocol": "201905091811259",
            "support_phone": null,
            "support_problem_desc": "",
            "support_obs": "",
            "support_date_signup": "2019-05-09 18:11:25.912607",
            "support_date_done": null,
            "support_status": null,
            "support_deleted": false,
            "staff_pk": 1,
            "support_priority": 0,
            "support_amount": null,
            "support_created_invoice_date": null,
            "support_done": 0,
            "support_create_type": 0,
            "client_pk": 1,
            "contract_pk": 1,
            "client_status": 0,
            "client_date_cad": "2018-08-01 00:00:00",
            "client_date_birth": "2018-01-01 00:00:00",
            "client_date_deactivation": null,
            "client_name": "AAAAAAAA BrByte",
            "client_lastname": "Exemplo",
            "client_complete_name": "AAAAAAAA BrByte Exemplo",
            "client_observations": "",
            "client_username": "brbyte123",
            "client_password": "brbyte123",
            "client_type": 0,
            "client_doc1": "",
            "client_doc2": "",
            "client_mail": null,
            "client_passtext": null,
            "group_pk": 1,
            "offices_pk": 1,
            "staff_name": "Fulano de Tal",
            "cli_addr_address": "BrByte",
            "cli_addr_number": "",
            "cli_addr_neighborhood": "",
            "cli_addr_zipcode": "00000000",
            "cli_addr_province": "Campo Grande",
            "cli_addr_state": "MS",
            "cli_addr_completation": "",
            "ctt_addr_address": "BrByte",
            "ctt_addr_number": "",
            "ctt_addr_neighborhood": "",
            "ctt_addr_zipcode": "00000000",
            "ctt_addr_province": "Campo Grande",
            "ctt_addr_state": "MS",
            "ctt_addr_completation": "",
            "time_open": "4.40573543333333"
        }
    ]
}

Listar Ordem de Serviço

POST /controllrctl/service_order/list


  curl -i -X POST \
        -H "Content-Type:application/x-www-form-urlencoded" \
        -H "Accept:application/json" \  
        -d "where: [{"field":"os_done","oper":5,"value":0},{"field":"AND"},{"field":"os_deleted","oper":7,"value":false},{"field":"AND"},{"field":"support_deleted","oper":7,"value":false}]" \
        -d "start: 0" \
        -d "limit: 15" \
        -d "sort: os_date_sched" \
        -d "dir: DESC" \
        'http://192.168.144.10:8080/controllrctl/service_order/list'  

Resposta JSON


{
    "success": true,
    "total": 1,
    "results": [
        {
            "os_pk": 1,
            "os_obs": "",
            "os_desc": "",
            "os_date_entry": "2019-05-09 18:12:32.322203",
            "os_date_soluction": null,
            "os_date_sched": "2019-05-09 17:12:24",
            "os_done": 0,
            "os_deleted": false,
            "os_date_close": null,
            "os_date_last": null,
            "os_amount": null,
            "staff_pk": 1,
            "task_pk": 2,
            "os_create_type": 0,
            "support_pk": 1,
            "support_protocol": "201905091811259",
            "support_phone": null,
            "support_problem_desc": "",
            "support_obs": "",
            "support_date_signup": "2019-05-09 18:11:25.912607",
            "support_date_done": null,
            "support_status": null,
            "support_deleted": false,
            "support_priority": 0,
            "support_amount": null,
            "support_created_invoice_date": null,
            "support_done": 0,
            "support_create_type": 0,
            "client_pk": 1,
            "contract_pk": 1,
            "staff_name": "Fulano de Tal",
            "staff_cpf": "",
            "staff_rg": "",
            "staff_rg_orgexp": "",
            "staff_mother_name": "",
            "staff_father_name": "",
            "staff_nationality": "",
            "staff_spouse": null,
            "staff_mail": "",
            "staff_phone": "",
            "staff_mobile": "",
            "staff_cep": "",
            "staff_address": "",
            "staff_number": "",
            "staff_completion": "",
            "staff_neighborhood": "",
            "staff_province": "",
            "staff_state": "",
            "staff_signupdate": null,
            "staff_observations": "",
            "staff_username": null,
            "staff_password": null,
            "staff_type": null,
            "staff_contact": null,
            "staff_maturity": null,
            "staff_birthdate": "2019-05-09",
            "staff_status": null,
            "staff_deleted": false,
            "staff_admission_date": "2019-05-09",
            "staff_number_wallet": "",
            "staff_ocupation": "",
            "staff_income": "-1",
            "staff_mk_access_enabled": 0,
            "staff_mk_access_subnet": null,
            "staff_mk_access_login": null,
            "staff_mk_access_password": null,
            "staff_mk_access_groupname": null,
            "staff_mk_access_ontimes": "",
            "staff_agent_username": null,
            "staff_agent_password": "12345678",
            "staff_agent_enabled": 1,
            "client_status": 0,
            "client_date_cad": "2018-08-01 00:00:00",
            "client_date_birth": "2018-01-01 00:00:00",
            "client_date_deactivation": null,
            "client_name": "AAAAAAAA BrByte",
            "client_lastname": "Exemplo",
            "client_complete_name": "AAAAAAAA BrByte Exemplo",
            "client_observations": "",
            "client_username": "brbyte123",
            "client_password": "brbyte123",
            "client_type": 0,
            "client_doc1": "",
            "client_doc2": "",
            "client_mail": null,
            "client_passtext": null,
            "group_pk": 1,
            "offices_pk": 1,
            "task_name": "Instalação",
            "cli_addr_address": "BrByte",
            "cli_addr_number": "",
            "cli_addr_neighborhood": "",
            "cli_addr_zipcode": "00000000",
            "cli_addr_province": "Campo Grande",
            "cli_addr_state": "MS",
            "cli_addr_completation": "",
            "ctt_addr_address": "BrByte",
            "ctt_addr_number": "",
            "ctt_addr_neighborhood": "",
            "ctt_addr_zipcode": "00000000",
            "ctt_addr_province": "Campo Grande",
            "ctt_addr_state": "MS",
            "ctt_addr_completation": ""
        }
    ]
}