Create Source

DESCRIPTION

To create a new source.

There are default sources that we provide that cannot be removed: Anodot, Slack, ChefJenkins and others.

DEFINITION

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

HEADERS

Content-type=application/json

BODY

{
  "source": {
    "imageUrl": "<image url>",
    "name": "<source name>"
    }  
}

ARGUMENT\ DEFINITION

name

The name of the source and the way it will be displayed. The source name must be unique [required]

ImageUrl

A url to the image that will be displayed as an icon for the source [optional]
The ImageUrl must be located under a secure server - for example  https://myServer/myImage.png

EXAMPLE REQUEST

curl \
-X POST \
-d '{"source":{"imageUrl":"https://s3.amazonaws.com/anodot-images-common/logo-anodot.png","name":"mySource"}}' \
-H "Content-Type: application/json" \
'https://api.anodot.com/api/v1/user-events/sources?token=<API TOKEN>'

EXAMPLE RESPONSE

 {
   "id":"430f648e-f5e3-40ca-a7e5-50b773ede81b",
   "imageUrl":"https://s3.amazonaws.com/anodot-images-common/logo-anodot.png",
   "name":"mySource",
   "owner":"user"
}

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

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