POST
/api/v1/scheduleCreate Schedule
This endpoint allows you to create custom schedules for executing flight shops at specified dates and times. You can define recurrence patterns such as daily, weekly, or specific days of the month using crontab-like fields.
- •timezones: Active and non-deleted timezones fetched from the Timezone model.
- •shops: Active, non-deleted shops associated with the authenticated user, excluding those marked as real-time.
POST
/api/v1/scheduleMandatory Fields
- _timezone: The ID of the timezone.
- dayOfMonth: The day(s) of the month when the schedule is active. Can be a number (1-31), or * to indicate all days. Multiple days should be separated by comma (,).
- month: The month(s) when the schedule is active. Can be a number (1-12), or * to indicate all months. Multiple months should be separated by comma (,).
- dayOfWeek: The day(s) of the week when the schedule is active. Can be a number (0-6), where 0 is Sunday, or * to indicate all days. Multiple days should be separated by comma (,).
- hour: The hour(s) when the schedule is active. Can be a number (0-23), or * to indicate all hours. Multiple hours should be separated by comma (,).
- minute: The minute(s) when the schedule is active. Can be a number (0-59). Multiple minutes are not accepted.
- isActiveStatus: Boolean value indicating whether the schedule is active (true or false).
- startDate: The start date of the schedule (format: YYYY-MM-DD).
- endDate: The end date of the schedule (format: YYYY-MM-DD).
- scheduleName: The name of the schedule.
- _shops: The ID(s) of the shop(s) associated with the schedule, separated by comma (,).
Parameter Details
| Name | In | Type | Required | Description |
|---|---|---|---|---|
body | body | Required | none |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Success | |
| 400 | Bad Request | Request data failed validation(s) | None |
| 401 | Unauthorized | Authentication Failed! | None |
| 429 | Too Many Requests | Too Many Requests. | None |
| 500 | Internal Server Error | Internal Server Error | None |
Example Request
# You can also use wget
curl -X POST /api/v1/schedule \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
Body parameter
{
"scheduleName": "Flightschedule name",
"_shops": [
"66fbd773cfa2fa105752dc26"
],
"_timezone": "64ae7e58d06e77f95bff0565",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}
Example responses
200 Response
{
"error": false,
"schedule": {
"scheduleName": "Flightschedule name",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"timezoneName": "Africa/Addis_Ababa",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"id": "63ff1e0bb2482db1c660e306"
}
}
Need Support?
Our team is here to help you integrate and make the most of our APIs. Get in touch for technical support, custom solutions, or any questions.