-
Notifications
You must be signed in to change notification settings - Fork 1
API Reference
The Referral board API is organized around [REST] (http://en.wikipedia.org/wiki/Representational_State_Transfer). Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The basic URL
http://localhost:5555/api
Referral Board uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx
range indicate success. Codes in the 4xx
range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx
range indicate an error with Stripe's servers (these are rare).
Retrieves the list of all users from the database.
none
GET /api/users
curl http://localhost:5555/api/users
Returns a JSON array of JSON objects for all the users in the database.
[
{
"userId": 1,
"firstName": "dummy_firstName",
"lastName": "dummy_lastName",
"currentLocation": "Florida",
"currentCompanyId": 1,
"currentCompanyName": "Dummy Company",
"currentPosition": "dummyPosition",
"school": "dummySchool",
"yearsOfExperienceId": 1,
"email": "[email protected]",
"password": "dummyPassword"
}
]
Retrieves a user details based on the filter user Id
none
GET /api/users/id/:id
curl http://localhost:5555/api/users/id/:id
Returns a JSON object of the user based on the user id.
{
"userId": 1,
"firstName": "dummy_firstName",
"lastName": "dummy_lastName",
"currentLocation": "Florida",
"currentCompanyId": 1,
"currentCompanyName": "Company A",
"currentPosition": "Intern",
"school": "UF",
"yearsOfExperienceId": 1,
"email": "[email protected]",
"password": "root"
}
Retrieves a user details based on the filter user email id
none
GET /api/users/email/:email
curl http://localhost:5555/api/users/email/:email
Returns a JSON object of the user based on the email id.
{
"userId": 1,
"firstName": "dummy_firstName",
"lastName": "dummy_lastName",
"currentLocation": "Florida",
"currentCompanyId": 1,
"currentCompanyName": "Company A",
"currentPosition": "Intern",
"school": "UF",
"yearsOfExperienceId": 1,
"email": "[email protected]",
"password": "root"
}
Adds new user to database.
- firstName: string
- lastName: string
- currentLocation: string
- currentCompanyId: integer
- currentCompanyName: string
- currentPosition: string
- school: string
- yearsOfExperienceId: integer
- email: string
- password: string
POST /api/users/newuser
curl -d "{\"firstName\": \"dummy_firstName\",\"lastName\":\"dummy_lastName\",\"currentLocation\":\"dummy_location\", \"currentComapnyId\":1, \"currentCompanyName\":\"dummy_company\",\"school\":\"dummy_school\", \"yearsOfExperience\":1, \"email\":\"[email protected]\", \"password\":\"dummypassword\"}"
-H "Content-Type: application/json"
http://localhost:8080/api/users/newuser
Returns the JSON object of the newly added User.
{
"userId": 1,
"firstName": "dummy_firstName",
"lastName": "dummy_lastName",
"currentLocation": "Florida",
"currentCompanyId": 1,
"currentCompanyName": "Company A",
"currentPosition": "Intern",
"school": "UF",
"yearsOfExperienceId": 1,
"email": "[email protected]",
"password": "root"
}
Updates a user details based on the user id filter.
- userId: integer
- firstName: string
- lastName: string
- currentLocation: string
- currentCompanyId: integer
- currentCompanyName: string
- currentPosition: string
- school: string
- yearsOfExperienceId: integer
- email: string
- password: string
PUT /api/users/:id
curl -d "{\"userId\":1\"firstName\": \"dummy_firstName\",\"lastName\":\"dummy_lastName\",\"currentLocation\":\"dummy_location\", \"currentComapnyId\":1, \"currentCompanyName\":\"dummy_company\",\"school\":\"dummy_school\", \"yearsOfExperience\":1, \"email\":\"[email protected]\", \"password\":\"dummypassword\"}"
-H "Content-Type: application/json"
http://localhost:8080/api/users/:id
Returns the JSON object of the updated User.
{
"userId": 1,
"firstName": "dummy_firstName",
"lastName": "dummy_lastName",
"currentLocation": "Florida",
"currentCompanyId": 1,
"currentCompanyName": "Company A",
"currentPosition": "Intern",
"school": "UF",
"yearsOfExperienceId": 1,
"email": "[email protected]",
"password": "root"
}
Retrieves all the posts from the database
none
GET /api/posts
curl http://localhost:5555/api/posts
Returns a JSON array containing all the JSON objects for posts available in the database.
[
{
"postId": 1,
"userId": 1,
"targetCompanyId": 2,
"targetPosition": "dummy_position",
"message": "dummy message",
"resume": "dummy_resume_link",
"jobLink": "https://www.companyb.com/jobid/123",
"createdAt": "2022-02-02T22:13:47.894901-05:00"
}
]
Retrieves a post based on the post id filter
none
GET /api/posts/id/:id
curl http://localhost:5555/api/posts/id/:id
Returns the JSON object for the post based on the post id
{
"postId": 1,
"userId": 1,
"targetCompanyId": 2,
"targetPosition": "Software Engineer",
"message": "Message 1",
"resume": "Resume 1",
"jobLink": "https://www.companyb.com/jobid/123",
"createdAt": "2022-02-02T22:13:47.894901-05:00"
}
Deletes a post from database based on the post id filter
none
DELETE /api/posts/:id
curl -X DELETE http://localhost:5555/api/posts/:id
Returns the JSON object for the deleted post based on post id.
{
"postId": 1,
"userId": 1,
"targetCompanyId": 2,
"targetPosition": "Software Engineer",
"message": "Message 1",
"resume": "Resume 1",
"jobLink": "https://www.companyb.com/jobid/123",
"createdAt": "2022-02-02T22:13:47.894901-05:00"
}
For any queries or support contact the team
If you have noticed an issue, please report by creating a new issue.