Több házi feladat lekérése
Kérés a szervertől
GEThttps://[instituteCode].e-kreta.hu/ellenorzo/v3/Sajat/HaziFeladatok?datumTol=2023-01-01&datumIg=2023-02-01 (opcionális)
HEADERapiKey = 21ff6c25-d1da-4a68-a811-c881a6057463 (opcionális)
HEADERAuthorization = Bearer xxxxxxxxxx (Bearer tokened)
Válasz a szervertől
Sikeres lekérdezés: (200 OK)
[
{
"Uid": "123456",
"Tantargy": {
"Uid": "987654",
"Nev": "Magyar nyelv",
"Kategoria": {
"Uid": "1234,magyar_nyelv_es_irodalom",
"Nev": "magyar_nyelv_es_irodalom",
"Leiras": "Magyar nyelv és irodalom"
},
"SortIndex": 0
},
"TantargyNeve": "Magyar nyelv",
"RogzitoTanarNeve": "Gipsz Jakab",
"Szoveg": "Szia Lajos!",
"FeladasDatuma": "2022-09-01T22:00:00Z",
"HataridoDatuma": "2022-09-04T22:00:00Z",
"RogzitesIdopontja": "2022-09-01T22:00:00Z",
"IsTanarRogzitette": true,
"IsTanuloHaziFeladatEnabled": false,
"IsMegoldva": false,
"IsBeadhato": false,
"OsztalyCsoport": {
"Uid": "012345"
},
"IsCsatolasEngedelyezes": false
},
...
]
A datumTol és a datumIg paraméter között több van mint 3 hét: (400 Bad Request)
{
"ExceptionId": "xxxxxxxxxx",
"ExceptionType": "ModelValidacio",
"Message": "Validációs hiba történt!",
"ErrorList": [
{
"PropertyName": "custom_1",
"Message": "A DatumTol és a DatumIg paraméterek meg vannak adva, de maximum 3 hetes intervallum kérdezhető le!",
"ExceptionType": "ModelValidacio"
}
]
}
A datumTol paraméter nagyobb, mint a datumIg paraméter: (400 Bad Request)
{
"ExceptionId": "xxxxxxxxxx",
"ExceptionType": "ModelValidacio",
"Message": "Validációs hiba történt!",
"ErrorList": [
{
"PropertyName": "custom_1",
"Message": "A DatumTol és a DatumIg paraméterek meg vannak adva, de a DatumTol nagyobb, mint a DatumIg értek!",
"ExceptionType": "ModelValidacio"
}
]
}
Ismeretlen hiba: (500 Internal Server Error)
{
"ExceptionId": "xxxxxxxxxx",
"ExceptionType": "None",
"Message": "Ismeretlen hiba történt!",
"ErrorList": null
}
Helytelen bearer token: (401 Unauthorized)
invalid_grant
Structure: List<Homework>
C# class file: Homework.cs
| Field name | Variable name | Variable type |
|---|---|---|
| TantargyNeve | subjectName | string |
| Csatolmanyok | attachmentList | List<Attachment> |
| RogzitesIdopontja | createDateAsString | string |
| HataridoDatuma | deadlineDateAsString | string |
| OsztalyCsoport | group | UidStructure |
| IsCsatolasEngedelyezes | isAllowToAttachFile | bool |
| IsMegoldva | isDone | bool |
| IsTanuloHaziFeladatEnabled | isStudentHomeworkEnabled | bool |
| IsTanarRogzitette | isTeacherRecorded | bool |
| FeladasDatuma | recordDateAsString | string |
| RogzitoTanarNeve | recorderTeacherName | string |
| Tantargy | subject | SubjectDescriptor |
| IsBeadhato | submitable | bool |
| Szoveg | text | string |
| Uid | uid | string |
Attachment
| Field name | Variable name | Variable type |
|---|---|---|
| Nev | name | string |
| Tipus | type | string |
| Uid | uid | string |
cURL:
curl "https://{instituteCode}.e-kreta.hu/ellenorzo/v3/sajat/HaziFeladatok?datumTol=2023-01-01&datumIg=2023-02-01" -H "apiKey: 21ff6c25-d1da-4a68-a811-c881a6057463" --oauth2-bearer "{accessToken}"