Edit Event

DESCRIPTION 

To edit an existing event in the system. 

The user can edit an existing event by sending the event with the ID and all the event details - the same as in the add event API.

DEFINITION

PUT https://api.anodot.com/api/v1/user-events?token=<api token>

HEADERS

Content-type=application/json

BODY

    "event": {
    "id" : "<event id>"
    "title": "<event title>",
    "description": "<event description>",
    "category": "<category name>",
    "source": "<source name>",
    "properties": [
      {
        "key": "<key1>",
        "value": "<value1>"
      },
      {
        "key": "<key2>",
        "value": "<value2>"
     
    ],
    "startDate": "<epoch startDate>",
    "endDate": "<epoch endDate>"
  }

 ARGUMENT\ DEFINITION

id

The ID of the event

Title

 The event's title [required]

Description

A description of the event. Can be HTML [optional]

Category

The name of the category that the event belongs to (e.g deployments, marketing_campaigns, jewish_holidays) [required].

To add a new category, see Create Category.

Source

The source of the request (e.g rest_api, Chef, Jenkins) [required]. 

To add a new source, see Create Source.

Properties key-value pairs, generic, can be whatever the user wants to add as additional data except the ones that are already part of the body arguments like title, description, category and so on, valid ones can be as follows:  severity:high, publisher: nyt, exchange: rubicon. [optional]
StartDate The start time of the event [required]
EndDate The end time of the event [optional]

EXAMPLE REQUEST

 curl \
-X PUT \
-d '{"event":{"id":"b1229900-1a49-4b9e-a2e4-b9d21240793f","title":"deployment started on myServer","description":"my description","category":"deployments","source":"chef","properties":[{"key":"service","value":"myService"}],"startDate":"1468326864"}}' \
-H "Content-Type:application/json" \
'https://api.anodot.com/api/v1/user-events?token=<API TOKEN>'

EXAMPLE RESPONSE

  {
   "id":"b1229900-1a49-4b9e-a2e4-b9d21240793f",
   "title":"deployment started on myServer",
   "description":"my description",
   "source":"chef",
   "category":"deployments",
   "startDate":1468326864,
   "endDate":null,
   "properties":[
      {
         "key":"service",
         "value":"myService"
      }
   ]
}

 Note: For more details about example responses, see Success and Errors

Was this article helpful?
0 out of 0 found this helpful