-
Notifications
You must be signed in to change notification settings - Fork 5
API Documentation
Some GET
methods support pagination, filtering, sorting, and selecting. To achieve using these features you can look at these examples below.
Student has the lowest permission. Staff has the second lowest permission. Above permissions is granted to specific users of the system.
If you find any error or any malfunction on the system please report it, or make a pull request to fix it.
Methods except GET
returns status codes:
- 200 on success
- 404 on not found error
- 401 on authentication error
- 400 on token error
- 500 on method error
Auth required : If the announcement is not public it requires authentication otherwise Student permission is required.
Supports: Selecting
GET /announcements/:id
Returns an Announcement.
Example:
curl -X GET \
-H "Content-Type:application/json" \
api.it.teithe.gr/announcements/ID
Auth required : Yes
Permission required : Student member or above.
Supports: Pagination, Filtering, Sorting, Selecting
GET /announcements
Returns an array of all the Announcements.
Example:
curl -X GET \
-H "x-access-token: ACCESS_TOKEN" \
-H "Content-Type:application/json" \
api.it.teithe.gr/announcements
GET /announcements/feed/:type/:categoryIDs
Field | Description | Required |
---|---|---|
type |
The format of the response.Valid values: json ,rss ,atom
|
yes |
categoryIDs |
The categories of the announcements,separated by comma | no |
Example:
curl -X GET \
-H "Content-Type:application/json" \
api.it.teithe.gr/announcements/feed/atom
GET /announcements/public
Returns an array of all public Announcements.
Example:
curl -X GET \
-H "Content-Type:application/json" \
api.it.teithe.gr/announcements/public
POST /announcements
Form data:
Field | Description | Required |
---|---|---|
title |
The title of the announcement in Greek | yes |
titleEn |
The title of the announcement in English | yes |
text |
The content of the announcement in Greek | yes |
textEn |
The content of the announcement in English | yes |
about |
The id of the category that belongs | yes |
publisher |
The info of the publisher | no |
uploads |
The files uploaded to the announcement | no |
Note: Only professors can access this.
Example:
curl -X POST \
-H "x-access-token: ACCESS_TOKEN" \
-H "Content-Type:application/json" \
-d '{"title":"Test", "titleEn": "Test", "text":"This is the text.", "textEn": "This is the english text.", "about":"CATEGORY ID"}' \
api.it.teithe.gr/announcements/
PATCH /announcements/:id
Form data:
Field | Description | Required |
---|---|---|
title |
The title of the announcement in Greek | yes |
titleEn |
The title of the announcement in English | no |
text |
The content of the announcement in Greek | no |
textEn |
The content of the announcement in English | no |
about |
The id of the category that belongs | no |
publisher |
The info of the publisher | no |
uploadsEdit |
The files uploaded to the announcement | no |
Note: Only the creator of the announcement can edit the announcement.
Example:
curl -X PATCH \
-H "x-access-token: ACCESS_TOKEN" \
-H "Content-Type:application/json" \
-d '{"title":"Test 222222222222 EDIT"}' \
api.it.teithe.gr/announcements/ANNOUNCEMENT_ID
DELETE /announcements/:id
Note: Only the creator of the announcement can delete the announcement.
Example:
curl -X DELETE \
-H "x-access-token: ACCESS_TOKEN" \
-H "Content-Type:application/json" \
api.it.teithe.gr/announcements/ANNOUNCEMENT_ID
Auth required : Yes
Permission required : Student member or above.
Supports: Pagination, Filtering, Sorting, Selecting
GET /categories/
Returns an array of all Categories.
Example:
curl -X GET \
-H "x-access-token: ACCESS_TOKEN" \
-H "Content-Type:application/json" \
api.it.teithe.gr/categories/
GET /categories/public
Returns an array of all public Categories.
Example:
curl -X GET \
-H "Content-Type:application/json" \
api.it.teithe.gr/categories/public
GET /categories/isRegistered
Returns all the categories`id with a boolean attribute that represents if registered.
Note: Only authenticated users can access this
PUT /categories/register
Form data:
Field | Description | Required |
---|---|---|
categoriesRegistered |
An array of categories`id that are registered | yes |
categoriesNotRegistered |
An array of categories`id that are not registered | yes |
POST /categories
Form data:
Field | Description | Required |
---|---|---|
CategoryTitle |
The title of the category | yes |
publicCategory |
A boolean that represents if a category is public | yes |
wid |
The content of the announcement in Greek | no |
POST /categories/:id
Form data:
Field | Description | Required |
---|---|---|
CategoryTitle |
The title of the category | yes |
publicCategory |
A boolean that represents if category is public | yes |
wid |
The content of the announcement in Greek | no |
Note: Only the creator of the category can update the category.
DELETE /categories/:id
Note: Only the creator of the category can delete the category.
Note: Files that are not public needs authentication
Auth required: If the file is public then it requires no authentication otherwise Student permission is required.
GET /files/:fileId
Returns the File data.
Auth required: If the files are public then it requires no authentication otherwise Student permission is required.
GET /files/:announcementId/downloadAll
Returns a zip of Files.
Auth required: If the files are public then it requires no authentication otherwise Student permission is required.
GET /files/:fileId/view
Returns the File data.
DELETE /files/:fileId
Note: Only the owner of the announcement can delete the file.
GET /profile
Returns the data of the Profile.
PATCH /profile
Form data:
Field | Description | Required |
---|---|---|
displayName;lang-el |
The name displayed to others | no |
labeledURI |
The website of the user | no |
telephoneNumber |
The phone number of the user | no |
secondarymail |
The secondary mail of the user | no |
description;lang-el |
The description of the user in Greek | no |
description |
The description of the user in English | no |
scientificField |
The fields that the user is interested | no |
facebook |
The url of the user`s facebook | no |
twitter |
The url of the user`s twitter | no |
github |
The url of the user`s github | no |
googlePlus |
The url of the user`s googlePlus | no |
linkedIn |
The url of the user`s linkedIn | no |
socialMediaExtra |
An array of elements with two values that represent the name of the social media and a url | no |
DELETE /profile/photo
GET /noty
Query data:
Field | Description | Required |
---|---|---|
fp |
The signature of the browser | yes |
Returns a Noty.
PATCH /noty
Form data:
Field | Description | Required |
---|---|---|
auth |
---- | yes |
browserFp |
The signature of the browser | yes |
endpoint |
---- | yes |
p256dh |
---- | yes |
DELETE /noty
Form data:
Field | Description | Required |
---|---|---|
browserFp |
The signature of the browser | no |
all |
Represents if should disable all noties | no |
POST /user/chpw
Form data:
Field | Description | Required |
---|---|---|
oldPassword |
The old password | yes |
newPassword |
The new password | yes |
POST /user/chmail
Form data:
Field | Description | Required |
---|---|---|
newMail |
The new mail | yes |
POST /user/reset
Form data:
Field | Description | Required |
---|---|---|
mail |
The mail of the user | yes |
username |
The username of the user | yes |
POST /user/reset/token
Form data:
Field | Description | Required |
---|---|---|
token |
The token retrieved by email | yes |
newPassword |
The new password | yes |
newPasswordVerify |
The new password (for verification reason) | yes |
GET /user/vcard/:uid
Param data:
Field | Description | Required |
---|---|---|
uid |
The uid of the user | yes |
Returns a vCard of the user
Auth required : Yes
Permission required : Student member or above
Supports: Filtering, Sorting, Selecting
GET /user
Returns an array of all Users (By default it only returns staff members)
GET /groups/:id
Param data:
Field | Description | Required |
---|---|---|
id |
The id of the group | no |
Returns an Group.
POST /groups
Form data:
Field | Description | Required |
---|---|---|
cn |
The name of the group | yes |
DELETE /groups
Form data:
Field | Description | Required |
---|---|---|
dn |
The path of the group | yes |
Attribute | Description |
---|---|
_id |
The ID of the announcement |
_about |
The id of the category that belongs |
titleEn |
The title of the announcement in English |
title |
The title of the announcement in Greek |
textEn |
The content of the announcement in English |
publisher |
The info of the publisher |
date |
The date that the announcement has been created |
attachments |
An array of Files`id attatched to the announcement |
Attribute | Description |
---|---|
_id |
The ID of the category |
name |
The name of the category in Greek |
nameEn |
The name of the category in English |
public |
Represents if the category is public |
Attribute | Description |
---|---|
_id |
The ID of the file |
name |
The name of file |
contentType |
The mimetype of the file |
data |
The content of the file |
_announcement |
The id of the announcement that the file is attatched to |
Attribute | Description |
---|---|
am |
The am of the user |
cn |
The fullname in english |
cn;lang-el |
The fullname in Greek |
description |
The description of the user in English |
description;lang-el |
The description of the user in Greek |
displayName |
The name that is shown to others in English |
displayName;lang-el |
The name that is shown to others in Greek |
eduPersonAffiliation |
The type of the user |
eduPersonEntitlement |
The |
eduPersonPrimaryAffiliation |
The category that the user belongs |
fathersname |
The name of the father in English |
fathersname;lang-el |
The name of the father in Greek |
givenName |
The name of the user in English |
givenName;lang-el |
The name of the user in Greek |
labeledURI |
The website of the user |
mail |
The mail of the user |
pwdChangedTime |
The date of the last password change |
regsem |
The semester of the user that has been registered |
regyear |
The year that the user has been registered |
secondarymail |
The secondary email of the user |
sem |
The current semester of the user |
sn |
The surname of the user in English |
sn;lang-el |
The surname of the user in Greek |
telephoneNumber |
The telephone number of the user |
title |
The title of the user in English |
title;lang-el |
The title of the user in Greek |
profilePhoto |
The profile photo of the user |
socialMedia |
The social media of the user |
Attribute | Description |
---|---|
_id |
The id of the noty |
auth |
-- |
browserFp |
The signature of the browser |
endpoint |
--- |
p256dh |
--- |
Attribute | Description |
---|---|
cn |
The name of the group |
dn |
The path of the group |
gidNumber |
The group Id |
objectClass |
The object classes that the group belongs |
Lets say you want to filter the results by searching the text that contains the string "123".
GET /example?q={"text":"123"}
Lets say you want to filter the results by searching the text that contains the string "123" and the title that contains the string "hello"
GET /example?q={"text":"123","title":"hello"}
Let's say you want to order the results by ordering the title descending.
GET /example?sort=-title
Let's say you want to order the results by ordering the title ascending.
GET /example?sort=title
Let's say you want to limit the results by 5 entries.
GET /example?pageSize=5
Let's say you want the next page of the results after limiting it by 5 entries.
GET /example?pageSize=5&page=2
Here you retrieve specifically only the title and the text of the results' objects
GET /example?fields=title,text
Here you retrieve only the objects that have the string "123" in the text field. For those objects, only the fields "title" and "text" is returned sorted by title descending. The results are limited by 5 entries and you only retrieve the second page.
GET /example?fields=title,text&q={"text":"123"}&pageSize=5&page=2&sort=title