Skip to main content

Job Categories

Welcome to the Job Categories module API specification#

  • This section will define APIs for the job categories feature/module. It will include API documentation for all CRUD operations involving a job category.

A single job category object, has the following keys

KeyDescriptionRequiredType
idUnique identifier(Autogenerated)AutogeneratedNumber
uid13 varying characters
used for CRUD operations
NOString(UID)
nameDefines the job Categories' given nameYESString
createdjob Categories' date of creationNODate
lastupdatedjob Categories' date for when it was last updatedNODate

Creating a job category#

  • Crud operations involving creating a single job category, can be done in two ways,

    • A job category is a child of another job category

Method: POST

Creating a standalone job category#

Endpoint

/api/jobCategories

Request Payload

{
"name":"job Category Name"
}

Response

  • These responses can vary depending on success and failure however, to here we will show the success reponse.
{
"message": "Item successfully created",
"payload": {
"id": "iHWO6i7JFTI8Y",
"created": "2021-04-26T09:06:47.990Z",
"lastupdated": "2021-04-26T09:06:47.990Z",
"name":"job Category Name"
}
}

Creating a job category with a parent category#

Endpoint

/api/jobCategories

Request Payload

{
"name":"job Category Name",
"parent":{"id": "FEpU232D9w6Lv"}
}

Response

  • These responses can vary depending on success and failure however, to here we will show the success reponse.
{
"message": "Item successfully created",
"payload": {
"id": "iHWO6i7JFTI8Y",
"created": "2021-04-26T09:06:47.990Z",
"lastupdated": "2021-04-26T09:06:47.990Z",
"name":"job Category Name"
}
}

Get job categories#

Method: GET

Endpoint

/api/jobCategories

Response

{
"pager": {
"page": 1,
"pageSize": 100,
"pageCount": 1,
"total": 1,
"nextPage": "/api/jobCategories?page=2"
},
"jobCategories": [
{
"id": "FbKroGm4tZuga",
"created": "2021-04-26T09:36:10.740Z",
"lastupdated": "2021-04-26T09:36:10.740Z",
"name":"job Category Name",
}
]
}

Pagination and Page sizes#

  • You can define pages you want and the data per page size you want by passing query params in get request i.e page=2&pageSize=400
  • This will return data of page two with size of 400 records per page
  • If page and page size are not defined, the default is 1 and 100 respectively

Method: GET

Endpoint

/api/jobCategories?page=3&pageSize=100
  • You can also pass params to get all data without pagination by passing in paging=false

Method: GET

Endpoint

/api/jobCategories?paging=false

Get One job category(By ID)#

Endpoint

/api/jobCategories/FbKroGm4tZuga

Response

{
"id": "FbKroGm4tZuga",
"created": "2021-04-26T09:36:10.740Z",
"lastupdated": "2021-04-26T09:36:10.740Z",
"name":"job Category Name"
}

Get job categories(By Specifying fields)#

NOTE: On getting job Categories, whether a single job category or the whole list, we can also specify the fields and relations we want

Endpoint

/api/jobCategories?fields=id,name,parent

Response

{
"pager": {
"page": 1,
"pageSize": 100,
"pageCount": 2,
"total": 2,
"nextPage": "/api/jobCategories?page=2"
},
"jobCategories": [
{
"id": "FbKroGm4tZuga",
"name":"job Category Name"
},
{
"id": "v2izbbuH5H8hI",
"name": "Other Job Category",
"parent": {
"id": "FEpU232D9w6Lv",
"name": "Job Category Parent",
"created": "2021-06-26T19:01:00.777Z",
"lastupdated": "2021-06-26T19:01:00.777Z"
}
}
]
}

Get job Categories categories (By filtering fields)#

  • We can filter job Categories depending on certain fields, more like a search strategy, in the example below, we will find all job categories with job category ame equal to job Category Name

Endpoint

/api/jobCategories?filter=name:eq:job Category Name

Response

{
"pager": {
"page": 1,
"pageSize": 100,
"pageCount": 1,
"total": 1,
"nextPage": "/api/jobCategories?page=2"
},
"jobCategories": [
{
"id": "FbKroGm4tZuga",
"created": "2021-04-26T09:36:10.740Z",
"lastupdated": "2021-04-26T09:36:10.740Z",
"name":"job Category Name",
}
]
}

NOTE: All filtering mechanisms, can be combined to produce a lobust search strategy

  • Available search and filter Operators
OperatorTypesValue RequiredDescription
eqstring | boolean | integer | float | enum | collection (checks for size) | datetrueEquality
likestringtrueCase sensitive string, match anywhere
ilikestringtrueCase insensitive string, match anywhere
instring | boolean | integer | float | datetrueFind objects matching 1 or more values

Update a job category#

Method: PUT

Endpoint

/api/jobCategories/FbKroGm4tZuga

Request Payload

{
"name":"Erick Baney Name",
}

Response

{
"message": "Item with id FbKroGm4tZuga updated successfully.",
"payload": {
"id": "FbKroGm4tZuga",
"created": "2021-04-26T09:36:10.740Z",
"lastupdated": "2021-04-26T09:36:10.740Z",
"name":"Erick Baney Name"
}
}

Delete a job category#

Method: DELETE

Endpoint

/api/jobCategories/D67ZA1LulF2kf

Response

{
"message": "Object with identifier D67ZA1LulF2kf deleted successfully"
}