Online Docs

Create Event

Create a new event in a specified channel.

1
2
3
4
5
POST odata/eventDefinitions
--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]
--data-raw: {Event-Object}

URL Endpoint

odata/eventDefinitions

Method

POST.

Parameters

Do not supply OData Filter syntax.

Request

Header

1
2
3
--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]

Body

In the request body, supply a JSON representation of Event object.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{

"teamId": [TeamID],

"channelId": [ChannelID],

"entityType": [Type],

"eventName": [EventnNme],

"enable": true,

"triggerType": [Trigger],

"conditionsOps": [ConditionsOps],

"conditions": [

{

"ops": [conditionsOps],

"conditions": [ConditionObject]

}

],

"actionType": [ActionType],

"action": {[ActionObject]}

}

[conditionsOps] has two values: "and" or "or"

The [Condition Object] includes the conditions for executing the following action with the following structure:

{

"field": [FieldName],

"ops": [Ops],

"value": [Value]

}

The available entities of the [FieldName] are: “Title”, “Body”, “AssignTo”, “Status”, “Priority”, “Source”, “Start Date”, and “Due Date”.
eTask supports the action type is “HTTP” and “SendMail”. Each type will have a specified [ActionObject]

Response

If successful, this method returns a 200 OK response code and the event object.

Example

Request

1
2
3
--x-appvity-channelId: [ChannelID]
--x-appvity-teamid: [TeamID]
--Cookie: graphNodeCookie=[ID]

Body

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"teamId": "19:15c258785b4040699180e7a8ad6c6014@thread.tacv2",
"channelId": "19:15c258785b4040699180e7a8ad6c6014@thread.tacv2",
"entityType": "task",
"eventName": "Test New Event ",
"enable": true,
"triggerType": "ITEM_CREATED",
"conditionsOps": "and",
"conditions": [
{
"ops": "and",
"conditions": [
{
"field": "status",
"ops": "Is",
"value": "Not Started"
}
]
}
],
"actionType": "SendMail",
"action": {
"sendAs": "team.etask.mail@anadea",
"to": {
"projectManager": false,
"whoCreateTask": false,
"whoAssignedTask": true,
"specificPeople": false,
"people": []
},
"cc": {
"projectManager": false,
"whoCreateTask": false,
"whoAssignedTask": false,
"specificPeople": false,
"people": []
},
"bcc": {
"projectManager": false,
"whoCreateTask": false,
"whoAssignedTask": false,
"specificPeople": false,
"people": []
}
}
}

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"@odata.context": "https://schema.appvity.com/odata/$metadata#eventDefinitions/$entity",
"@odata.editLink": "https://schema.appvity.com/odata/eventDefinitions('5f72a3404d596392f5abd604')",
"@odata.id": "https://schema.appvity.com/odata/eventDefinitions('5f72a3404d596392f5abd604')",
"entityType": "task",
"eventName": "Test New Event ",
"enable": true,
"triggerType": "ITEM_CREATED",
"conditionsOps": "and",
"conditions": [
{
"ops": "and",
"conditions": [
{
"field": "status",
"ops": "Is",
"value": "Not Started"
}
]
}
],
"actionType": "SendMail",
"action": {
"sendAs": "team.etask.mail@anadea",
"to": {
"projectManager": false,
"whoCreateTask": false,
"whoAssignedTask": true,
"specificPeople": false,
"people": []
},
"cc": {
"projectManager": false,
"whoCreateTask": false,
"whoAssignedTask": false,
"specificPeople": false,
"people": []
},
"bcc": {
"projectManager": false,
"whoCreateTask": false,
"whoAssignedTask": false,
"specificPeople": false,
"people": []
}
},
"createdAt": "2020-09-29T03:00:16.669Z",
"updatedAt": "2020-09-29T03:00:16.669Z",
"_id": "5f72a3404d596392f5abd604",
"internalId": 38
}

Comment

Was this article helpful?
Thanks For Your Feedback