-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The URI is https://spacer-repetition-api.herokuapp.com/v1/.
The endpoints follow.
POST
signup?email=EMAIL_HERE&password=PASSWORD_HERE
POST
login?email=EMAIL_HERE&password=PASSWORD_HERE
The response here is the token to be used as the Authorization_ header. Make sure to have it all the time in the headers.
GET
flashcards?filter=FILTER_HERE
The filter can be:
- active
- mastered
- waiting
The response is in the following format.
[
{
"front": "QUESTION 1",
"back": "ANSWER 1",
"id": 1
},
{
"front": "QUESTION 2",
"back": "ANSWER 2",
"id": 2
}
]
POST
flashcards
The body of the request must contain the following JSON kind of content.
[
{
"front": "WHATEVER 1",
"back": "ANSWER 1"
},
{
"front": "WHATEVER 2",
"back": "ANSWER 2"
}
]
If some of the flashcards being sent are not valid you'll receive a response with a status of 201 (accepted) and a payload containing the error messages.
{
"errors": ["something", "wrong"]
}
PATCH
flashcards
The body of the request must be something like the following JSON.
[
{
"id": 23,
"front": "New Front",
"back": "New Back"
},
{
"id": 28,
"front": "New 2",
"back": "New Answer 2"
}
]
If something wrong happens, you receive 201 and a payload with the errors, just like above.
DELETE
flashcards
The payload in the request must be similar to this JSON.
{
"ids": [1, 2, 43, 22]
}
If something wrong happens, you receive 201 and a payload with the errors, just like above.
PATCH
flashcards/answer
The body of the request must have something like this JSON.
{
"flashcards": [
{
"id": 45,
"correct": false
},
{
"id": 52,
"correct": true
}
]
}
If something wrong happens, you receive 201 and a payload with the errors, just like above.