getAttendance

Gets your attendance from the API.

  • Params:

    • dateFrom - The start of the date range

    • dateTo - The end of the date range

    Returns: Attendance

const { VulcanJwtRegister, Keypair, VulcanHebeCe } = require('hebece');
const apiap = '<html><body><input id='ap' type='hidden' value='{"Success":true,"Tokens":["Some.Jwt.Here", "Another.Jwt.here"],"Alias":"example@example.com","Email":"example@example.com","EmailCandidate":null,"GivenName":"Jacek","Surname":"Różycki","IsConsentAccepted":true,"CanAcceptConsent":true,"AccessToken":"1yearapiaptoken","ErrorMessage":null,"Capabilities":["EMAIL_CONFIRMATION"]}' /></body></html>'

(async () => {
    const keypair = await (new Keypair()).init();
    const jwt = await (new VulcanJwtRegister(keypair, apiap)).init();
    const hebe = new VulcanHebeCe(keypair);
    await hebe.connect();
    const date1 = new Date('2024-10-05');
    const date2 = new Date('2024-10-07');
    
    const attendance = await hebe.getAttendance(date1, date2);
    console.log(attendance) // Returns Attendance
    
})()

Last updated