When you send the email and password that tried logging in on your system to the login endpoint, you will receive a response with a token. This token is used to authenticate all other requests to the API. You should store this token in your application and send it as a header with every request.
const loginData = {
email: 'test@example.com',
password: 'abc123',
}
const authResponse = {
message: 'Login successful',
token: 'jwt token',
data: {
userId: '123',
matricNumber: '123456',
firstName: 'John',
lastName: 'Doe',
email: 'test@example.com',
admissionStatus: 'admitted',
}
}
This is an initial list of endpoints we need, and this is subject to discussion.
When subject and test is created on the LMS, we need to be notified so that we can add the link to that course on our end.
We will expose a POST
route that you can send created subjects and tests to.
Sending something like this could help.
const newCourse = {
name: 'JavaScript Applications',
courseCode: 'CSC234',
link: 'https://api.futurex.com/courses/javascript-applications',
createdAt: '2020-08-17T12:00:00+00:00',
createdBy: 'Mr name',
}
const newTest = {
name: 'JavaScript Applications Test',
courseCode: 'CSC234',
testNumber: 1,
link: 'https://api.futurex.com/courses/javascript-applications/test',
createdAt: '2020-08-17T12:00:00+00:00',
createdBy: 'Mr name',
}
We will then associate the course using the course code and add it to our database and return a success response.
We could discuss further about this or maybe comment under this gist.
Thank you.