forked from Azure/logicapps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwitter-to-office.json
162 lines (162 loc) · 6.36 KB
/
twitter-to-office.json
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{
"id": "/providers/Microsoft.Logic/galleries/public/templates/05982e9b-911f-45d0-a3af-2cc19bc896d3",
"type": "Microsoft.Logic/galleries/templates",
"name": "05982e9b-911f-45d0-a3af-2cc19bc896d3",
"properties": {
"author": {
"displayName": "Microsoft"
},
"categoryNames": [
"social"
],
"description": "${Resources.TEMPLATE_TWITTER_TO_OFFICE_DESCRIPTION}",
"displayName": "${Resources.TEMPLATE_TWITTER_TO_OFFICE_DISPLAYNAME}",
"galleryName": "public",
"summary": "",
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Get_my_profile": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['office365users']['connectionId']"
}
},
"method": "get",
"path": "/users/me"
},
"runAfter": {
"Get_user": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"Get_user": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['twitter']['connectionId']"
}
},
"method": "get",
"path": "/user",
"queries": {
"userName": "@{triggerBody()['TweetedBy']}"
}
},
"runAfter": {},
"type": "ApiConnection"
},
"Send_email": {
"inputs": {
"body": {
"Body": "Tweet: @{triggerBody()['TweetText']}\n----\nTweeted at: @{triggerBody()?['CreatedAt']}\nhttps://twitter.com/@{triggerBody()['TweetedBy']}/status/@{triggerBody()?['TweetId']}\n----\nTweeted by: @{body('Get_user')['UserName']}\nDescription: @{triggerBody()['UserDetails']['Description']}\nFollowers: @{triggerBody()?['UserDetails']?['FollowersCount']}\nFriends:@{body('Get_user')?['FriendsCount']}",
"Subject": "New Tweet from @{body('Get_user')['FullName']}",
"To": "@{body('Get_my_profile')?['Mail']}"
},
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"path": "/Mail"
},
"runAfter": {
"Get_my_profile": [
"Succeeded"
]
},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"When_a_new_tweet_appears": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['twitter']['connectionId']"
}
},
"method": "get",
"path": "/onnewtweet",
"queries": {
"searchQuery": ""
}
},
"splitOn": "@triggerBody()?['value']",
"recurrence": {
"frequency": "Minute",
"interval": 3
},
"type": "ApiConnection"
}
}
},
"connectionReferences": {
"twitter": {
"connection": {
"id": ""
},
"api": {
"id": "/subscriptions/{0}/providers/Microsoft.Web/locations/{1}/managedApis/twitter"
}
},
"office365users": {
"connection": {
"id": ""
},
"api": {
"id": "/subscriptions/{0}/providers/Microsoft.Web/locations/{1}/managedApis/office365users"
}
},
"office365": {
"connection": {
"id": ""
},
"api": {
"id": "/subscriptions/{0}/providers/Microsoft.Web/locations/{1}/managedApis/office365"
}
}
},
"apiSummaries": [
{
"type": "apiconnection",
"displayName": "${Resources.TWITTER}",
"iconUri": "https://logicappsresources.blob.core.windows.net/icons/twitter.png",
"brandColor": "#5fa9dd"
},
{
"type": "apiconnection",
"displayName": "${Resources.OFFICE_USERS}",
"iconUri": "https://logicappsresources.blob.core.windows.net/icons/office365users.png",
"brandColor": "#eb3c00"
},
{
"type": "apiconnection",
"displayName": "${Resources.OFFICE}",
"iconUri": "https://logicappsresources.blob.core.windows.net/icons/office365.png",
"brandColor": "#0078D4"
},
{
"type": "apiconnection",
"displayName": "${Resources.TWITTER}",
"iconUri": "https://logicappsresources.blob.core.windows.net/icons/twitter.png",
"brandColor": "#5fa9dd"
}
],
"changedTime": "2017-07-05T00:00:40.000Z",
"createdTime": "2017-01-31T00:00:40.000Z",
"popularity": 21
}
}