Status Reminders ================ Current version: 2.0.0 Create ------ .. http:post:: /api2/statusherinneringen Create a new status reminder **Example request**: .. sourcecode:: http POST /api2/statusherinneringen HTTP/1.1 Host: demo.recras.nl Accept: application/json { "naam": "Example statusreminder", "status": "reservering", // (reservation) "Bedrijven": [ // (Companies) { "id": 1 } ], "termijn_in_dagen": 7, // (term_in_days) "herinnering_termijn_in_dagen": 3, // (reminder_term_in_days) "onderwerp_mail_herinnering": "Email subject", // (subject_email_reminder) "body_mail_herinnering": "Email body" // (body_email_reminder) } **Example response**: .. sourcecode:: http HTTP/1.1 201 Created Content-Type: application/json Location: /api2/statusherinneringen/5 { "id": 5, "naam": "Example statusreminder", "status": "reservering", // (reservation) "Bedrijven": [ // (Companies) { "id": 1, "displaynaam": "Example company", // (display_name) } ], "termijn_in_dagen": 7, // (term_in_days) "herinnering_termijn_in_dagen": 3, // (reminder_term_in_days) "onderwerp_mail_herinnering": "Email subject", // (subject_email_reminder) "body_mail_herinnering": "Email body" // (body_email_reminder) } :json string|null naam: Name for the status reminder, not communicated to customers. (`naam` means name) :json string status: **Required** The booking status for which to trigger this reminder. Please refer to :ref:`booking_status` for information about booking statuses. :json int termijn_in_dagen: **Required** Amount of days the booking should be at the specified status, after which this reminder will be triggered. (`termijn_in_dagen` means term_in_days) :json int herinnering_termijn_in_dagen: **Required** Amount of days the booking's status expiration date should be moved when this status reminder is triggered. (`herinnering_termijn_in_dagen` means reminder_term_in_days) :json string onderwerp_mail_herinnering: **Required** The subject line of the email that should be sent to the customer's main contact when this status reminder is triggered. (`onderwerp_mail_herinnering` means subject_email_reminder) :json string body_mail_herinnering: **Required** The body of email. (`body_mail_herinnering` means body_email_reminder) :json array Bedrijven: A list of the companies (`Bedrijven`) for which this status reminder should be triggered. Each company is limited to at most one reminder for each booking status. :json int Bedrijven[].id: **Required** The ``id`` reference of the company. All other fields for company objects are currently ignored; this may change in the future, API consumers are advised not to send other fields to this endpoint. :resheader Location: The URI of the newly created status reminder :statuscode 201: Status reminder successfully created, the body resembles the result of the *Read* request. :statuscode 406: Error in the input. Please refer to :ref:`statusreminders_errors` for information about specific error messages. (`Fout in de invoer`) :statuscode 403: The currently authenticated user does not have the *editBoekingStatusHerinnering* (editBookingStatusReminder) permission. Read ---- .. http:get:: /api2/statusherinneringen A list of all status reminders. *This section should be finished, please contact Recras development for more information* :reqheader Authorization: **Required** Basic authentication :statuscode 200: no error .. http:get:: /api2/statusherinneringen/(int:id) A status reminder identified by ``id``. *This section should be finished, please contact Recras development for more information* :reqheader Authorization: **Required** Basic authentication :statuscode 200: OK :statuscode 404: There is no status reminder with this ``id`` Update ------ .. http:put:: /api2/statusherinneringen/(int:id) *This section should be finished, please contact Recras development for more information. This endpoint should resemble the *create* action* Delete ------ .. http:delete:: /api2/statusherinneringen/(int:id) *This section should be finished, please contact Recras development for more information* .. _statusreminders_errors: Error codes ----------- With the *Create* or *Update* actions, these endpoint specific error messages may be encountered: ERR_COMPANY_STATUS_REMINDER_TAKEN A company you've tried to add already is linked to another status reminder with the specified ``status``. The ``params`` field gives information about which company (``Bedrijf.id`` (Company.id)) triggered this error and about the other status reminder identifier (``Statusherinnering.id`` (StatusReminder.id)) and common name (``Statusherinnering.naam`` (StatusReminder.name)).