Giter VIP home page Giter VIP logo

ekreta-docs-v3's Introduction

ekreta-docs v3

Notice: I no longer have access to a Kreta account. As such, I am looking for a maintainer to take over this project and allow it to remain up to date. Email me for details!

Updated documentation for version 3 of the e-kreta API.

Most of the info here is based on Filc's source code and boapps' v1 documentation, while the rest was hand tested.

The repository also contains a Python program to access most functions, and as a sort of example of usage.

Kreta projects based on the new API

  • Filc: An unnofficial e-diary application for the e-Kreta system.
  • Asztal: Terminal-based e-Kreta client.
  • kreta-cli: A command line interface for KRÉTA's latest v3 api
  • Táblafilc: A grade calculator program for students (GitHub).

To add your project to the list, create a pull request with it added.

Table of contents

Kreta Endpoints & API links

Class-based representation of all Kreta Endpoints

taken from Filc's source

class Kreta:
    def base(ist):
        return f"https://{ist}.e-kreta.hu"
    IDP = "https://idp.e-kreta.hu"
    ADMIN = "https://eugyintezes.e-kreta.hu"
    FILES = "https://files.e-kreta.hu"

class KretaEndpoints:
    token = "/connect/token"
    nonce = "/nonce"
    notes = "/ellenorzo/V3/Sajat/Feljegyzesek"
    events = "/ellenorzo/V3/Sajat/FaliujsagElemek"
    student = "/ellenorzo/V3/Sajat/TanuloAdatlap"
    grades = "/ellenorzo/V3/Sajat/Ertekelesek"
    absences = "/ellenorzo/V3/Sajat/Mulasztasok"
    groups = "/ellenorzo/V3/Sajat/OsztalyCsoportok"
    groupAverages = "/ellenorzo/V3/Sajat/Ertekelesek/Atlagok/OsztalyAtlagok"
    timetable = "/ellenorzo/V3/Sajat/OrarendElemek"
    exams = "/ellenorzo/V3/Sajat/BejelentettSzamonkeresek"
    homework = "/ellenorzo/V3/Sajat/HaziFeladatok"
    capabilities = "/ellenorzo/V3/Sajat/Intezmenyek"

class AdminEndpoints:
    sendMessage = "/api/v1/kommunikacio/uzenetek"
    def getAllMessages(endpoint):
        return f"/api/v1/kommunikacio/postaladaelemek/{endpoint}"
    def getMessage(id):
        return f"/api/v1/kommunikacio/postaladaelemek/{id}"
   
    recipientCategories = "/api/v1/adatszotarak/cimzetttipusok"
    availableCategories = "/api/v1/kommunikacio/cimezhetotipusok"
    recipientsTeacher = "/api/v1/kreta/alkalmazottak/tanar"

    uploadAttachment = "/ideiglenesfajlok"
    def downloadAttachment(id):
        return "/v1/dokumentumok/uzenetek/$id"
    
    trashMessage = "/api/v1/kommunikacio/postaladaelemek/kuka"
    deleteMessage = "/api/v1/kommunikacio/postaladaelemek/torles"

Getting current API links

Useful so that if the api links change you don't have to update your app.

(found by thegergo02)

Response from server:

{
  "GlobalMobileApiUrlDEV": "https://kretaglobalmobileapidev.ekreta.hu/",
  "GlobalMobileApiUrlTEST": "https://kretaglobalmobileapitest.ekreta.hu",
  "GlobalMobileApiUrlUAT": "https://kretaglobalmobileapiuat.ekreta.hu",
  "GlobalMobileApiUrlPROD": "https://kretaglobalmobileapi2.ekreta.hu"
}

Technically it is available from a normal browser as well.

Getting list of all Kreta schools

May not work in languages with no lowercase header request, like Swift and Dart, see BoA's note.

curl "https://kretaglobalmobileapi2.ekreta.hu/api/v3/Institute" -H "apiKey: 7856d350-1fda-45f5-822d-e1a2f3f1acf0"

Response from server

[
    {
        "instituteId": 0000,
        "instituteCode": "xxxxxxxxxxx",
        "name": "Xxxxx Xxxx Xxxxxx",
        "city": "Xxxxxx",
        "url": "https://xxxxxxxxxxx.e-kreta.hu",
        "advertisingUrl": "",
        "informationImageUrl": "https://kretamobile.blob.core.windows.net/advertisement/nati_app.gif",
        "informationUrl": "",
        "featureToggleSet": {}
    },
    ...
]

Access & Refresh token

Access token

Returns a Bearer authenticator to be used later for most requests.

NOTE: Sometimes it seems to return a 502 error, not sure why or if it's a problem I can fix.

NOTE: To simplify the X-AuthorizationPolicy-Key and X-AuthorizationPolicy-Nonce header information, please refer to the kreta_v2.py file.

curl "https://idp.e-kreta.hu/connect/token" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -H "X-AuthorizationPolicy-Key: xxx" -H "X-AuthorizationPolicy-Version: v2" -H "X-AuthorizationPolicy-Nonce: xxx" -d "userName=xxxxxxxx&password=xxxxxxxxx&institute_code=xxxxxxxxx&grant_type=password&client_id=kreta-ellenorzo-mobile-android"

Response from server:

{
 "access_token":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 "refresh_token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
 ...
}

Refresh token

With grant_type=refresh_token you can then refresh your access token:

curl "https://idp.e-kreta.hu/connect/token" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -d "institute_code=xxxxxxxxx&refresh_token=xxxxxxxxxxxx&grant_type=refresh_token&client_id=kreta-ellenorzo-mobile-android"

Messages

Get all messages

Requires the same headers as all GET requests, but also needs an endpoint that can be beerkezett, elkuldott or torolt.

curl "https://eugyintezes.e-kreta.hu/api/v1/kommunikacio/postaladaelemek/$type" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -H "Authorization: Bearer xxxxxxxx"

Response from server:

[
	{
		"azonosito": 0000000,
		"uzenetAzonosito": 000000,
		"uzenetKuldesDatum":"1970-01-01T00:00:00",
		"uzenetFeladoNev":"Xxxxx Xxxxx",
		"uzenetFeladoTitulus":"xxxxxxxxxx",
		"uzenetTargy":"xxxxxxxxx",
		"hasCsatolmany":false,
		"isElolvasva":true
	},
   ...
]

Get information about a specific message

The above method is limited in message length (I think to 100 characters), so this gets more info about a specific messages denoted by it's numeric id.

curl "https://eugyintezes.e-kreta.hu/api/v1/kommunkacio/postaladaelemek/$ID" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -H "Authorization: Bearer xxxxxxxx"

Important notes:

  • cimzettLista can have either a student or a class value (as far as I can tell).

Response from server:

{
	"azonosito": 0000000,
	"isElolvasva":true,
	"isToroltElem":false,
	"tipus": {
		"azonosito":1,
		"kod":"BEERKEZETT",
		"rovidNev":"Beérkezett üzenet",
		"nev":"Beérkezett üzenet",
		"leiras":"Beérkezett üzenet"
	},
	"uzenet": {
		"azonosito":0000000,
		"kuldesDatum": "1970-01-01T00:00:00",
		"feladoNev":"Dudás Attila",
		"feladoTitulus":"igazgató h.",
		"szoveg":"...",
		"targy":" Tájékoztató ",
		"statusz": {
			"azonosito":2,
			"kod":"KIKULDVE",
			"rovidNev": "Kiküldve",
			"nev":"Kiküldve",
			"leiras":"Kiküldve"
		},
		"cimzettLista": 
		[
			{
				"azonosito": 0000000,
				"kretaAzonosito": 00000,
				"nev":"9.A",
				"tipus": {
					"azonosito":4,
					"kod":"OSZTALY_TANULO",
					"rovidNev":"Osztály - Tanuló",
					"nev":"Osztály - Tanuló",
					"leiras":"Osztály - Tanuló"
				}
			},
			{
				"azonosito":0000000,
				"kretaAzonosito": 000000,
				"nev": "Xxxxxxx Xxxxxxx",
				"tipus": {
					"azonosito":9,
					"kod":"TANAR",
					"rovidNev":"Tanár",
					"nev":"Tanár",
					"leiras":"Tanár"
				}
			},
			...
		],
		"csatolmanyok": [
			{
	                    "azonosito": 0000000,
	                    "fajlNev": "xxxxxxx.xxx"
	                },
			...
		]
	}
}

Marking message as read

not sure yet

Get pre-announced tests & exams

curl "https://"$ist".e-kreta.hu/ellenorzo/V3/Sajat/BejelentettSzamonkeresek?datumTol=null" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -H "Authorization: Bearer xxxxxxxx"

Important notes:

  • datumTol is an optional parameter, without it the server returns all.
  • I only have irasbeli_temazaro_dolgozat as a type, but logically there should be stuff like szobeli_feleles and others.

Response from server:

[
  {
    "BejelentesDatuma": "1970-01T00:00:00Z",
    "Datum": "2019-10-08T22:00:00Z",
    "Modja": {
      "Uid": "0000,irasbeli_temazaro_dolgozat",
      "Leiras": "Írásbeli témazáró dolgozat",
      "Nev": "irasbeli_temazaro_dolgozat"
    },
    "OrarendiOraOraszama": 1,
    "RogzitoTanarNeve": "Kókai Mária",
    "TantargyNeve": "Mathematics",
    "Temaja": "Combinatorics and graphs",
    "OsztalyCsoport": {
      "Uid": "88429"
    },
    "Uid": "784"
  },
]

Get information about student

Used to be together with absences & evaluations, but has it since been separated with v2.

curl "https://"$institute".e-kreta.hu/ellenorzo/V3/Sajat/TanuloAdatlap" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -H "Authorization: Bearer xxxxxxxx"

Important notes:

  • "SzuletesiDatum" represents 00:00 of the given date, but is in UTC time: YYYY-MM-(DD-1)T23:00:00Z.
  • "TestreszabhatoBeallitasok" shows if the school allows things like student-submitted homeworks, showing themes of lessons, displaying class averages or even a global delay in evaluations showing up for whatever reason.

Response from server

{
  "AnyjaNeve": "Xxxxxx Xxxxxx",
  "Cimek": [
    "City (Postcode), Street Number",
    "Xxxx (0000), Xxxxxx street 0"
  ],
  "Gondviselok": [
    {
      "EmailCim": "[email protected]",
      "Nev": "Xxxxxxx Xxxxxx",
      "Telefonszam": "+xxxxxxxxxxx",
      "IsTorvenyesKepviselo": true,
      "Uid": "xxxxx"
    }
  ],
  "IntezmenyAzonosito": "xxxxxxxxxx",
  "IntezmenyNev": "Xxxxxxxxxx Xxxxxxxxx",
  "Nev": "Xxxxx Xxxxx Xxxxx",
  "SzuletesiDatum": "2002-12-02T23:00:00Z",
  "SzuletesiEv": 2002,
  "SzuletesiHonap": 12,
  "SzuletesiNap": 02,
  "SzuletesiHely": "Xxxxxxx XX Xxxxx",
  "SzuletesiNev": "Xxxxx Xxxxx Xxxxx",
  "TanevUid": "0000",
  "Uid": "000000",
  "Bankszamla": {
    "BankszamlaSzam": null,
    "BankszamlaTulajdonosTipusId": null,
    "BankszamlaTulajdonosNeve": null,
    "IsReadOnly": false
  },
  "Intezmeny": {
    "Uid": "0000",
    "RovidNev": "xxxxxxxxxx",
    "Rendszermodulok": [
      {
        "IsAktiv": true,
        "Tipus": "Eugyintezes"
      }
    ],
    "TestreszabasBeallitasok": {
      "IsDiakRogzithetHaziFeladatot": false,
      "IsTanorakTemajaMegtekinthetoEllenorzoben": true,
      "IsOsztalyAtlagMegjeleniteseEllenorzoben": false,
      "ErtekelesekMegjelenitesenekKesleltetesenekMerteke": 0,
      "KovetkezoTelepitesDatuma": "2021-05-04T19:00:00Z"
    }
  }
}

Get Evaluations, Absences & Timetable

$endpoint refers to the data requested: Ertekelesek/Mulasztasok/OrarendElemek.

datumTol & datumIg is required for timetable, while optional for the other two.

curl "https://"$institute".e-kreta.hu/ellenorzo/V3/Sajat/"$endpoint"?datumTol=2020-09-01T00-00-00&datumIg=2020-09-08T00-00-00" -A "hu.ekreta.tanulo/1.0.5/Android/0/0" -H "Authorization: Bearer xxxxxxxx"

Responses from server:

- Evaluations:

[
	{
	    "ErtekeloTanarNeve": "Xxxxx Xxxxx",
	    "ErtekFajta": {
	      "Uid": "0,Osztalyzat",
	      "Leiras": "Elégtelen (1) és Jeles (5) között az öt alapértelmezett érték",
	      "Nev": "Osztalyzat"
	    },
	    "Jelleg": "Ertekeles",
	    "KeszitesDatuma": "1970-01-01T00:00:00Z",
	    "LattamozasDatuma": null,
	    "Mod": {
	      "Uid": "0000,type_of_eval",
	      "Leiras": "Type of Eval",
	      "Nev": "type_of_eval"
	    },
	    "RogzitesDatuma": "1970-01-01T00:00:00Z",
	    "SulySzazalekErteke": 100,
	    "SzamErtek": 0,
	    "SzovegesErtek": "Szöveg(0)",
	    "SzovegesErtekelesRovidNev": null,
	    "Tantargy": {
	      "Uid": "000000",
	      "Kategoria": {
	        "Uid": "0000,subject",
	        "Leiras": "Subject",
	        "Nev": "subject"
	      },
	      "Nev": "Subject"
	    },
	    "Tema": "...",
	    "Tipus": {
	      "Uid": "0000,evkozi_jegy_ertekeles",
	      "Leiras": "Évközi jegy/értékelés",
	      "Nev": "evkozi_jegy_ertekeles"
	    },
	    "OsztalyCsoport": {
	      "Uid": "00000"
	    },
	    "Uid": "00000000,Ertekeles"
	},
	...
]

Important Notes:

  • type_of_eval seems to have the same values possible as Pre-Announced
  • Leiras looks to be the way to differentiate mid/half/endyear grades
  • SulySzazalekErteke is usually 100/200, but I've seen end of term grades registered at 150 so it's better to code it flexibly.

- Absences

[
	{
	    "IgazolasAllapota": "Igazolt",
	    "IgazolasTipusa": {
	      "Uid": "0000,szuloi_igazolas",
	      "Leiras": "Szülői igazolás",
	      "Nev": "szuloi_igazolas"
	    },
	    "KesesPercben": null,
	    "KeszitesDatuma": "1970-01-01T00:00:00Z",
	    "Mod": {
	      "Uid": "1,Tanorai",
	      "Leiras": "Tanórai mulasztás",
	      "Nev": "Tanorai"
	    },
	    "Datum": "1970-01-01T00:00:00Z",
	    "Ora": {
	      "KezdoDatum": "1970-01-01T08:30:00Z",
	      "VegDatum": "2020-09-01T00:00:00Z",
	      "Oraszam": 5
	    },
	    "RogzitoTanarNeve": "Xxxxx Xxxxx",
	    "Tantargy": {
	      "Uid": "000000",
	      "Kategoria": {
	        "Uid": "0000,subject_name",
	        "Leiras": "Subject Name",
	        "Nev": "subject_name"
	      },
	      "Nev": "subject name"
	    },
	    "Tipus": {
	      "Uid": "0000,hianyzas",
	      "Leiras": "Hiányzás",
	      "Nev": "hianyzas"
	    },
	    "OsztalyCsoport": {
	      "Uid": "00000"
	    },
	    "Uid": "00000000"
	},
	...
] 

Important notes:

  • Oraszam refers to the index of the lesson starting from 1.
  • Leiras again likely has a multitude of possible values that I cannot test.

- Timetable

[
  {
    "Allapot": {
      "Uid": "1,Naplozott",
      "Leiras": "Naplózott",
      "Nev": "Naplozott"
    },
    "BejelentettSzamonkeresUids": [],
    "BejelentettSzamonkeresUid": null,
    "Datum": "1970-01-01T00:00:00Z",
    "HelyettesTanarNeve": null,
    "IsTanuloHaziFeladatEnabled": false,
    "KezdetIdopont": "1970-01-01T00:00:00Z",
    "Nev": "xxxxxxx",
    "Oraszam": 0,
    "OraEvesSorszama": 0,
    "OsztalyCsoport": {
      "Uid": "000000",
      "Nev": "xxx xxx xxx"
    },
    "HaziFeladatUid": null,
    "IsHaziFeladatMegoldva": false,
    "TanarNeve": "Xxxxx Xxxxxx",
    "Tantargy": {
      "Uid": "000000",
      "Kategoria": {
        "Uid": "0000,xxxx_xxxx",
        "Leiras": "Xxxxx Xxxx",
        "Nev": "xxxx_xxxx"
      },
      "Nev": "Spanish"
    },
    "TanuloJelenlet": {
      "Uid": "0000,Xxxxx",
      "Leiras": "...",
      "Nev": "Xxxx"
    },
    "Tema": "...",
    "TeremNeve": "xxx",
    "Tipus": {
      "Uid": "0,XxxxxXxxx",
      "Leiras": "Xxxx Xxxx",
      "Nev": "XxxxxXxxx"
    },
    "Uid": "0000000,Xxxxxxxx,1970-01-01T00:00:00Z",
    "VegIdopont": "1970-01-01T00:15:00Z"
  },
  ...
]

Everything else

I've only listed and examplified what I think is probably the most used parts, or ones with peculiarities.

Everything else listed in the classes that's not mentioned should follow the same header format as seen above.

Contributions & Questions welcome.

ekreta-docs-v3's People

Contributors

bczsalba avatar daaniiieel avatar fightman01 avatar manen avatar moldender avatar mtlhdnrd avatar samunemeth avatar szimszon avatar thebluelines avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ekreta-docs-v3's Issues

invalid_grant a token refresh-elésekor

Sziasztok! Amikor refreshelni akarom a tokent invalid_grant hibát kapok, átnéztem a dokumentációt és nem találtam benne hibát, valószínűleg valami változott a kréta API-ával mert a dokumentációból kimásoltam a curl parancsot is és ott is ugyan azt a hibát kaptam. valószínű hogy én rontok el valamit mert egyszer sikerült a curl parancs segítségével refresh-elnem a token-t. Kell várni arra hogy a token lejárjon vagy instant lehet refresh-elni a token-t? Mivel össze-vissza módosítgattam már a kódot ezért gondoltam a kód nagyobb részét elküldöm.

Config fájl kinézete:

{
    "username": "KretaUser",
    "password": "KretaPass",
    "schoolID": "klik0000000",
    "token": "access_token",
    "rToken": "refresh_token"
}

Kód részlet:

import requests,json,hmac,base64,hashlib

with open('config.json') as config_file:
    config = json.load(config_file)

class Kreta:
    def base(ist):
        return f"https://{ist}.ekreta.hu"
    IDP = "https://idp.e-kreta.hu"
    ADMIN = "https://eugyintezes.e-kreta.hu"
    FILES = "https://files.e-kreta.hu"

class KretaEndpoints:
    token = "/connect/token"
    nonce = "/nonce"

class User:
    def __init__(self,usr,pwd,ist,fromDate=None,toDate=None):
        self.usr = usr
        self.pwd = pwd
        self.ist = ist
        
        # userAgent and clientID
        self.userAgent = "hu.ekreta.student/1.0.5/Android/0/0"
        self.clientID = "kreta-ellenorzo-mobile-android"

        self.bearer = self.getToken()
        
        # headers used for operation other than token
        self.headers = {
            "Authorization": f"Bearer {self.bearer}",
            "User-Agent": self.userAgent
        }

    def getToken(self):
        # gets access token
        # headers: special to token
        key = bytes([98, 97, 83, 115, 120, 79, 119, 108, 85, 49, 106, 77])
        nonce = (requests.get(Kreta.IDP+KretaEndpoints.nonce)).text
        message = bytes(self.ist.upper()+nonce+self.usr.upper(), 'utf-8')
        dig = hmac.HMAC(key, message, hashlib.sha512).digest()
        generated = base64.b64encode(dig).decode()
        headers = {"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
                "User-Agent": "hu.ekreta.student/1.0.5/Android/0/0", 
                "X-AuthorizationPolicy-Key" : generated, 
                "X-AuthorizationPolicy-Version" : "v2", 
                "X-AuthorizationPolicy-Nonce" : nonce}

        # If rToken (refresh_token) exist
        if 'rToken' in config:
            # data to send
            data = {
                "institute_code": self.ist,
                "refresh_token": config['rToken'],
                "grant_type": "refresh_token",
                "client_id": self.clientID
            }
        else:
            # data to send
            data = {
                "userName": self.usr,
                "password": self.pwd,
                "institute_code": self.ist,
                "grant_type": "password",
                "client_id": self.clientID
            }
        
        print(data)
        
        # url: https://idp.e-kreta.hu/connect/token
        response = requests.post(
                Kreta.IDP+
                KretaEndpoints.token,
                headers=headers,
                data=data
        )

        try:
            return json.loads(response.text)
        except KeyError:
            # occasionally it gives a 502 error
            return response.text

Bearer token: invalid_request

Nem tudom tud-e nekem valaki segíteni?

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "User-Agent: hu.ekreta.student/1.0.5/Android/0/0" -d 'userName=xxxxxxxx&password=xxxxxxxxx&institute_code=xxxxxxxxx&grant_type=password&client_id=kreta-ellenorzo-mobile' https://idp.e-kreta.hu/connect/token

bearer token request nekem:

{"error":"invalid_request"}

-et ad ;(

Mit rontok el?

Response: 301 Moved Permanently

Szia!

Nagyon örülök, hogy felujítottad boa dokumentációját! Viszont amikor valamit le szeretnék kérdezni curl-lel a Bearer kódon kívül Ezt kapom:

Futtatott kód: curl -H "Authorization: Bearer $Bearer" -H 'User-Agent: hu.ekreta.student/1.0.5/Android/0/0' "https://klik035327001.ekreta.hu/ellenorzo/V3/Sajat/OrarendElemek"

Eredmény:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Van valami ötleted hogy miért történik ez?

Teacher Data

Sziasztok!

Tudnátok benne segíteni, hogy a tanárok adatait hogyan lehet az API-n keresztül lekérni? Diák adatlapot sikerült, de tanári adatlapot sajnos nem.

Köszi előre is, ha tudtok segíteni.

Erros

Sziasztok! Nodejs-be át alakítottam az egészet és folyamatosan ezt a hibát kapom:

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

Node.js v20.10.0

Itt tudjátok megnézni a kódot: https://github.com/B3ni15/kreta-apis

image

Egyszer kaptam "jó" választ akkor is ezt volt a hiba:

  [Symbol(kErroredValue)]: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: bgeszc-eotvos.ekreta.hu. is not in the cert's altnames: DNS:*.e-kreta.hu, DNS:e-kreta.hu
              at Object.checkServerIdentity (node:tls:337:12)
              at TLSSocket.onConnectSecure (node:_tls_wrap:1684:27)
              at TLSSocket.emit (node:events:514:28)
              at TLSSocket._finishInit (node:_tls_wrap:1085:8)
              at ssl.onhandshakedone (node:_tls_wrap:871:12) {
            code: 'ERR_TLS_CERT_ALTNAME_INVALID',
            reason: "Host: bgeszc-eotvos.ekreta.hu. is not in the cert's altnames: DNS:*.e-kreta.hu, DNS:e-kreta.hu",
            host: 'bgeszc-eotvos.ekreta.hu',
            cert: [Object]
          }
   },

image

Szóval itt gondoltam hogy ekreta helyett e-kreta kell!

Majd még írok ha van valami változás...

invalid_client probléma - pontosan mit is jelent ez?

Sziasztok! Az invalid_client hiba a clientId-ra vonatkozik vagy csak egy rosszul megfogalmazott hiba ami arra utal, hogy elutasítja a kérést a klienstől ami a kérést küldte? (bár akkor már invalid_request-et kéne dobjon, nem?).

Az alábbi kódom elméletben működik, de a gyakorlatban a fent említett invalid_client hibát kapom vissza. Én a HMAC aláírós részre gyanakszok, nem értek hozzá, szóval simán lehet, hogy ott bukik el a dolog.

Releváns kód részlet: https://github.com/WilliamNT/JavaKreta_Wrapper

Átlag lekérése a mobil api segítségével

Sziasztok!

1-2 hónapja elkezdtem egy discord botot és abba szerettem volna egy átlag lekérési funkciót, habár ez nem működött annyira hiszen ez csak fogja a jegyeket és hogy mennyi van belőlük és elosztja őket, a súlyszázalékot nem tudtam megoldani. Viszont nemrég kísérletezgettem a weboldalon lévő api-okkal, de azok cookie-s azonosítást használtak sok helyen. De találtam egy postmanes dokumentációt és látván hogy nincs átlag / az osztályátlag nem működik gondoltam megmutatom amit találtam (hisz a postmanes nem teljesen működött).

headers:

{
'Authorization': xxxxxx (acces token),
'Accept-Encoding': 'gzip, gzip',
'Accept': 'application/json',
'User-Agent': 'hu.ekreta.student',
'Host': 'xxxxxxx.e-kreta.hu',
}

a request: https://xxxxxxx.e-kreta.hu:443/mapi/api/v1/TantargyiAtlagAmi

és nemtudom de nekem egy sima access tokennel nem működött szóval itt van az access token requestje:

headers:

{
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'hu.ekreta.student/1.0.5/Android/0/0',
}

data:

{
'userName': xxxxxx,
'password': xxxxxxx,
'institute_code': xxxxxx,
'grant_type': 'password',
'client_id': '919e0c1c-76a2-4646-a2fb-7085bbbf3c56' #ez mindenkinél ugyanaz
}

a request: https://xxxxxxx.e-kreta.hu/idp/api/v1/Token

és még egy pár sor kóddal 100%ig pontosan tudtam mutatni mindenki átlagát :D
(még kezdő vagyok az api-okkal kapcsolatban, ha valami kérdésetek van írjatok)

just a question

What/Who is the Admin that can use Admin endpoints? a Teacher a system admin a principal or who?

Valaki megtudná mondani hogyan tudok üzenetet küldeni?

Tehát azt értem hogy hogy megvan az endpoint AdminEndpoints osztály alatt, de hogyan és milyen formátumban küldjek adatot?
Formátum alatt arra gondolok hogy JSON? Ha igen, hogyan nézzen ki ez a JSON?

Előre is köszi!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.