Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (105 sloc) 3.76 KB
{
"$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"
}
}
}
}