The workshops server serves details of (fictitious) technical workshops happening in various parts of India. Every workshop has a broad topic (eg. JavaScript), and a workshop has many sessions (each session covers a sub-topic, eg. Closures in JavaScript). A session maintains the number of upvotes, whcih can be modified by making an appropriate API call. This server allows you to view details of workshops, details of session of workshops, and also add a new workshop/session, edit and existing one and delete them. This includes
Note:
You can access the server at the following URL.
To get started, you can view all workshops here, and all sessions here.
Assuming you have Node.js installed on your system,
$> cd workshops-server
$> npm install
$> npm start
Note:
{
"email": "john.doe@example.com",
"password": "Password123#"
}
{
"email": "jane.doe@example.com",
"password": "Password123#"
}
No other credentials are supported by the server.
GET https://workshops-server.onrender.com/workshops
GET https://workshops-server.onrender.com/workshops?_page=<page_id>
For example, to view the second page
GET https://workshops-server.onrender.com/workshops?_page=2
GET https://workshops-server.onrender.com/workshops/<workshop_id>
For example, to view details of workshop with id = 2
GET https://workshops-server.onrender.com/workshops/2
GET https://workshops-server.onrender.com/workshops/<workshop_id>/sessions
For example, to view sessions of workshop with id = 2
GET https://workshops-server.onrender.com/workshops/2/sessions
GET https://workshops-server.onrender.com/workshops/<workshop_id>?_embed=sessions
For example, to view details of workshop with id = 2 along with its sessions
GET https://workshops-server.onrender.com/workshops/2?_embed=sessions
GET https://workshops-server.onrender.com/sessions
POST https://workshops-server.onrender.com/workshops
The JSON data that must be sent is shown in below sample (modify the data as per your needs). DO NOT specify the id for the workshop. The response will have the same object with the automatically generated id for the workshop.
{
"name": "jQuery",
"description": "jQuery is a JavaScript library",
"startDate": "2020-03-01T04:00:00.000Z",
"endDate": "2020-03-03T08:00:00.000Z",
"time": "9:30 am - 1:30 pm",
"location": {
"address": "Tata Elxsi, Prestige Shantiniketan",
"city": "Bangalore",
"state": "Karnataka"
},
"modes": {
"inPerson": true,
"online": false
},
"imageUrl": "https://upload.wikimedia.org/wikipedia/en/thumb/9/9e/JQuery_logo.svg/524px-JQuery_logo.svg.png"
}
POST https://workshops-server.onrender.com/sessions
The JSON data that must be sent is shown in below sample (modify the data as per your needs). Specify the workshopId and set it to the id of the workshop for which this is a session. Also specify sequenceId. DO NOT specify the id for the session. The response will have the same object with the automatically generated id for the session.
{
"workshopId": 13
"sequenceId": 1,
"name": "Introduction to jQuery",
"speaker": "John Doe",
"duration": 1,
"level": "Basic",
"abstract": "In this session you will learn about the jQuery function and jQuery collection objects",
"upvoteCount": 0
}
PUT https://workshops-server.onrender.com/sessions/<session_id>/upvote
For example, to upvote a session with session id = 45,
PUT https://workshops-server.onrender.com/sessions/45/upvote
PUT https://workshops-server.onrender.com/sessions/<session_id>/downvote
For example, to downvote a session with session id = 45,
PUT https://workshops-server.onrender.com/sessions/45/downvote
For more API documentation, please check the documentation of json-server using which this server has been built