-
Notifications
You must be signed in to change notification settings - Fork 5
API
krmarien edited this page Aug 4, 2014
·
3 revisions
Auth
- Basic auth info
- Global URL: /{language}/api/auth/{action}/
- Actions:
- getPerson: get person information
{
'access_token': {access token}
}
or
{
'session': {session id}
}
or
{
'username': {the username}
}
{
'username': {the username},
'full_name': {the full name},
'email': {the email}
}
- Get json of all active events
- Global URL: /{language}/api/calendar/{action}/
- Actions:
- activeEvents: GET request, get an array of all active events
- poster: POST request, get an image with the unique poster identifier
{
'id': {id},
'title': {title},
'content': {content in MarkDown},
'startDate' => {ISO 8601 date},
'endDate' => {ISO 8601 date or null},
'poster' => {unique poster identifier},
'location' => {location}
}
{
'poster': {unique poster identifier}
}
- Communication with Cudi
- Global URL: /{language}/api/cudi/{action}/
- Actions:
- articles: POST request, get an array of all articles
- book: POST request, book an article, returns list of all bookings
- bookings: POST request, get an array of all bookings
- cancelBooking: POST request, cancel a booking
- currentSession: (POST request), get information about current session, if authenticated possibility to sign in
- openingHours: GET request, get an array of all opening hours
- signIn: POST request, sign in for current session
- signInStatus: POST request, get status of user in cudi queue
{
'access_token': {access token}
}
{
'subjects': [
{
'id': {unique id of subject},
'title': {title of subject}
}
],
'articles': [
{
'id': {unique id of article},
'title': {article title},
'subjects': [
{
'id': {subject id},
'mandatory': {flag whether this article is mandatory or not}
}
],
'price': {article price},
'sold': {flag whether this article is already bought},
'bookable': {flag whether this article is bookable},
'unbookable': {flag whether this article is unbookable}
}
]
}
{
'access_token': {access token},
'id': {article id}
}
{
'access_token': {access token}
}
{
'bookings': [
{
'id': {unique identifier of booking},
'assigned': {flag whether this booking is already assigned},
'expirationDate': {ISO 8601 date},
'number': {number of articles in this booking},
'article': {article id}
}
]
'articles': [ // articles not in default list
{
'id': {unique id of article},
'title': {article title},
'subjects': [
{
'id': {subject id},
'mandatory': {flag whether this article is mandatory or not}
}
],
'price': {article price},
'sold': {flag whether this article is already bought},
'bookable': {flag whether this article is bookable},
'unbookable': {flag whether this article is unbookable}
}
]
}
{
'access_token': {access token},
'id': {booking id}
}
If this is not a post request, no extra information about sign in is given
{
'access_token': {access token},
}
{
'status': {status of sale session open/closed},
'numberInQueue': {number of people in the queue},
'canSignIn': {Flag whether person can sign in},
'hasBookings': {Flag whether person has bookings, no bookings: unable to sign in}
}
{
'startDate': {ISO 8601 date},
'endDate': {ISO 8601 date},
'comment': {string with extra info}
}
{
'access_token': {access token},
}
{
'status': {status of request: succes otherwise error thrown},
'number': {your number in the queue}
}
{
'access_token': {access token},
}
{
'status': {status of person in queue},
'number': {your number in the queue},
'paydesk': {the pay desk number}
}
- Get some config values,
- Global URL: /{language}/api/config/{action}/
- Actions:
- entries: GET request, get all config values
- cudi.maximum_signin_distance: max distance in meters from cudi to allow sign in
- cudi.location: the location of cudi
- shift.signout_treshold: the threshold in seconds before a shift sign out is not allowed anymore
{
{key}: {value}
}
- Get json of all news events
- Global URL: /{language}/api/news/{action}/
- Actions:
- all: GET request, get an array of all news entries
{
'id': {the unique identifier of the news entry},
'creationTime': {ISO 8601 date},
'endDate': {ISO 8601 date},
'message': {message in MarkDown}
'summary': {the summary in HTML}
'title': {the title}
}
- OAuth
- Global URL: /{language}/api/oauth/{action}[/identification/{identification}[/hash/{hash}]]/
- Actions:
- authorize: GET request, show login screen
- shibboleth: redirect to this page after shibboleth authentication
- token: POST request, get OAuth tokens
{
'response_type': 'code',
'client_id': {unique client identifier},
'redirect_uri': {the redirect URI}
}
{
'grant_type': authorization_code/refresh_token,
'code': {the code of the user},
'client_id': {unique client identifier},
}
{
'access_token': {token},
'expires_in': {expires in seconds},
'token_type': Bearer,
'refresh_token': {refresh token}
}
- Get all info of shifts
- Global URL: /{language}/api/shift/{action}/
- Actions:
- active: POST request, Get an array of all shifts
- responsible: POST request, Sign in as repsonsible
- volunteer: POST request, Sign in as volunteer
- signOut: POST request, Sign out
{
'access_token': {access token},
}
[
{
'id': {the id},
'canHaveAsResponsible': {boolean},
'canHaveAsVolunteer': {boolean},
'description': {the description},
'currentNbResponsibles': {integer},
'currentNbVolunteers': {integer},
'endDate': {ISO 8601 date},
'signedUp': {boolean},
'manager': {name of the manager},
'name': {name of the shift},
'nbResponsibles': {integer},
'nbVolunteers': {integer},
'startDate': {ISO 8601 date},
'location': {
'id': {the location id},
'latitude': {the latitude},
'longitude': {the longitude},
'name': {the location name},
},
'unit': {
'id': {the unit id},
'name': {the unit name},
}
}
]
{
'access_token': {access token},
'id': {the id of the shift},
}
{
'access_token': {access token},
'id': {the id of the shift},
}
{
'access_token': {access token},
'id': {the id of the shift},
}