Submitting a form with a schedule

In this example, we demonstrate how to get a form with a timeInterval field and submit a time slot using the OneEntry API.

✅ Purpose of the scenario:
  • Get form configuration with a timeInterval field from OneEntry Platform.
  • Understand the structure of the timeInterval attribute.
  • Submit a selected time slot to the OneEntry API.
✅ What you need:
  • A valid PROJECT_URL and APP_TOKEN for authentication with the OneEntry API.
  • A pre-configured form in OneEntry identified by the marker 'schedule'.
  • A pre-configured timeInterval attribute in the schedule form.
📌 Important:
  • The timeInterval value must be wrapped in an extra array: [[startISO, endISO]], not [startISO, endISO].
  • Time values must be in ISO 8601 format (UTC).
  • Handle potential errors during API requests gracefully to provide feedback to users.
  • These examples do not include error handling.
  • You can manage errors using a try-catch block or by employing a construction like await Promise.catch((error) => error).
Loading sandbox…