-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogicapp.definition
105 lines (105 loc) · 3.76 KB
/
logicapp.definition
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
{
"$connections": {
"value": {
"twitter": {
"connectionId": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/connections/twitter",
"connectionName": "twitter",
"id": "/subscriptions/xxx/providers/Microsoft.Web/locations/northeurope/managedApis/twitter"
}
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"actions": {
"HTTP": {
"inputs": {
"body": {
"callback_query": {
"id": "@triggerBody()?['callback_query_id']"
},
"message": {
"chat": {
"id": "@triggerBody()?['chatId']"
},
"text": "@item()['TweetText']",
"type": "tweet"
}
},
"method": "put",
"uri": "functionAppHTTPendpoint"
},
"runAfter": {},
"type": "Http"
}
},
"foreach": "@body('Get_user_timeline')",
"runAfter": {
"Get_user_timeline": [
"Succeeded"
]
},
"type": "Foreach"
},
"Get_user_timeline": {
"inputs": {
"host": {
"api": {
"runtimeUrl": "https://logic-apis-northeurope.azure-apim.net/apim/twitter"
},
"connection": {
"name": "@parameters('$connections')['twitter']['connectionId']"
}
},
"method": "get",
"path": "/usertimeline",
"queries": {
"maxResults": "@{triggerBody()?['count']}",
"userName": "@{triggerBody()?['searchfor']}"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"method": "POST",
"relativePath": "/getTweets",
"schema": {
"properties": {
"callback_query_id": {
"type": "string"
},
"chatId": {
"type": "number"
},
"count": {
"type": "number"
},
"searchfor": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
}
},
"kind": "Http",
"type": "Request"
}
}
}
}