PUT/api/v1/schedules/bulkupdate

Bulk 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/bulkupdate

Parameter Details

NameInTypeRequiredDescription
bodybodyobjectRequirednone
ยป filebodystring(binary)RequiredThe CSV file containing the schedule data.

Responses

StatusMeaningDescriptionSchema
200OKSchedules updated successfully.
400Bad RequestBad Request. Column names do not match or required fields are missing.
401UnauthorizedUnauthorized - authentication failedNone
404Not FoundNo schedule found to be updated.
429Too Many RequestsToo Many Requests.None
500Internal Server ErrorAn 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.