Code Monkey home page Code Monkey logo

pronote-api-client-java's Introduction

Pronote API Java client

Un client pour l'API Pronote en Java

Import

Gradle

repositories {
    maven {
        url 'https://litarvan.github.io/maven'
    }
}

dependencies {
    implementation 'fr.litarvan:pronote-api:1.0.0'
}

Maven

<dependency>
    <groupId>fr.litarvan</groupId>
    <artifactId>pronote-api</artifactId>
    <version>1.0.0</version>
</dependency>

Utilisation

La requête login est optionnelle, si elle n'est pas faite, la requête fetch la fera au passage.

Une erreur RequestException peut être lâchée par les deux fonctions en cas d'erreur de connexion ou de lecture. Si une erreur autre que "Mauvais identifiants" est renvoyée, merci d'ouvrir une issue sur l'API Pronote.

PronoteAPI api = new PronoteAPI("http://127.0.0.1:21727/");

try {
    api.login(new LoginRequest("username", "password", "pronote url", "cas");
} catch (RequestException e) {
    ... // Mauvais identifiants
}

FetchResponse response = api.fetch(new FetchResponse("username", "password", "pronote url", "cas");
System.out.println(String.format("Welcome %s !", response.getName()));

pronote-api-client-java's People

Contributors

litarvan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pronote-api-client-java's Issues

FileNotFoundException (Support sans SSL?)

Hey !

J'aimerais faire un client alternatif pour Pronote sur Android, donc j'ai utilisé cette libraire, mais je n'arrive pas à me connecter à Pronote, à chaque fois ça me donne une erreur FileNotFoundException, j'ai essayé les URL suivantes :

  • http://194.167.101.79
  • http://194.167.101.79/pronote
  • http://194.167.101.79/pronote/
  • http://194.167.101.79/pronote/eleve.html

Précision: voilà l'URL qui est dans le navigateur si je me connecte normalement
http://194.167.101.79/pronote/eleve.html?identifiant=XXXXXX

Voilà le code : https://hastebin.com/mucosukobi.swift

Les seules parties intéressantes selon moi sont

            EditText v_pronote_url = getActivity().findViewById(R.id.field_pronote_url);
            String pronote_url = v_pronote_url.getText().toString();

            EditText v_username = getActivity().findViewById(R.id.field_username);
            String username = v_username.getText().toString();

            EditText v_password = getActivity().findViewById(R.id.field_password);
            String password = v_password.getText().toString();

et

                PronoteAPI api = new PronoteAPI(pronote_url);
                api.login(new LoginRequest(username, password, pronote_url));

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.