POST/api/v1/schedules/bulk

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

Parameter Details

NameInTypeRequiredDescription
bodybodyobjectRequirednone
» filebodystring(binary)RequiredThe CSV file to upload.

Responses

StatusMeaningDescriptionSchema
200OKSuccess
400Bad RequestBad Request
401UnauthorizedUnauthorized
404Not FoundNot found.
429Too Many RequestsToo Many Requests.None
500Internal Server ErrorInternal 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.