librus-api icon indicating copy to clipboard operation
librus-api copied to clipboard

ERR_BAD_REQUEST on getting timetable

Open jozef-kasprzycki opened this issue 2 years ago • 1 comments

Hello,

I tried to use client.calendar.getTimetable() and got a 404 AxiosError.

Code:

"use strict";

const Librus = require('librus-api');
const client = new Librus();

client.authorize('<login>', '<password>').then(function () 
{
    client.calendar.getTimetable().then((data) => {console.log(data)});
});

Error:

C:\Users\jozek\Developer\librus\node_modules\axios\dist\node\axios.cjs:1913
    reject(new AxiosError(
           ^
AxiosError: Request failed with status code 404
...

The response also has this html content (part of it):

'  <h3>Błąd HTTP 404.0 — Not Found</h3> \n' +
'  <h4>Zasób, do którego chcesz uzyskać dostęp, został usunięty, jego nazwa uległa zmianie lub jest okresowo niedostępny.</h4> \n' +

I don't know if this is a Librus configuration issue by my school administrator or a librus-api bug...? Please let me know!

jozef-kasprzycki avatar Sep 06 '23 14:09 jozef-kasprzycki

Wygląda jakby zmienili nazwę linku, z którego odczytywane były wartości. Byłbym wdzięczny, w imieniu społeczności, za naprawę w formie PRki. Od dawna już nie mam dostępu do librusa :/ Jesteś w stanie zerknąć?

Mati365 avatar Sep 06 '23 14:09 Mati365