Skip to content

CactusKipic/RESTProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTProject

Projet d'API REST, 4 ème année cycle ingénieur ESIEA

Titouan Wattelet

Clément Azan


ACCES BDD pour consultation :


Exemple d'utilisation :

Consultation des sondages existants :

Inscription :

Connexion :

On créé un sondage :

On consulte la liste de nos sondages :

On ajoute des éléments de réponse à notre sondage (pour que les utilisateurs puissent voter) :

On consulte la liste des propositions de réponses de notre sondage :

On vote pour une proposition de réponse dans un sondage :

On retourne consulter la liste des sondages existants, on constate que notre sondage, ainsi que nos propositions de réponses et notre vote ont bien été ajoutés :

Une page html a été mise en place pour afficher la liste des sondages : https://apiweb.cactus-industries.fr/test.html


Liste des requêtes API disponibles :

==========================================

CONNEXION/COMPTE:

  • /LogIn <user> <pass>
  • Res: {"status"=str,"token"=str,"expiration"=long}
  • /Renew <token>
  • Res: {"status"=str,"token"=str,"expiration"=long}
  • /TestToken <token>
  • Res: {"status"=str,"token"=str,"expiration"=long}
  • /Register <mail> <user> <pass>
  • Res: {"status"=str}
  • /AccountInfo <token>
  • Res: {"status"=str,"mail"=str,"login"=str}
  • /AccountUpdate <token> <pass> [mail] [user] [newPass]
  • Res: {"status"=str}

==========================================

SONDAGE :

  • /sondage/create <nom> <description> <token> <prive>
  • Res: {"status"=str}
  • /sondage/delete <id> <token>
  • Res: {"status"=str}
  • /sondage/getPublicSurveyById <id>
  • Res: {"id"=int,"nom"=str,"description"=str,"authorId"=int,"sondagePrive"=int,"propositionList"=[{"id"=int,"associatedId"=int,"lieu"=str,"date"=str,"votelist"=[{"id"=int,"associatedProposition"=int,"associatedUser"=int},...]},...]}
  • /sondage/getMySurveyById <token>
  • Res: {"id"=int,"nom"=str,"description"=str,"authorId"=int,"sondagePrive"=int,"propositionList"=[{"id"=int,"associatedId"=int,"lieu"=str,"date"=str,"votelist"=[{"id"=int,"associatedProposition"=int,"associatedUser"=int},...]},...]}
  • /sondage/listOfMySurveys <token>
  • Res: {"status"=str,"list"=[{"id"=int,"nom"=str,"description"=str,"authorId"=int,"sondagePrive"=int,"propositionList"=[{"id"=int,"associatedId"=int,"lieu"=str,"date"=str,"votelist"=[{"id"=int,"associatedProposition"=int,"associatedUser"=int},...]},...]}
  • /sondage/getAllPublicSurveys
  • Res: {"status"=str,"list"=[{"id"=int,"nom"=str,"description"=str,"authorId"=int,"sondagePrive"=int,"propositionList"=[{"id"=int,"associatedId"=int,"lieu"=str,"date"=str,"votelist"=[{"id"=int,"associatedProposition"=int,"associatedUser"=int},...]},...]}

===========================================

PROPOSITION DE VOTE:

  • /proposition/add <associatedSurvey> <lieu> <date> <token>
  • Res: {"status"=str}
  • /proposition/remove <id> <token>
  • Res: {"status"=str}
  • /proposition/listOfPropositionsForSondage <associatedSurvey>
  • Res: {"status"=str,"list"=[{"id"=int,"associatedId"=int,"lieu"=str,"date"=str,"votelist"=[{"id"=int,"associatedProposition"=int,"associatedUser"=int},...]},...]}

===========================================

VOTE:

  • /vote/add <associatedProposition> <token>
  • Res: {"status"=str}
  • /vote/remove <id> <token>
  • Res: {"status"=str}
  • /vote/listOfVotesForProposition <associatedProposition>
  • Res: {[{"id"=int,"associatedProposition"=int,"associatedUser"=int},...]}

Les Erreurs

Générique:

  • ERROR: An error occurred (no more info)
  • TOKEN INVALID: Token has expired or doesn't exist
  • NO AUTHOR: Author not found

==========================================

Connexion/Compte:

  • ERROR: Login already exist
  • BAD LOGIN: Wrong User or Password
  • ACCOUNT NOT FOUND: This account hasn't been found
  • INVALID MAIL: The mail entered is not a valid mail
  • INVALID USER: The username entered doesn't match the requirements
  • INVALID PASS: The pass entered doesn't match the requirements
  • NO CHANGE: No change requested

==========================================

Sondage:

  • INVALID SONDAGE ID: ID of sondage not found
  • PERMISSION DENIED: You are not the author of this sondage, you can't modified it

==========================================

Proposition vote:

  • INVALID PROPOSITION ID: ID of proposition not found

==========================================

Vote:

  • INVALID VOTE ID: ID of vote not found
  • ALREADY VOTED: You can't vote because you have already voted for this sondage

About

ESIEA Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published