A simplified table of contents for the API endpoints:
The Get Jobs API allows you to retrieve a list of jobs from the database while ensuring secure access through token-based authentication.
GET /jobs
This API requires a bearer token for authentication. Include the token in the Authorization
header of your request using the following format:
Authorization: Bearer YOUR_ACCESS_TOKEN
Parameter | Type | Description |
---|---|---|
start | number | The index of the first job to return. Default is 0. |
limit | number | The maximum number of jobs to return. Default is 60. |
search | string | A keyword to search for in the job title. Optional. |
type | number | The type of the job. Can be either 0 (master) or 1 (reed). Optional. |
The response is a JSON object with the following fields:
Field | Type | Description |
---|---|---|
total | number | The total number of jobs in the database that match the query parameters. |
start | number | The index of the first job returned. |
limit | number | The maximum number of jobs returned. |
filtered | number | The number of jobs returned. |
data | array | An array of job objects. Each job object has the following fields: |
- id: The unique identifier of the job. | ||
- title: The title of the job. | ||
- type: The type of the job. 0 (master) or 1 (reed). | ||
- createdAt: The date and time when the job was created. | ||
- updatedAt: The date and time when the job was last updated. |
GET /jobs?start=10&limit=20&search=engineer&type=0
Authorization: Bearer YOUR_ACCESS_TOKEN
{
"total": 35,
"start": 10,
"limit": 20,
"filtered": 20,
"data": [
{
"id": 11,
"title": "Senior Software Engineer",
"type": 0,
"createdAt": "2023-12-01T10:15:23.000Z",
"updatedAt": "2023-12-01T10:15:23.000Z"
},
{
"id": 12,
"title": "Mechanical Engineer",
"type": 0,
"createdAt": "2023-11-30T09:12:45.000Z",
"updatedAt": "2023-11-30T09:12:45.000Z"
},
// ... more jobs
]
}
To access this API, you must include a valid bearer token in the request header. Additionally, the API is protected by an authorization middleware (authorization
) and a protector middleware (protector
) to ensure that only authorized users can access the resource.
Please make sure to handle and securely store your access token. Unauthorized or improperly formatted tokens will result in a 401 Unauthorized response.
Feel free to use and adapt this documentation for your team's needs. If you have any further questions or adjustments, please let me know!
The Get Sectors API allows you to retrieve a list of sectors from the database. This endpoint requires token-based authentication to ensure secure access.
GET /sectors
This API requires a bearer token for authentication. Include the token in the Authorization
header of your request using the following format:
Authorization: Bearer YOUR_ACCESS_TOKEN
The response is a JSON array containing sector objects with the following fields:
Field | Type | Description |
---|---|---|
id | number | The unique identifier of the sector. |
name | string | The name of the sector. |
createdAt | string | The date and time when the sector was created. |
updatedAt | string | The date and time when the sector was last updated. |
GET /sectors
Authorization: Bearer YOUR_ACCESS_TOKEN
[
{
"id": 1,
"name": "Technology",
"createdAt": "2023-12-01T10:15:23.000Z",
"updatedAt": "2023-12-01T10:15:23.000Z"
},
{
"id": 2,
"name": "Finance",
"createdAt": "2023-11-30T09:12:45.000Z",
"updatedAt": "2023-11-30T09:12:45.000Z"
},
// ... more sectors
]
To access this API, you must include a valid bearer token in the request header. The API is protected by an authorization middleware (authorization
) and a protector middleware (protector
) to ensure that only authorized users can access the resource.
Please make sure to handle and securely store your access token. Unauthorized or improperly formatted tokens will result in a 401 Unauthorized response.
Feel free to use and adapt this documentation for your team's needs. If you have any further questions or adjustments, please let me know!
The Get Locations API allows you to retrieve a list of locations from the database. This endpoint requires token-based authentication to ensure secure access.
The location data is represented by the following model:
const Location = sequelize.define<any>("location", {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: true
},
county: {
type: DataTypes.STRING,
allowNull: false
},
town: {
type: DataTypes.STRING,
allowNull: false
},
postcode: {
type: DataTypes.STRING,
allowNull: false
},
createdAt: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: Sequelize.NOW
},
updatedAt: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: Sequelize.NOW
}
});
GET /locations
This API requires a bearer token for authentication. Include the token in the Authorization
header of your request using the following format:
Authorization: Bearer YOUR_ACCESS_TOKEN
The response is a JSON array containing location objects with the following fields:
Field | Type | Description |
---|---|---|
id | number | The unique identifier of the location. |
county | string | The county of the location. |
town | string | The town of the location. |
postcode | string | The postcode of the location. |
createdAt | string | The date and time when the location was created. |
updatedAt | string | The date and time when the location was last updated. |
GET /locations
Authorization: Bearer YOUR_ACCESS_TOKEN
[
{
"id": 1,
"county": "London",
"town": "Camden",
"postcode": "NW1 6XE",
"createdAt": "2023-12-01T10:15:23.000Z",
"updatedAt": "2023-12-01T10:15:23.000Z"
},
{
"id": 2,
"county": "Manchester",
"town": "Salford",
"postcode": "M5 4WT",
"createdAt": "2023-11-30T09:12:45.000Z",
"updatedAt": "2023-11-30T09:12:45.000Z"
},
// ... more locations
]
To access this API, you must include a valid bearer token in the request header. The API is protected by an authorization middleware (authorization
) and a protector middleware (protector
) to ensure that only authorized users can access the resource.
Please make sure to handle and securely store your access token. Unauthorized or improperly formatted tokens will result in a 401 Unauthorized response.
Feel free to use and adapt this documentation for your team's needs. If you have any further questions or adjustments, please let me know!