Update an Event Type

With this method, you can update a specific event type.

The ETag value is mandatory to update an event type. You must retrieve the ETag value of the event type using the GET (/ES/v1/EventTypes('<event type name>')) service. The ETag value is assigned to the request header parameter If-Match in the PATCH request. If you do not include the ETag value in the request header or if the ETag value is not correct, the server displays an error message.

Request

URI: /ES/v1/EventTypes('<event type name>')

Operation Type: CRUD

HTTP Method: PATCH

Permissions: <tde>.u

Request Header Parameters

Header Required Values
If-Match Yes Latest ETag value of a specific event type that is updated using the PATCH request.

Request Parameters

Parameter Required Data Type Description
Name Yes String Name of the event type

Request Example

/ES/v1/EventTypes('core.automobiles:ExceededTemperature')

Response

Response Status and Error Codes

Code Description
200 Event type updated successfully.

Payload

Format: JSON

Example 1

The following request payload updates the event type core.automobiles:ExceededTemperature by adding a new event code EQ14:

{
	"Name": "core.automobiles:ExceededTemperature",
	"PackageName": "core.automobiles",
	"Codes": [
	{
		"EventCode": "EQ14",
		"Operation": "ADD",
		"Descriptions": [{
			"LanguageCode": "en",
			"Description": "Event Code 14"
		}]
	}]
}

Example 2

The following request payload updates the event type core.automobiles:ExceededTemperature with the following:
  • New event code EQ14 added.

  • Empty arrays for Statuses and Severities indicate the fields EventStatus and EventSeverity accept free text or optional fields.

by adding a new event code and indicating the fields EventStatuses and EventSeverities :
{
  "Name": "core.automobiles:ExceededTemperature",
  "PackageName": "core.automobiles",
  "Statuses": [],
  "Severities": [],
  "Codes": [
    {
      "EventCode": "EQ14",
      "Operation": "ADD",
      "Descriptions": [
        {
          "LanguageCode": "en",
          "Description": "Event Code 14"
        }
      ]
    }
  ]
}