Skip to content
Muhammad Surya edited this page Nov 25, 2015 · 1 revision

Get Vacancies Listing

GET /vacancies

Example Request:

curl -X GET -H "Authorization: Basic Y29jYWNvbGE6Y29jYWNvbGE=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d4effb6b-848e-0e2f-16aa-3cf3a8a6ec18" 'https://milarian.herokuapp.com/vacancies'

Example Response:

[
  {
    "_id": "56560d84f389361100f268c3",
    "position": "Social Media Specialist",
    "description": "Mantain social media and lorem ipsum...",
    "location": "Bandung",
    "salary": 3500000,
    "expiry": "2015-12-15T00:00:00.000Z",
    "__v": 0,
    "updated_at": "2015-11-25T19:35:32.393Z"
  },
  {
    "_id": "56560de1f389361100f268c5",
    "position": "Sales Promotion Girl",
    "description": "Promote product and lorem ipsum...",
    "location": "Bandung",
    "salary": 2000000,
    "expiry": "2015-12-30T00:00:00.000Z",
    "__v": 0,
    "updated_at": "2015-11-25T19:37:05.104Z"
  }
]

Get Vacancies by ID

GET /vacancies/:id

Example Request:

curl -X GET -H "Authorization: Basic Y29jYWNvbGE6Y29jYWNvbGE=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 99febc13-2c87-3fc0-f0c0-0409741a0048" 'https://milarian.herokuapp.com/vacancies/56560d84f389361100f268c3'

Example Response:

{
  "_id": "56560d84f389361100f268c3",
  "position": "Social Media Specialist",
  "description": "Mantain social media and lorem ipsum...",
  "location": "Bandung",
  "salary": 3500000,
  "expiry": "2015-12-15T00:00:00.000Z",
  "__v": 0,
  "updated_at": "2015-11-25T19:35:32.393Z"
}

Apply to Vacancy

User is Personal POST /vacancies/:id/apply

Example Request:

curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic dml2aTp2aXZpMTIz" -H "Cache-Control: no-cache" -H "Postman-Token: 3d09c1f4-1fa2-18f8-9344-e61609f7116f" -d '{
    "cover_letter" : "Saya suka pekerjaaan ini pak!!!"
}
' 'https://milarian.herokuapp.com/vacancies/56560d84f389361100f268c3/apply'

Example Response:

{
  "__v": 0,
  "cover_letter": "Saya suka pekerjaaan ini pak!!!",
  "vacancy": {
    "_id": "56560d84f389361100f268c3",
    "position": "Social Media Specialist",
    "description": "Mantain social media and lorem ipsum...",
    "location": "Bandung",
    "salary": 3500000,
    "expiry": "2015-12-15T00:00:00.000Z",
    "__v": 0,
    "updated_at": "2015-11-25T19:35:32.393Z"
  },
  "personal": "565607e2f389361100f268bc",
  "_id": "56561081f389361100f268c8",
  "updated_at": "2015-11-25T19:48:17.911Z"
}

Post Vacancy

User is Company POST /vacancies

Example Request:

curl -X POST -H "Authorization: Basic Y29jYWNvbGE6Y29jYWNvbGE=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 284f0aac-a8ff-5a81-57ec-684e3db4d80a" -d '{
  "position" : "Social Media Specialist",
  "description" : "Mantain social media and lorem ipsum...",
  "location" : "Bandung",
  "salary" : 2000000,
  "expiry" : "December 30, 2015"
}' 'https://milarian.herokuapp.com/vacancies'

Example Response:

{
  "__v": 0,
  "position": "Social Media Specialist",
  "description": "Mantain social media and lorem ipsum...",
  "location": "Bandung",
  "salary": 2000000,
  "expiry": "2015-12-30T00:00:00.000Z",
  "_id": "56560d84f389361100f268c3",
  "updated_at": "2015-11-25T19:35:32.393Z"
}

Update Vacancy

User is Company PUT /vacancies/:id

Example Request:

curl -X PUT -H "Authorization: Basic Y29jYWNvbGE6Y29jYWNvbGE=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: c14377ff-7ebd-4439-095c-404db1a99e4e" -d '{
  "salary" : 3500000,
  "expiry" : "December 15, 2015"
}' 'https://milarian.herokuapp.com/vacancies/56560d84f389361100f268c3'

Example Response (It'll return previous value):

{
  "_id": "56560d84f389361100f268c3",
  "position": "Social Media Specialist",
  "description": "Mantain social media and lorem ipsum...",
  "location": "Bandung",
  "salary": 2000000,
  "expiry": "2015-12-30T00:00:00.000Z",
  "__v": 0,
  "updated_at": "2015-11-25T19:35:32.393Z"
}

Delete Vacancy

User is Company DELETE /vacancies/56560fb3f389361100f268c7

Example Request:

curl -X DELETE -H "Authorization: Basic Y29jYWNvbGE6Y29jYWNvbGE=" -H "Cache-Control: no-cache" -H "Postman-Token: 63ede023-fc87-a9ab-eef3-4d17ab9f4d87" -d '' 'https://milarian.herokuapp.com/vacancies/56560fb3f389361100f268c7'

Example Response:

{
  "_id": "56560fb3f389361100f268c7",
  "position": "Social Media Specialist",
  "description": "Mantain social media and lorem ipsum...",
  "location": "Bandung",
  "salary": 2000000,
  "expiry": "2015-12-30T00:00:00.000Z",
  "__v": 0,
  "updated_at": "2015-11-25T19:35:32.393Z"
}

Clone this wiki locally