Job App API

Job App API is a backend RESTful API that is build in NodeJS that include features like: jobs, users, authentication etc.

GET Get all jobs
{{DOMAIN}}/api/v1/jobs

Get all jobs that are stored in DB.

Example Request
                                                
GET {{DOMAIN}}/api/v1/jobs
                                            
POST New Job
{{DOMAIN}}/api/v1/job/new

Create new Job

HEADERS

Content-type
application/json

None

Authorization
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxYmUzY2MzNGJhOGIxZmY3NTM0YWE3NSIsImlhdCI6MTYzOTg2MDI4MSwiZXhwIjoxNjQwNDY1MDgxfQ.5SeJKG3nBFDkSR-M85S8d7Sczy954Lg462TcaNyAt7o

None

BODY raw

Example Request
GET Get jobs within radius
{{DOMAIN}}/api/v1/jobs/22554-7763/55
HEADERS

Content-type
application/json

None

Example Request
                                                
GET {{DOMAIN}}/api/v1/jobs/22554-7763/55
                                            
PUT Update Job
{{DOMAIN}}/api/v1/job/61bcbf57964427299434a4bc
HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "title": "Node JS Developer"
}
                                                  
                                              
Example Request
                                                
PUT {{DOMAIN}}/api/v1/job/61bcbf57964427299434a4bc

{
    "title": "Node JS Developer"
}
                                            
DELETE Delete Job
{{DOMAIN}}/api/v1/job/61d0cfb0a548a8ac075e26d9
HEADERS

Content-type
application/json

None

Example Request
                                                
DELETE {{DOMAIN}}/api/v1/job/61d0cfb0a548a8ac075e26d9
                                            
GET Get single job
{{DOMAIN}}/api/v1/job/61bcbf57964427299434a4bc/node-developer
HEADERS

Content-type
application/json

None

Example Request
                                                
GET {{DOMAIN}}/api/v1/job/61bcbf57964427299434a4bc/node-developer
                                            
GET Get Topic Stats
{{DOMAIN}}/api/v1/stats/php
HEADERS

Content-type
application/json

None

Example Request
                                                
GET {{DOMAIN}}/api/v1/stats/php
                                            
PUT Apply to job with resume
{{DOMAIN}}/api/v1/job/61cd63457a04b32686f2b36b/apply

Apply to any job with resume attachment (pdf|doc|docx)

HEADERS

Content-type
application/json

None

BODY formdata

file
None

None

Example Request
                                                
PUT {{DOMAIN}}/api/v1/job/61cd63457a04b32686f2b36b/apply
                                            
POST Register User
{{DOMAIN}}/api/v1/register

Register a user with email, password and role. Encrypted password will be saved in DB.

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "name": "chriscupas",
    "email": "chriscupas@yahoo.com",
    "password": "asd123",
    "role": "employeer"
}
                                                  
                                              
Example Request
                                                
POST {{DOMAIN}}/api/v1/register

{
    "name": "chriscupas",
    "email": "chriscupas@yahoo.com",
    "password": "asd123",
    "role": "employeer"
}
                                            
POST Login User
{{DOMAIN}}/api/v1/login

Login user with email and password

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "email": "chriscupas@outlook.com",
    "password": "asd123"
}
                                                  
                                              
Example Request
                                                
POST {{DOMAIN}}/api/v1/login

{
    "email": "chriscupas@outlook.com",
    "password": "asd123"
}
                                            
POST Send password request
{{DOMAIN}}/api/v1/password/forgot

Send password reset email with token and expire time.

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "email": "user@yahoo.com"
}
                                                  
                                              
Example Request
                                                
POST {{DOMAIN}}/api/v1/password/forgot

{
    "email": "user@yahoo.com"
}
                                            
PUT Reset new password
http://localhost:3000/api/v1/password/reset/64f529feb30c38478d66fb8774a22c9cfd29e66e

Reset new password of that account.

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "password": "asd123$$"
}
                                                  
                                              
Example Request
                                                
PUT http://localhost:3000/api/v1/password/reset/64f529feb30c38478d66fb8774a22c9cfd29e66e

{
    "password": "asd123$$"
}
                                            
GET Logout User
{{DOMAIN}}/api/v1/logout

Log out user from API and expires the cookie

HEADERS

Content-type
application/json

None

Example Request
                                                
GET {{DOMAIN}}/api/v1/logout
                                            
GET Get Current User Profile
{{DOMAIN}}/api/v1/me

Gives data of currently logged in user

HEADERS

Content-type
application/json

None

Example Request
                                                
GET {{DOMAIN}}/api/v1/me
                                            
PUT Change current user password
{{DOMAIN}}/api/v1/password/update

Change the currently logged-in user password

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "currentPassword": "123456",
    "newPassword": "asd123"
}
                                                  
                                              
Example Request
                                                
PUT {{DOMAIN}}/api/v1/password/update

{
    "currentPassword": "123456",
    "newPassword": "asd123"
}
                                            
PUT Update Current User
{{DOMAIN}}/api/v1/me/update

Update the currently logged in user data like name & email

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    
{
    "name": "chris cupas",
    "email": "chriscupastest@yahoo.com"
}
                                                  
                                              
Example Request
                                                
PUT {{DOMAIN}}/api/v1/me/update

{
    "name": "chris cupas",
    "email": "chriscupastest@yahoo.com"
}
                                            
DELETE Delete current user
{{DOMAIN}}/api/v1/me/delete

Delete currently logged in user with its file

HEADERS

Content-type
application/json

None

BODY raw

                                                  
                                                    

                                                  
                                              
Example Request
                                                
DELETE {{DOMAIN}}/api/v1/me/delete


                                            
GET Show all jobs applied by user
{{DOMAIN}}/api/v1/jobs/applied

Show all jobs applied by currently logged in user

Example Request
                                                
GET {{DOMAIN}}/api/v1/jobs/applied
                                            
GET Get jobs published by employeer
{{DOMAIN}}/api/v1/jobs/published

Gives all jobs that are currently logged in employeer or admin.

Example Request
                                                
GET {{DOMAIN}}/api/v1/jobs/published
                                            
GET Show all users
{{DOMAIN}}/api/v1/users

Show all users. Admin only routes

Example Request
                                                
GET {{DOMAIN}}/api/v1/users
                                            
DELETE Delete User (Admin)
{{DOMAIN}}/api/v1/users/61cd6640d71bd460775ce7e4

Delete user or employeer. Only accessible admin.

Example Request
                                                
DELETE {{DOMAIN}}/api/v1/users/61cd6640d71bd460775ce7e4