POST/schedule

Create Schedule

Create schedule

Implementation Notes

This API call allows a user to create a timetable for running a specific shop at a predetermined date and time on a set schedule. While creating this schedule, the user can also define the mode of delivery. Options are a Web-Hook or through a queueid.

Parameter Details:

  • scheduleName: The name under which the schedule will be created.

  • shopId: A unique ID generated while creating the shop.

  • year:

    • "*" - No specification.
    • "2025" - One year only.
    • "2025, 2025" - Runs for two years.
  • month:

    • "*" - Runs all 12 months in a year.
    • "1" - January.
    • "2" - February.
    • "3" - March.
    • "4" - April.
    • "5" - May.
    • "6" - June.
    • "7" - July.
    • "8" - August.
    • "9" - September.
    • "10" - October.
    • "11" - November.
    • "12" - December.
    • "1,3" - January & March.
  • dow:

    • "*" - All days in a week.
    • "1" - Monday.
    • "2" - Tuesday.
    • "3" - Wednesday.
    • "4" - Thursday.
    • "5" - Friday.
    • "6" - Saturday.
    • "7" - Sunday.
    • "1,3,5" - Runs every Monday, Wednesday, and Friday.
  • day:

    • "*" - All days in a month.
    • "1-31" - Any day index in a calendar month. Can be passed as an expression like "1,3,5".
  • hour:

    • "*" - All hours in the day.
    • "0-23" - Any hour index in a day. Can be passed as an expression like "1,3,5". If the value is "*", it is considered undefined and can be run at 10:00 AM.
  • minute:

    • "0-59" - Any minute index in an hour. Can be passed as an expression like "1,3,5". If the value is "*", it is considered undefined and can be run at the defined hour.
  • fetchType:

    • The location/server space where the user would want their results to be stored.
    • Options:
      • 1 - s3.
      • 2 - endpoint.
      • s3: Email containing the path will be sent to the user once data is executed.
      • endpoint: User to specify a location of their preference.
  • shopType:

    • The type of shop.
    • Options:
      • 1 - eventsimpact.
      • 2 - eventsinfo.
      • 3 - hoteldemand.
  • startDate: This parameter determines when the schedule starts.

  • endDate: This parameter determines when the schedule ends. If left undefined, the schedule runs indefinitely.

    Mandatory Fields:

    • scheduleName
    • shopId
    • shopType
    • fetchType
    • year
    • month
    • dow
    • day
    • hour
    • minute
    • startDate
    • endDate
POST/schedule

Parameter Details

NameInTypeRequiredDescription
bodybodyobjectRequirednone
» scheduleNamebodystringOptionalName of the schedule.
» shopIdbodyintegerOptionalUnique ID generated when creating the shop.
» shopTypebodyintegerOptionalType of shop.
» fetchTypebodyintegerOptionalWhere results are stored.
» yearbodystring(date)OptionalYear(s) the schedule runs.
» monthbodystringOptionalMonth(s) the schedule runs.
» dowbodystringOptionalDays of the week the schedule runs.
» daybodystringOptionalDays of the month the schedule runs.
» hourbodystringOptionalHours the schedule runs.
» minutebodystringOptionalMinutes the schedule runs.
» startDatebodystring(date)OptionalStart date of the schedule (UTC format).
» endDatebodystring(date)OptionalEnd date of the schedule. If undefined, runs indefinitely.

Responses

StatusMeaningDescriptionSchema
201CreatedCreated
400Bad RequestBad RequestNone
401UnauthorizedUnauthorizedNone
429Too Many RequestsToo Many RequestsNone
500Internal Server ErrorInternal Server ErrorNone

Example Request

# You can also use wget
curl -X POST https://api.events.example.com/api/v1/schedule \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Body parameter

{
  "scheduleName": "",
  "shopId": 0,
  "shopType": 0,
  "fetchType": 0,
  "year": "*",
  "month": "*",
  "dow": "*",
  "day": "*",
  "hour": "*",
  "minute": "*",
  "startDate": "2019-08-24",
  "endDate": "2019-08-24"
}

Example responses

201 Response
{
  "message": "Schedule created successfully.",
  "scheduleId": 47
}

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.