Start Times (Startmomenten)

Changelog

2.0.0

Breaking change: the datetime field no longer accepts a seconds component other than zero. The seconds component may be omitted or :00.

Create

POST /api2/startmomenten

Create a new start time

Example request:

POST /api2/startmomenten HTTP/1.1
Host: demo.recras.nl
Accept: application/json

{
      "startmomentgroep_id": 1,
      "datetime": "2019-01-01 12:00:00",
      "percentage_materiaal_online_boeking": null,
}

Example response:

HTTP/1.1 201 Created
Content-Type: application/json
Location: /api2/startmomenten/42

{
      "id": 42,
      "startmomentgroep_id": 1,
      "datetime": "2019-01-01 12:00:00",
      "percentage_materiaal_online_boeking": null,
}
JSON Parameters:
  • startmomentgroep_id (int) – Required The ID of the start time group (startmomentgroep_id)

  • datetime (datetime) – Required The ISO8601 date of the start time (startmoment)

Status Codes:
  • 201 Created – Start time created (Startmoment gemaakt)

  • 406 Not Acceptable – Error in input (Fout in de invoer)

  • 403 Forbidden – User does not have the editStartmomenten (editStartTimes) permission (Gebruiker heeft het recht editStartmomenten niet)

Create batch

POST /api2/startmomenten/batch

Create multiple new start times at once

Example request:

POST /api2/startmomenten/batch HTTP/1.1
Host: demo.recras.nl
Accept: application/json

{
      "startmomentgroep_id": 1,
      "datum_begin": "2019-01-01",
      "datum_eind": "2019-01-31",
      "interval": "1:0",
      "tijdbegin": "2019-01-01T10:00:00.000Z",
      "tijdeind": "2019-01-01T15:00:00.000Z",
      "percentage_materiaal_online_boeking": null,
      "weekdagen": [1, 2, 3, 4, 5],
}

Example response:

HTTP/1.1 201 Created
Content-Type: application/json
Location: /api2/startmomenten/batch
JSON Parameters:
  • startmomentgroep_id (int) – Required The ID of the start time group (startmomentgroep_id)

  • datum_begin (date) – Required The ISO8601 date of the first start time (datum_begin means start_date)

  • datum_eind (date) – Required The ISO8601 date of the last start time (datum_eind means end_date)

  • interval (string) – Required Interval between start times, in hours:minutes notation (uren:minuten)

  • tijdbegin (datetime) – Required The ISO8601 time of the first start time on each day (tijdbegin means start_time)

  • tijdeind (datetime) – Required The ISO8601 time of the last start time on each day (tijdeind means end_time)

  • weekdagen (array) – Required On which weekdays start times are added. 0 = Sunday, 1 = Monday, etc. (weekdagen means weekdays, zondag means Sunday, maandag means Monday)

Status Codes:
  • 201 Created – Start time created (Startmoment gemaakt)

  • 406 Not Acceptable – Error in input (Fout in de invoer)

  • 403 Forbidden – User does not have the editStartmomenten (editStartTimes) permission (Gebruiker heeft het recht editStartmomenten niet)

Read

GET /api2/startmomenten

The start times in Recras

Query Parameters:
  • embed (objectnaam) – Comma-separated list of objects to include in the results list. Possible object names are TaribaseArrangement, Producten (Products). See also _arrangementen </arrangementen> (packages) and _ProductenList </producten> (products list) (objectnaam means object_name)

Example request:

GET /api2/startmomenten HTTP/1.1
Host: demo.recras.nl
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
   {
      "id": 42,
      "startmomentgroep_id": 1,
      "datetime": "2019-01-01 12:00:00",
      "percentage_materiaal_online_boeking": null,
   },
]
Status Codes:
GET /api2/startmomenten/(int: id)

A specific start time

Example request:

GET /api2/startmomenten/42 HTTP/1.1
Host: demo.recras.nl
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
   "id": 42,
   "startmomentgroep_id": 1,
   "datetime": "2019-01-01 12:00:00",
   "percentage_materiaal_online_boeking": null,
}
Status Codes:

Update

PUT /api2/startmomenten/(int: id)

Example request:

PUT /api2/startmomenten/42 HTTP/1.1
Host: demo.recras.nl
Accept: application/json

{
   "id": 42,
   "startmomentgroep_id": 1,
   "datetime": "2019-01-01 12:30:00",
   "percentage_materiaal_online_boeking": 80,
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
   "id": 42,
   "startmomentgroep_id": 1,
   "datetime": "2019-01-01 12:30:00",
   "percentage_materiaal_online_boeking": 80,
}
JSON Parameters:
  • id (int) – ID-nummer, mag niet veranderd worden

Status Codes:
  • 200 OK – Start time updated (Startmoment aangepast)

  • 406 Not Acceptable – Error in input (Fout in de invoer)

  • 403 Forbidden – User does not have the editStartmomenten (editStartTimes) permission (Gebruiker heeft het recht editStartmomenten niet)

Delete

DELETE /api2/startmomenten/(int: id)

Example request:

DELETE /api2/startmomenten/42 HTTP/1.1
Host: demo.recras.nl

Example response:

HTTP/1.1 200 OK
Status Codes:
  • 200 OK – Start time deleted (Startmoment verwijderd)

  • 403 Forbidden – User does not have the editStartmomenten (editStartTimes) permission (Gebruiker heeft het recht editStartmomenten niet)

Delete batch

DELETE /api2/startmomenten/batch

Example request:

DELETE /api2/startmomenten/batch HTTP/1.1
Host: demo.recras.nl

{
      "startmomentgroep_id": 1,
      "datum_begin": "2019-01-01",
      "datum_eind": "2019-01-31",
      "weekdagen": [1, 2, 3, 4, 5],
}

Example response:

HTTP/1.1 200 OK
Status Codes:
  • 200 OK – Start times deleted (Startmomenten verwijderd)

  • 403 Forbidden – User does not have the editStartmomenten (editStartTimes) permission (Gebruiker heeft het recht editStartmomenten niet)

Error codes

With the Create or Update actions, these endpoint specific error messages may be encountered:

ERR_SECONDS_MUST_BE_ZERO

The seconds component of the timestamp must be zero.