You can find the two mentioned files above in this link: here
After completing the steps mentioned above, you will need to set up a local database!
- Run
sudo mongod
in terminal to start the mongodb locally. - Open MongoCompass > New connection > Connect to the default URI (You can also favourite this connection to reconnect to it easily!)
- Go to Databases > Create a new Database called Knolx
- Now you can create collections for your new database. (One collection for each file mentioned in the Sample_Data_Set)
- You should have a valid mongod server running in your local that has a database called knolx and contains some collections.
- Checkout to develop from terminal.
- Run
sbt run
from the root directory. - Knolx service should be running on http://localhost:8000
To get a token, run this command in terminal
- Run the following command in terminal.
curl -d "client_id=leaderboard-ui" -d "client_secret=8090ed15-4cd1-483c-9fee-2a8b35941852" -d "username=testemployee" -d "password=testemployee" -d "grant_type=password" "https://auth.knoldus.com/auth/realms/knoldus/protocol/openid-connect/token"
- You will recieve a response in json format, copy the following value
access_token
- When hitting endpoints using
Postman
- Go to Authorization > Type: Bearer Token > Paste obtained token.
- Now you endpoint calls are valid!
To hit any endpoint in knox, you will have to prefix endpoints with v02
[At the time of writing this version of Readme].
i.e http://localhost:8000/v02/sessions?pageNumber=1&pageSize=10&filter=past
for example.
Here is an example of a response to /sessions
{ "knolx": [ { "id": "62bc6c453407e61970360b3a", "presenterDetail": { "fullName": "test admin", "email": "[email protected]" }, "coPresenterDetails": { "fullName": "Someone", "email": "Something" }, "dateTime": 1656516219857, "sessionDurationInMins": 45, "topic": "Rust Fundamentals", "category": "Rust", "subCategory": "Scala Fundamentals", "feedbackExpriationDate": 1656700199000, "sessionType": "Knolx", "sessionState": "PendingForAdmin", "sessionDescription": "bdhfgakjfjfdajf", "contentAvailable": false, "content": { "contentStatus": "NotAvailable" } } ], "count": 1, "pages": 1 }
In this case we have a single previous knolx session under the email [email protected]