🧾 Job API Integration Guide

🧾 Job API Integration Guide

By Mikey Sharma•Jul 24, 2025

1. Search Jobs (GET /api/jobs/search?query={search_term})

Request:

curl -X GET "http://localhost:3000/api/jobs/search?query=react" \
-H "Authorization: Bearer YOUR_TOKEN"  # Optional

Response:

{
  "success": true,
  "data": [
    {
      "id": "507f1f77bcf86cd799439011",
      "title": "React Developer",
      "description": "Looking for an experienced React developer...",
      "shortDescription": "React developer with 3+ years experience",
      "company": "Tech Corp",
      "companyLogo": "https://example.com/logo.png",
      "location": "Remote",
      "url": "https://example.com/job/123",
      "skills": ["React", "JavaScript", "Redux"],
      "salary": "$90,000 - $120,000",
      "employmentType": "Full-time",
      "isRemote": true,
      "postedDate": "2023-05-15T00:00:00.000Z",
      "isBookmarked": false
    }
  ]
}

Request:

curl -X GET "http://localhost:3000/api/jobs/featured"

Response:

{
  "success": true,
  "data": [
    {
      "id": "507f1f77bcf86cd799439012",
      "title": "Senior Frontend Engineer",
      "description": "Lead our frontend team building innovative products...",
      "shortDescription": "Lead our frontend team",
      "company": "Big Tech",
      "companyLogo": "https://example.com/bigtech-logo.png",
      "location": "San Francisco, CA",
      "url": "https://example.com/job/456",
      "skills": ["JavaScript", "React", "TypeScript"],
      "salary": "$140,000 - $180,000",
      "employmentType": "Full-time",
      "isRemote": false,
      "postedDate": "2023-05-10T00:00:00.000Z",
      "isBookmarked": false
    }
  ]
}

3. Get Job Details (GET /api/jobs/job/:id)

Request:

curl -X GET "http://localhost:3000/api/jobs/job/507f1f77bcf86cd799439011"

Response:

{
  "success": true,
  "data": {
    "id": "507f1f77bcf86cd799439011",
    "title": "React Developer",
    "description": "Full job description with requirements...",
    "shortDescription": "React developer with 3+ years experience",
    "company": "Tech Corp",
    "companyLogo": "https://example.com/logo.png",
    "location": "Remote",
    "url": "https://example.com/job/123",
    "skills": ["React", "JavaScript", "TypeScript", "Redux"],
    "salary": "$90,000 - $120,000",
    "employmentType": "Full-time",
    "isRemote": true,
    "postedDate": "2023-05-15T00:00:00.000Z",
    "isBookmarked": false
  }
}

4. Get User's Bookmarked Jobs (GET /api/jobs/user/jobs)

Request:

curl -X GET "http://localhost:3000/api/jobs/user/jobs" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
  "success": true,
  "data": [
    {
      "id": "507f1f77bcf86cd799439011",
      "title": "React Developer",
      "description": "Looking for an experienced React developer...",
      "shortDescription": "React developer with 3+ years experience",
      "company": "Tech Corp",
      "companyLogo": "https://example.com/logo.png",
      "location": "Remote",
      "url": "https://example.com/job/123",
      "skills": ["React", "JavaScript", "Redux"],
      "salary": "$90,000 - $120,000",
      "employmentType": "Full-time",
      "isRemote": true,
      "postedDate": "2023-05-15T00:00:00.000Z",
      "isBookmarked": true
    }
  ]
}

5. Bookmark/Unbookmark a Job (POST /api/jobs/:jobId/bookmark)

Request Body:

{
  "bookmark": true
}

Request:

curl -X POST "http://localhost:3000/api/jobs/507f1f77bcf86cd799439011/bookmark" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"bookmark": true}'

Success Response:

{
  "success": true,
  "data": {
    "isBookmarked": true
  }
}

Error Response (if job not found):

{
  "success": false,
  "message": "Job not found"
}

Error Response Examples

Unauthorized (401):

{
  "success": false,
  "message": "Not authenticated"
}

Not Found (404):

{
  "success": false,
  "message": "Job not found"
}

Validation Error (400):

{
  "success": false,
  "message": "Bookmark status must be a boolean"
}

Share:

Scroll to top control (visible after scrolling)