POST
/api/v1/schedules/bulkBulk Schedule Upload
Bulk Schedule upload
The bulk schedules endpoint enables users to create multiple schedules at once. The sample data and template for the bulk upload can be downloaded from the “GET /schedules/bulk/sample” endpoint.
The CSV should contain the following headers:
- _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 |. - 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 |. - 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 |. - 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 |. - 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 | if multiple.
The provided data should align with the following structures retrieved from the database:
- 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.
The file should be uploaded in CSV format. The service will validate the CSV content and return a list of successfully created schedules or an error log if any issues are found.
POST
/api/v1/schedules/bulkParameter Details
| Name | In | Type | Required | Description |
|---|---|---|---|---|
body | body | object | Required | none |
» file | body | string(binary) | Required | The CSV file to upload. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Success | |
| 400 | Bad Request | Bad Request | |
| 401 | Unauthorized | Unauthorized | |
| 404 | Not Found | Not found. | |
| 429 | Too Many Requests | Too Many Requests. | None |
| 500 | Internal Server Error | Internal Server Error |
Example Request
# You can also use wget
curl -X POST https://api.flightrates.example.com/api/v1/schedules/bulk \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
Body parameter
file: string
Example responses
200 Response
{
"error": false,
"message": "Successfully Uploaded!",
"scheduleName": [
"Flightschedule_name_1",
"Flightschedule_name_2",
"Flightschedule_name_3"
],
"errorLog": []
}
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.