The Data API provides the option of Summary, where the data returned from the call brings information about the number of events that occurred in the entities and relationships. In cases that have a hierarchy, the information from the daughter schools will be returned with the payload.

📘

Collection Postman

https://gitlab.com/hub-educacional-public/docs/data-api

Return structure

{
    "mensagem": [],
    "dh_processamento": "2021/02/26T13:07:55",
    "resumo": {
        "nome": "Colégio ABC da Vida",
        "code": "orgdjkadjkla-7db1-4fa0-a8ef-idjka12klas",
        "links": {
            "data_url": "/data/orgdjkadjkla-7db1-4fa0-a8ef-idjka12klas",
            "resumo_url": "/data/orgdjkadjkla-7db1-4fa0-a8ef-idjka12klas/resumo",
            "parametros": {
                "min_date": null, // minimum date sent as parameter
                "max_date": null // maximum date sent as parameter
            }
        },
        "dat": {
            "usuario": {
                 /* user object with events conts */
            },
            "turma": {
                 /* section object with events conts */
            },
            "disciplinaProfessor": {
                 /* subjectTeacher object with events conts */
            },
            "turmaAluno": {
                 /* termStudent object with events conts */
            },
            "responsavelAluno": {
                 /* responsibleStudent object with events conts */
            },
            "disciplina": {
                 /* subject object with events conts */
            },
            "periodo": {
                 /* term object with events conts */
            }
        },
        "filhos": [] // Information from child institutions
    }
}

Request

"x-api-key": "apikey.hubeducacionalpontocom"

Filters:

The date API allows the use of parameters that assist in filtering the data

All parameters can be used together or not be informed, except org_id which is mandatory.


Item

Tipo
Exemplo

org_id

String
31ec8e07-a455-4dda-b8d2-b4e76ef3b2fb

min_date

YYYY/MM/DD HH:MM:SS
2021/02/18 00:00:00

max_date

YYYY/MM/DD HH:MM:SS
2021/02/18 23:59:59
  • min_date : defines the minimum date for inclusion of changes in the result of the requisition
  • max_date : defines the maximum date for inclusion of changes in the requisition result

If min_date and max_data are passed together, the return will be for the time interval entered.

If none of the date parameters are passed, the return will be all operations already carried out at the institution since its creation.

Return data

All objects within dat followed the following format.

{
  "insert": 1, // Number of inserts referring to the entity or relationship
  "update": 34,// Number of updates regarding the entity or relationship
  "delete": 40 // Number of deletes related to the entity or relationship
}

If an entity or relationship does not have one or more operations, the object referring to the operation will not be returned.

  • Hierarchy

The object sons has the same structure as that of the institution consulted, if the school is a father of other institutions, the institution can see the operations of the daughters. All data are presented recursively.

  • Example: A school that has a daughter with a daughter
    • School P -> School F1 -> School F2
{
    "mensagem": [],
    "dh_processamento": "2021/02/26T13:07:55",
    "resumo": {
        ... // parent school summary
        },
        "dat": {
            ... // parent school data
        },
        "filhos": [
          {
            "mensagem": [],
            "dh_processamento": "2021/02/26T13:07:55",
            "resumo": {        
              "nome": "Escola F1",
              "code": "dafsa-7db1-15s9-a8ef-idjka12klas",
              "links": {
                ...  
               }
             },
                "dat": {
                    ... // F1 School information
                },
                "filhos": [
                  {
                    "mensagem": [],
                    "dh_processamento": "2021/02/26T13:07:55",
                    "resumo": {        
                      "nome": "Escola F2",
                      "code": "dafsa-a78g-15s9-a8ef-idjkada2kleo",
                      "links": {
                        ...  
                       }
                     },
                        "dat": {
                            ... // F2 School information
                        },
                        "filhos": []
                   },
                ]
           },
        ]
    }
}

Request example

The example below will return all operations made at the institution since its creation.

Example: [https://apihub.educacional.com/maneger/v1/data/{org_id}/resumo](https://apihub.educacional.com/maneger/v1/data/{org_id}/resumo?min_date=10/12/2020 00:00:00)

  • Code 200
    • Status: OK
    • Example:
{
    "mensagem": [],
    "dh_processamento": "2021/02/26T13:07:55",
    "resumo": {
        "nome": "Colégio ABC da Vida",
        "code": "9f068d86-7db1-4fa0-a8ef-ab24a0e8e29d",
        "links": {
            "data_url": "/data/9f068d86-7db1-4fa0-a8ef-ab24a0e8e29d",
            "resumo_url": "/data/9f068d86-7db1-4fa0-a8ef-ab24a0e8e29d/resumo",
            "parametros": {
                "min_date": null,
                "max_date": null
            }
        },
        "dat": {
            "usuario": {
                "insert": 70,
                "update": 530,
                "delete": 9237
            },
            "turma": {
                "insert": 8,
                "update": 7,
                "delete": 125
            },
            "disciplinaProfessor": {
                "insert": 37,
                "delete": 230
            },
            "turmaAluno": {
                "insert": 1042,
                "delete": 8499
            },
            "responsavelAluno": {},
            "disciplina": {
                "insert": 1,
                "update": 34,
                "delete": 40
            },
            "periodo": {
                "insert": 2,
                "update": 2,
                "delete": 1
            }
        },
        "filhos": []
    }
}
  • Code 400: Bad Request, when the code is not informed
  • Code 401: Not Authorized, when the code passed is from an institution not linked to Edtech
  • Code 404: Not Found, when the code entered is not in the HUB.
  • Code 500: Internal Error
Language
Credentials
Header
Click Try It! to start a request and see the response here!