Update Event Template

Overview

The Arianee event template update enables you to modify and enhance existing event templates to ensure they remain accurate, engaging, and relevant.

Let's start πŸš€

URL

Required rights: admin or certCreate

To update an event template, use the /arianeeEventTemplate.

PUT - https://{{nmpUrl}}/arianeeEventTemplate

Body

FieldTypeRequiredDescription
metadataObject❌Contains additional information about the event template.
nameString❌The display name of the event template. Example: "Service Event".
iconString❌A URL pointing to an icon that visually represents the event template.
contentString❌Contains the core event information respecting the Event Schema.
{
  "deleted": false,
  "metadata": {
    "name": "Activation de la garantie",
    "icon": "https://img.freepik.com/vecteurs-premium/vecteur-conception-modele-logo-service_20029-568.jpg"
  },
  "content": "{\"eventType\":\"warranty\",\"language\":\"fr-FR\",\"title\":\"Activation de la garantie\",\"description\":\"La garantie de votre produit a été activée ou mise à jour avec succès. Pour une durée de %duree%.\",\"i18n\":[],\"$schema\":\"https://cert.arianee.org/version3/ArianeeEvent-i18n.json\"}",
  "attributes": [
{
      "field": "%duree%",
      "label": "DurΓ©e",
      "freeEntry": true,
      "required": true,
      "type": "select",
      "options": [
        {
          "label": "1 an",
          "value": "1 an"
        },
        {
          "label": "2 ans",
          "value": "2 ans"
        },
        {
          "label": "4 ans",
          "value": "4 ans"
        }
      ]
    }
  ]
}

Return Payload

Status CodeSuccessDescription
200trueThe event template has been updated.
{
    "_id": "67a08e452ef96f911a194989",
    "deleted": false,
    "metadata": {
        "name": "Activation de la garantie",
        "icon": "https://img.freepik.com/vecteurs-premium/vecteur-conception-modele-logo-service_20029-568.jpg"
    },
    "content": "{\"eventType\":\"warranty\",\"language\":\"fr-FR\",\"title\":\"Activation de la garantie\",\"description\":\"La garantie de votre produit a été activée ou mise à jour avec succès. Pour une durée de %duree%.\",\"i18n\":[],\"$schema\":\"https://cert.arianee.org/version3/ArianeeEvent-i18n.json\"}",
    "attributes": [
        {
            "field": "%duree%",
            "label": "DurΓ©e",
            "freeEntry": true,
            "required": true,
            "type": "select",
            "options": [
                {
                    "label": "1 an",
                    "value": "1 an"
                },
                {
                    "label": "2 ans",
                    "value": "2 ans"
                },
                {
                    "label": "4 ans",
                    "value": "4 ans"
                }
            ]
        }
    ],
    "__v": 0,
    "id": "67a08e452ef96f911a194989"
}

Errors

Status CodeSuccessError Message
500falseThe event template ID may be wrong.
{
    "stringValue": "\"67a08e452ef96f911a19498\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "67a08e452ef96f911a19498",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"67a08e452ef96f911a19498\" (type string) at path \"_id\" for model \"ArianeeEventTemplate\""
}