Status Reminders ================ Current version: 2.0.0 Create ------ .. http:post:: /api2/statusherinneringen Create a new status reminder **Voorbeeld request**: .. sourcecode:: http POST /api2/statusherinneringen HTTP/1.1 Host: demo.recras.nl Accept: application/json { "naam": "Example statusreminder", "status": "reservering", "Bedrijven": [ { "id": 1 } ], "termijn_in_dagen": 7, "herinnering_termijn_in_dagen": 3, "onderwerp_mail_herinnering": "Email subject", "body_mail_herinnering": "Email body" } **Voorbeeld response**: .. sourcecode:: http HTTP/1.1 201 Created Content-Type: application/json Location: /api2/statusherinneringen/5 { "id": 5, "naam": "Example statusreminder", "status": "reservering", "Bedrijven": [ { "id": 1, "displaynaam": "Example company", } ], "termijn_in_dagen": 7, "herinnering_termijn_in_dagen": 3, "onderwerp_mail_herinnering": "Email subject", "body_mail_herinnering": "Email body" } :json string|null naam: Name for the status reminder, not communicated to customers. :json string status: **Required** The booking status for which to trigger this reminder. Please refer to :ref:`boekingsstatus` 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. :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. :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. :json string body_mail_herinnering: **Required** The body of email. :json array Bedrijven: A list of the companies 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. :statuscode 403: The currently authenticated user does not have the *editBoekingStatusHerinnering* 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``) triggered this error and about the other status reminder identifier (``Statusherinnering.id``) and common name (``Statusherinnering.naam``).