Staging can be found here: https://webapi-staging-lb-718828028.eu-central-1.elb.amazonaws.com
Production can be found here: https://webapi-prod-lb-379596049.eu-central-1.elb.amazonaws.com
- Install "Ruby" and "Ruby Solargraph" VSCode extensions (VSCode only)
- If not done before, install mailcatcher:
gem install mailcatcher
- Then to use it just run
mailcatcher
- Now go to localhost:1080 to see all mails, that would be sent out
- To seed the development environment run
rails db:seed
- To log into the webapi in development mode, use the seeded admin
[email protected]
with PWseedlog
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
POST | /api/users/sign_in |
Signs in the user | Should return 201 |
BODY:
{
"user": {
"email": "[email protected]",
"password": "secret"
}
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
POST | /api/users/ |
Registration for the user | Should return 201 |
BODY:
{
"user": {
"email": "[email protected]",
"password": "secret",
"first_name": "Max",
"last_name": "Müller",
"age_range_id: "2"
}
}
See info about age range on bottom: Age Ranges
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
DELETE | /api/users/sign_out |
Signs the user out | Bearer token must be present in header | Should return 204 |
POST | /api/statements |
Creates a statement for a panel | Bearer token must be present in header | Should return 201 |
BODY:
{
"statement": {
"panel_id": "1",
"quote": "This is the statement about"
},
"audio_file": {
"file_link": "https://mysong.de/test.mp3",
"duration_seconds": "99"
}
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
POST | /api/users/password |
Sends E-Mail to reset password | Should return 201 |
BODY:
{
"user": {
"email": "[email protected]"
}
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
PATCH | /api/users/password |
Resets the password | reset token is gotten from URL (sent by email) | Should return 204 |
BODY:
{
"user": {
"password": "seedlog",
"password_confirmation": "seedlog",
"reset_password_token": "aZQpjuuAzN8QbczqD-_x"
}
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
DELETE | /api/statements/:id |
Deletes a statement for a panel | Bearer token must be present in header | Should return 204 |
POST | /api/statements/:id/comments |
Creates a comment for a statement | Bearer token must be present in header | Should return 201 |
BODY:
{
"comment": {
"quote": "This is a great comment"
},
"audio_file": {
"file_link": "https://mysong.de/test.mp3",
"duration_seconds": "99"
}
}
OR (if it is a text comment)
{
"comment": {
"quote": "this is a quote"
},
"text_record": {
"content": "My opinion is really valuable to this issue."
}
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
DELETE | /api/statements/:statement_id/comments/:comment_id |
Deletes a comment for a statement | Bearer token must be present in header | Should return 204 |
GET | /api/statements/:statement_id/comments/ |
Get all comments for a statement | Should return 200 | |
GET | /api/panels/:id |
Get a specific panel with all statements and # of comments and likes | Should return 200 | |
GET | /api/panels/ |
Get all categories and panels | Should return 200 | |
GET | api/regions/ |
Get all regions | Should return 200 | |
GET | api/regions/:id |
Get all categories and panels for specific region | Should return 200 | |
POST | /api/statements/:statement_id/likes |
Likes a statement | Bearer token must be present in header | Should return 201 |
DELETE | /api/statements/:statement_id/likes |
Unlikes a statement | Bearer token must be present in header | Should return 204 |
GET | /api/slugs |
Get all slugs with corresponding panel id | Should return 200 | |
GET | /api/authenticate |
Check if token is still valid | Bearer token must be present in header | Should return 200 |
POST | /api/feedbacks/ |
Sends feedback | NO BEARER neccessary | Should return 201 |
BODY:
{
"feedback": {
"description": "this is lit",
"email": "[email protected]"
}
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
POST | /api/user_audio_trackings/ |
Sends user audio tracking | NO BEARER neccessary, user_id optional, is_intro only neccessary if it is an intro | Should return 201 |
BODY:
{
"user_id": 1,
"statement_id": 1,
"current_position_in_seconds": 80,
"playtime_in_seconds": 80,
"is_intro": true
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
PUT | /api/user_audio_trackings/:id |
Updates user audio tracking | NO BEARER neccessary | Should return 204 |
BODY:
{
"current_position_in_seconds": 80,
"playtime_in_seconds": 80
}
HTTP Method | Endpoint | Description | Notes | Desired status code |
---|---|---|---|---|
POST | /api/click_trackings/ |
Sends tracking info | NO BEARER neccessary, user_id optional, statement_id optional | Should return 201 |
BODY:
{
"click_tracking": {
"user_id": 1,
"statement_id": 1,
"event": "twitter",
"information": "addition information"
}
}
ID | Start Age | End Age |
---|---|---|
1 | NULL | 15 |
2 | 16 | 28 |
3 | 29 | 44 |
4 | 45 | 60 |
5 | 61 | NULL |