PUT
/api/v1/schedules/bulkupdateBulk Schedule Update
Bulk Update Schedules
This endpoint allows users to bulk update schedule data using a CSV file. The CSV file should contain the following headers, and each row in the file represents a schedule entry:
- _id: The unique identifier for the schedule. This field is required for each schedule to be updated.
- _timezone: The ID of the timezone associated with the schedule. This field is required.
- 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's activity (format: YYYY-MM-DD). The date cannot be in the past.
- endDate: The end date of the schedule's activity (format: YYYY-MM-DD).
- scheduleName: A unique name for the schedule. This field is required.
- _shop: The ID of the shop associated with the schedule. This field is required.
PUT
/api/v1/schedules/bulkupdateParameter Details
| Name | In | Type | Required | Description |
|---|---|---|---|---|
body | body | object | Required | none |
ยป file | body | string(binary) | Required | The CSV file containing the schedule data. |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Schedules updated successfully. | |
| 400 | Bad Request | Bad Request. Column names do not match or required fields are missing. | |
| 401 | Unauthorized | Unauthorized - authentication failed | None |
| 404 | Not Found | No schedule found to be updated. | |
| 429 | Too Many Requests | Too Many Requests. | None |
| 500 | Internal Server Error | An error occurred while updating schedules. |
Example Request
# You can also use wget
curl -X PUT https://api.flightrates.example.com/api/v1/schedules/bulkupdate \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
Body parameter
file: string
Example responses
200 Response
{
"error": false,
"statusCode": 200,
"message": "Schedules updated successfully.",
"scheduleName": [
"670df5a392984ee41f158228",
"670df5a392984ee41f158226"
],
"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.