POST/schedule

Create Schedule

Create Schedule

Implementation Notes:

This endpoint allows you to create custom schedules for executing review shops at specified dates and times.

Parameters

  • Year: Specifies the years for scheduling.
    • "*": No specific year
    • "2016": Only in 2016
    • "2016, 2017": In 2016 and 2017

  • Month: Specifies the months for scheduling.
    • "*": All 12 months
    • "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 and March

  • Day of Week: Specifies the days of the week for scheduling.
    • "*": All days
    • "1": Monday
    • "2": Tuesday
    • "3": Wednesday
    • "4": Thursday
    • "5": Friday
    • "6": Saturday
    • "0": Sunday
    • "1,3,5": Monday, Wednesday, and Friday

  • Day: Specifies the days of the month for scheduling.
    • "*": All days
    • "1-31": Specific days or ranges within the month (e.g., "1,3,5")

  • Hour: Specifies the hour of the day (0-23) when the review shop is triggered.
    • "*": Any hour within the day

  • Minute: Specifies the minute (0-59) within the hour when the review shop is triggered.
  • Seconds: Specifies the second (0-59) within the minute when the review shop is triggered
  • Status: Indicates whether the schedule is active or inactive.
    • 1 - Active
    • 0 - Inactive

  • startdate: Specifies when the schedule should start.
  • enddate: Specifies when the schedule should end. If left undefined, the schedule will run indefinitely.

Note: All schedules are queued every fifteen minutes. Therefore, jobs scheduled within the current fifteen minutes will run from the next hour.

Mandatory Fields:

  • scheduleName
  • shopId
  • year
  • month
  • dow
  • day
  • hour
  • minute
  • seconds
  • startDate
POST/schedule

Parameter Details

NameInTypeRequiredDescription
bodybodyobjectOptionalnone
» scheduleNamebodystringOptionalEnter the name of the schedule.
» shopIdbodynumberOptionalUnique code of the shopId which match from shops
» yearbodystringOptionalThe year component of the schedule. Use '*' to match any year.
» monthbodystringOptionalThe month component of the schedule. Use '*' to match any month.
» dowbodystringOptionalThe day of the week component of the schedule. Use '*' to match any day of the week.
» daybodystringOptionalThe day of the month component of the schedule. Use '*' to match any day of the month.
» hourbodystringOptionalThe hour component of the schedule. Use '*' to match any hour of the day.
» minutebodystringOptionalThe minute component of the schedule. Use '*' to match any minute of the hour.
» secondsbodystringOptionalThe second component of the schedule. Use '*' to match any second of the minute.
» startDatebodystring(date)OptionalThe start date of the schedule.
» endDatebodystring(date)OptionalThe end date of the schedule.

Responses

StatusMeaningDescriptionSchema
201CreatedCreated
400Bad RequestBad RequestNone
401UnauthorizedAuthorization FailedNone
404Not FoundNot foundNone
429Too Many RequestsToo Many RequestsNone
500Internal Server ErrorInternal Server ErrorNone

Example Request

# You can also use wget
curl -X POST http://localhost:3000/schedule \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

Body parameter

{
  "scheduleName": "X-Mas",
  "shopId": 1234,
  "year": "*",
  "month": "*",
  "dow": "*",
  "day": "*",
  "hour": "1",
  "minute": "00",
  "seconds": "00",
  "startDate": "2019-08-24",
  "endDate": "2019-08-24"
}

Example responses

201 Response
{
  "message": "Schedule details inserted successfully!",
  "scheduleId": 2233
}

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.