Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

3- No menu lateral esquerdo, também selecione a opção RT;

4- Digite o nome da NamedQuery  NamedQuery que pretende utilizar;

5- De duplo clique sobre o nome e ela será aberta para consulta na tela direita;

6, 7 e 8- No caso desta NamedQuery  NamedQuery (clockinrecordsListByPeriod), ela me permite realizar filtros no Data Model CLOCK IN RECORDS usando os campos de código do dispositivo, período de data da marcação de ponto e a partir de qual número NSR.

9- Você pode testar a NamedQuery  NamedQuery pressionando o botão RUN.


1- Preencho os filtros desejados e execute a consulta.

...

1- Consulte/exporte os dados retornados da consulta:

06.2. Exemplo

...

completo da montagem de uma requisição:

  • Só passando a   NamedQuery, sem usar filtros

Request:

Bloco de código
languageyml
themeMidnight
- curl -X 'POST' \
  'https://totvsclockin.carol.ai/api/v3/queries/named/clockinrecordsListByPeriod?indexType=MASTER&offset=0&pageSize=10&sortBy=mdmGoldenFieldAndValues.mdmeventdate&sortOrder=DESC&scrollable=false' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {seu token}' \
  -d ''

Response:

Bloco de código
languageyml
themeMidnight
{
  "nsrCodecount": "748"10,
  "deviceCodetotalHits": "BE1C11B2-5DEC-4878-88E6-175981481398"15646,
  "initialDatetook": 14,
 "2024-08-01T00:00:00.000-03:00", "hits": [
  "finalDate": "2024-09-01T00:00:00.000-03:00",
}'  {...}
	...
	]
}


  • Usando filtro passando um NSR, um único Device e um Período (UTC), não preciso passar todos, poderia por exemplo não passar DEVICE e viria marcações do período de todos DEVICES, ou o NSR e pegar todos registros, mas isso causaria eu registros que ainda não tiveram NSR gerado:

Request:

Bloco de código
languageyml
themeMidnight
- curl -X 'POST' \
  'https://totvsclockin.carol.ai/api/v3/queries/named/clockinrecordsListByPeriod?indexType=MASTER&offset=0&pageSize=10&sortBy=mdmGoldenFieldAndValues.mdmeventdate&sortOrder=DESC&scrollable=false' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {seu token}' \
  -d '{
  "nsrCode": "748",
  "deviceCode": "BE1C11B2-5DEC-4878-88E6-175981481398",
  "initialDate": "2024-08-01T03:00:00.000-03:00",
  "finalDate": "2024-09-01T03:00:00.000-03:00",
}'

Response:

Bloco de código
languageyml
themeMidnight
{
  "count": 6,
  "totalHits": 6,
  "took": 4,
  "hits": [
    {
      "mdmDeleted": false,
Bloco de código
languageyml
themeMidnight
{
  "count": 6,
  "totalHits": 6,
  "took": 4,
  "hits": [
    {
      "mdmDeleted": false,
      "mdmSourceOperation": "SQL_PROCESS",
      "mdmCounterForEntity": 1724761025743000,
      "mdmGoldenFieldAndValues": {
        "clockinmode": "1",
        "smssent": "2024-08-27T03:32:34.990Z",
        "supervisorcode": "[email protected]",
        "isautotimezone": "2",
        "selfclockin": true,
        "lastgpsdatetimemdmSourceOperation": "2024-08-21T12:15:29.000-03:00SQL_PROCESS",
      "mdmCounterForEntity": 1724761025743000,
      "nsrprocesseddatetimemdmGoldenFieldAndValues": "2024-08-21T15:22:25.440Z",{
        "devicetimezonechangeindicatorclockinmode": "1",
        "scoresmssent": "62024-08-27T03:32:34.990Z",
        "supervisornamesupervisorcode": "teste.[email protected]",
        "appnameisautotimezone": "Clock In"2",
        "selfclockin": true,
        "eventdatestrlastgpsdatetime": "2024-08-21T12:15:0029.000-03:00",
        "updatedatetimeautomaticallynsrprocesseddatetime": false"2024-08-21T15:22:25.440Z",
        "lastmomentgpsdatetimeobtaineddevicetimezonechangeindicator": "2024-08-21T12:15:29.322-03:001",
        "employeegeofencecoordinatesoptionalscore": "no coordinates6",
        "receiptimagesupervisorname": "https://teste.carol.ai/teste/go/728ywobccj[email protected]",
        "mdmnameappname": "ColaboradorClock ExemploIn",
        "devicedescriptioneventdatestr": "[email protected]2024-08-21T12:15:00.000-03:00",
        "datetimechangedupdatedatetimeautomatically": false,
        "imagelastmomentgpsdatetimeobtained": "https://teste.carol.ai/teste/go/raxoohcav9"2024-08-21T12:15:29.322-03:00",
        "nsrcodeemployeegeofencecoordinatesoptional": "753no coordinates",
        "coordinatesaccuracyreceiptimage": 6"https://teste.carol.ai/teste/go/728ywobccj",
        "diffgpsdevicetimemdmname": "0Colaborador Exemplo",
        "collectiveagreementdevicedescription": "99999999999999999[email protected]",
        "gpsleveldatetimechanged": "0"false,
        "locationcodeimage": "4https://teste.carol.ai/teste/go/raxoohcav9",
        "licensestatusnsrcode": "OK753",
        "mdmStagingAuditIdcoordinatesaccuracy": "f5ac249636ec0e34"6,
        "fraudscorediffgpsdevicetime": "0.0026708",
        "statusanalysisdatecollectiveagreement": "2024-08-21T21:09:10.514Z99999999999999999",
        "receiptsentmodegpslevel": "Nothing0",
        "readphonestateenabledlocationcode": false"4",
        "gmtlicensestatus": "-03:00OK",
        "devicecodemdmStagingAuditId": "BE1C11B2-5DEC-4878-88E6-175981481398f5ac249636ec0e34",
        "georeferencestatefraudscore": "filled"0.0026708,
        "mdmTaskIdstatusanalysisdate": "b0a898893037441fbc3cd42d8353f9c22024-08-21T21:09:10.514Z",
        "imagehashreceiptsentmode": "Nothing"-0.131479, 0.0294967, 0.0692975, -0.0225383, -0.0269747, -0.0752967, -0.0515807, -0.120229, 0.180412, -0.125723, 0.218578, -0.00439189, -0.253444, -0.118369, 0.002121, 0.117364, -0.0208364, -0.0767907, -0.0751632, -0.0915777, 0.0742972, 0.0451878, 0.0465591, 0.0654342, -0.0633498, -0.339759, -0.0660675, -0.115597, 0.02133, -0.0735729, -0.0318694, 0.0118895, -0.103082, -0.113205, 0.0400811, 0.112948, -0.0746193, -0.0700653, 0.198791, -0.00607182, -0.119064, -0.0749938, 0.0507131, 0.272417, 0.158889, 0.0524132, 0.0531848, -0.0839153, 0.15459, -0.277452, 0.152825, 0.0625031, 0.183316, 0.0599122, 0.20305, -0.146557, 0.0588035, 0.193805, -0.266038, 0.158633, 0.077579, -0.0514593, -0.104153, -0.00862041, 0.249977, 0.166787, -0.132382, -0.0749751, 0.200977, -0.136508, -0.062053, 0.0602444, -0.0952025, -0.207354, -0.218461, 0.0460927, 0.363987, 0.223373, -0.219258, 0.00230355, -0.0482604, 0.00519569, 0.0950405, 0.0393352, -0.0476836, -0.0534268, -0.0686621, -0.0298764, 0.111147, 0.0586453, -0.0532365, 0.272703, 0.0270942, -0.0053324, 0.0387958, 0.0122857, -0.130904, -0.0270901, -0.152075, -0.124179, 0.116132, -0.0682318, 0.0681907, 0.0567057, -0.219154, 0.198706, -0.0320844, 0.0369035, 0.0939216, -0.0129052, -0.104225, 0.0190724, 0.131557, -0.237321, 0.196939, 0.105615, 0.103404, 0.166686, 0.040076, 0.0371103, 0.0908808, -0.0865782, -0.173796, -0.0864644, 0.0326179, -0.0310395, 0.0630728, 0.0668265",
        "isuserinsidegeofenceenum": "1",
        "statusanalysis": "OK",
        "externalservicestatuscode": 0,
        "coordinates": {
  
        "readphonestateenabled": false,
        "gmt": "-03:00",
        "devicecode": "BE1C11B2-5DEC-4878-88E6-175981481398",
        "georeferencestate": "filled",
        "mdmTaskId": "b0a898893037441fbc3cd42d8353f9c2",
        "imagehash": "-0.131479, 0.0294967, 0.0692975, -0.0225383, -0.0269747, -0.0752967, -0.0515807, -0.120229, 0.180412, -0.125723, 0.218578, -0.00439189, -0.253444, -0.118369, 0.002121, 0.117364, -0.0208364, -0.0767907, -0.0751632, -0.0915777, 0.0742972, 0.0451878, 0.0465591, 0.0654342, -0.0633498, -0.339759, -0.0660675, -0.115597, 0.02133, -0.0735729, -0.0318694, 0.0118895, -0.103082, -0.113205, 0.0400811, 0.112948, -0.0746193, -0.0700653, 0.198791, -0.00607182, -0.119064, -0.0749938, 0.0507131, 0.272417, 0.158889, 0.0524132, 0.0531848, -0.0839153, 0.15459, -0.277452, 0.152825, 0.0625031, 0.183316, 0.0599122, 0.20305, -0.146557, 0.0588035, 0.193805, -0.266038, 0.158633, 0.077579, -0.0514593, -0.104153, -0.00862041, 0.249977, 0.166787, -0.132382, -0.0749751, 0.200977, -0.136508, -0.062053, 0.0602444, -0.0952025, -0.207354, -0.218461, 0.0460927, 0.363987, 0.223373, -0.219258, 0.00230355, -0.0482604, 0.00519569, 0.0950405, 0.0393352, -0.0476836, -0.0534268, -0.0686621, -0.0298764, 0.111147, 0.0586453, -0.0532365, 0.272703, 0.0270942, -0.0053324, 0.0387958, 0.0122857, -0.130904, -0.0270901, -0.152075, -0.124179, 0.116132, -0.0682318, 0.0681907, 0.0567057, -0.219154, 0.198706, -0.0320844, 0.0369035, 0.0939216, -0.0129052, -0.104225, 0.0190724, 0.131557, -0.237321, 0.196939, 0.105615, 0.103404, 0.166686, 0.040076, 0.0371103, 0.0908808, -0.0865782, -0.173796, -0.0864644, 0.0326179, -0.0310395, 0.0630728, 0.0668265",
        "lonisuserinsidegeofenceenum": -48.38827807460761"1",
          "latstatusanalysis": -22.370139551369817"OK",
        },"externalservicestatuscode": 0,
        "datetimeprovidercoordinates": {
          "ntp"lon": -48.38827807460761,
          "fakegpslocationlat": false -22.370139551369817
        },
        "devicesynchistorycodedatetimeprovider": "1724253342422ntp",
        "mdmtaxidfakegpslocation": "755"false,
        "locationdescriptiondevicesynchistorycode": "Joinville1724253342422",
        "clockinsessionstatusmdmtaxid": "logged-in755",
        "mdmeventdatelocationdescription": "Joinville",
        "clockinsessionstatus": "logged-in",
        "mdmeventdate": "2024-08-21T15:15:00.000Z",
        "imei": "",
        "gmtfromclockinscoordinates": "-03:00",
        "mdmpersonid": "12345678910"
      },
      "mdmConstraintPending": false,
      "mdmEntityType": "clockinrecordsGolden",
      "mdmStagingRecordIds": [
        "99eb05dd32446c8dd11d0171d995160e"
      ],
      "mdmSourceType": "SQL",
      "mdmMergePending": false,
      "mdmLastUpdated": "2024-08-27T12:17:05Z",
      "mdmTenantId": "1ff0fbe4de2143bbab686413a3c359ca",
      "mdmMasterCount": 1,
      "mdmStagingCounter": "1724729567118246",
      "mdmCreated": "2024-08-27T12:17:05Z",
      "mdmSourceOperationTaskId": "b0a898893037441fbc3cd42d8353f9c2",
      "mdmSourceEntityNames": [
        "bf2ace1f69f34529850e3b983feb8271_clockinrecords"
      ],
      "mdmEntityTemplateId": "7dd4da9d15294d46a6da8e27f179690f",
      "mdmId": "ca04aa98aed7b20e5eb450a397c7ea99"
    },
    {...}, 
    {...}, 
    {...},
    {...},
    {...}
  ],
  "aggs": {}
}


  • Na documentação acima falamos do offset e pageSize , mas também temos outros query parameterspossíveis:
    • sortBy=mdmGoldenFieldAndValues.mdmeventdate - Neste caso eu decidi organizar os registros pelo mdmeventdate (data da marcação de ponto);
    • sortOrder=DESC - Defini que a ordenação será em ordem decrescente, neste caso, da marcação mais atual para mais antiga;


Bloco de código
languageyml
themeMidnight
- curl -X 'POST' \
  {...}
  ],
  "aggs": {}
}'https://totvsclockin.carol.ai/api/v3/queries/named/clockinrecordsListByPeriod?indexType=MASTER&offset=0&pageSize=10&sortBy=mdmGoldenFieldAndValues.mdmeventdate&sortOrder=DESC&scrollable=false' \