- Gaps Notifier provides notifications to multiple users around gaps
- Gaps is an Academical Planning System
-
This api is meant to notify users when events happen in gaps
-
This api is run by users for users, which means that it can't notify anyone if no data is fed into it
-
To automatize this data feeding, the gaps-cli or the gaps-scraper can be used
- A new event is detected
- A POST request is done to the REST API
- The subscribers to this particular event are notified through webhooks
- Integration with discord is very easily done since the gaps-notifier-api uses webhooks to notify users of events. Check this stackoverflow thread
- Since this application relies on information input from users to be useful, we highly recommend using the already hosted instance. This allows you to benefit from the collective contributions of all users, enhancing the utility and value of the application.
-
This application is currently being hosted by Lutonite.
-
If you wish to use it, please write me or Lutonite an email and we'll gladly create a user for you.
POST
/api/token
(Retrieves an access token)
name type data type description None required object JSON { user_id: <user_id>}
http code content-type response 200
application/json
{"access_token": <access_token>, "token_type": "Bearer", "expiration_timestamp": <expiration_timestamp>}
404
application/json
{"error":"Invalid User"}
curl -X POST -H "Content-Type: application/json" -d '{"user_id": <user_id>}' <url>/api/token
POST
/api/subscribe
(Subscribes to one course)
name type data type description None required object JSON {"course": <course_name>, "class": <class_identifier>, "webhook_url": <webhook_url>"}
http code content-type response 200
application/json
{"user":{"id":<user_id>}, "course": <course_identifier>, "class": <class_identifier> "webhook_url": <webhook_url>
400
application/json
{"error":"Invalid token"}
400
application/json
{"error":"Missing credentials"}
422
text/plain; charset=utf-8
<Error Message about missing attributes>}
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <bearer_token>" -d '{"course": <course_name>, "class": <class_identifier", "webhook_url": "<webhook_url>"}' <url>/subscribe
POST
/api/subscribe/all
(Subscribes to every course)
name type data type description None required object JSON {"webhook_url": <webhook_url>}
http code content-type response 200
application/json
{"user":{"id":<user_id>}, "webhook_url": <webhook_url>
400
application/json
{"error":"Invalid token"}
400
application/json
{"error":"Missing credentials"}
422
text/plain; charset=utf-8
<Error Message about missing attributes>}
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <bearer_token>" -d '{"webhook_url": "<webhook_url>"}' <url>/subscribe/all
POST
/api/grade
(Submits a grade)
name type data type description None required object JSON {"name": <grade_identifier>, "course": <course_name>, "class": <class_identifier>, "class_average": <grade_class_average>}
http code content-type response 201
text/plain; charset=utf-8
Grade Created
409
text/plain; charset=utf-8
Grade already exists
400
application/json
{"error":"Invalid token"}
400
application/json
{"error":"Missing credentials"}
422
text/plain; charset=utf-8
<Error Message about missing attributes>}
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <bearer_token>" -d '{"course":<course_name>, "class":<class_identifier>, "name":<grade_identifier>, "class_average": <grade_class_average>}' <url>/api/grade
POST
/api/user
(Creates a new user)
- No parameters
http code content-type response 200
application/json
{"id": <user_id>}
400
application/json
{"error":"Invalid token"}
400
application/json
{"error":"Missing credentials"}
401
`` <Unauthorized>
curl -X POST -H "Authorization: Bearer <admin_token>" <url>/api/user
- A docker image is available here
- redis
- Environnement variables:
JWT_SECRET
ADMIN_TOKEN
REDIS_URL
Admin token is the static bearer token for admin usage
This application is licensed under the GNU General Public License v3.0. It is open to everyone to use and modify as they wish, in accordance with the license's terms and conditions.