|
1 | 1 | ---
|
2 |
| -title: Learn how to use the Twitter connector in logic apps | Microsoft Docs |
3 |
| -description: Overview of Twitter connector with REST API parameters |
4 |
| -services: '' |
5 |
| -documentationcenter: '' |
| 2 | +title: Connect to Twitter from Azure Logic Apps | Microsoft Docs |
| 3 | +description: Automate tasks and workflows that monitor and manage tweets, plus get data about followers, your followed users, other users, timelines, and more from your Twitter account by using Azure Logic Apps |
| 4 | +services: logic-apps |
| 5 | +ms.service: logic-apps |
| 6 | +ms.suite: integration |
6 | 7 | author: ecfan
|
7 |
| -manager: jeconnoc |
8 |
| -editor: '' |
9 |
| -tags: connectors |
10 |
| - |
| 8 | +ms.author: estfan |
| 9 | +ms.reviewer: klam, LADocs |
11 | 10 | ms.assetid: 8bce2183-544d-4668-a2dc-9a62c152d9fa
|
12 |
| -ms.service: multiple |
13 |
| -ms.devlang: na |
14 | 11 | ms.topic: article
|
15 |
| -ms.tgt_pltfrm: na |
16 |
| -ms.workload: na |
17 |
| -ms.date: 07/18/2016 |
18 |
| -ms.author: estfan; ladocs |
19 |
| - |
| 12 | +tags: connectors |
| 13 | +ms.date: 08/25/2018 |
20 | 14 | ---
|
21 |
| -# Get started with the Twitter connector |
22 |
| -With the Twitter connector you can: |
23 | 15 |
|
24 |
| -* Post tweets and get tweets |
25 |
| -* Access timelines, friends, and followers |
26 |
| -* Perform any of the other actions and triggers described in this article |
| 16 | +# Monitor and manage Twitter by using Azure Logic Apps |
| 17 | + |
| 18 | +With Azure Logic Apps and the Twitter connector, |
| 19 | +you can create automated tasks and workflows that monitor |
| 20 | +and manage data you care about in Twitter such as tweets, |
| 21 | +followers, users and followed users, timelines, and more, |
| 22 | +along with other actions, for example: |
| 23 | + |
| 24 | +* Monitor, post, and search tweets. |
| 25 | +* Get data such as followers, followed users, timelines, and more. |
| 26 | + |
| 27 | +You can use triggers that get responses from your Twitter account |
| 28 | +and make the output available to other actions. You can use actions |
| 29 | +that perform tasks with your Twitter account. You can also have |
| 30 | +other actions use the output from Twitter actions. For example, |
| 31 | +when a new tweet with a specific hashtag appears, you can send |
| 32 | +messages with the Slack connector. If you're new to logic apps, |
| 33 | +review [What is Azure Logic Apps?](../logic-apps/logic-apps-overview.md) |
| 34 | + |
| 35 | +## Prerequisites |
| 36 | + |
| 37 | +* An Azure subscription. If you don't have an Azure subscription, |
| 38 | +<a href="https://azure.microsoft.com/free/" target="_blank">sign up for a free Azure account</a>. |
27 | 39 |
|
28 |
| -To use [any connector](apis-list.md), you first need to create a logic app. You can get started by [creating a logic app now](../logic-apps/quickstart-create-first-logic-app-workflow.md). |
| 40 | +* Your Twitter account and user credentials |
| 41 | + |
| 42 | + Your credentials authorize your logic app to create |
| 43 | + a connection and access your Twitter account. |
| 44 | + |
| 45 | +* Basic knowledge about |
| 46 | +[how to create logic apps](../logic-apps/quickstart-create-first-logic-app-workflow.md) |
| 47 | + |
| 48 | +* The logic app where you want to access your Twitter account. |
| 49 | +To start with a Twitter trigger, [create a blank logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md). |
| 50 | +To use a Twitter action, start your logic app with another trigger, |
| 51 | +for example, the **Recurrence** trigger. |
29 | 52 |
|
30 | 53 | ## Connect to Twitter
|
31 |
| -Before your logic app can access any service, you first need to create a *connection* to the service. A [connection](connectors-overview.md) provides connectivity between a logic app and another service. |
32 |
| - |
33 |
| -### Create a connection to Twitter |
34 |
| -> [!INCLUDE [Steps to create a connection to Twitter](../../includes/connectors-create-api-twitter.md)] |
35 |
| -> |
36 |
| -> |
37 |
| -
|
38 |
| -## Use a Twitter trigger |
39 |
| -A trigger is an event that can be used to start the workflow defined in a logic app. [Learn more about triggers](../logic-apps/logic-apps-overview.md#logic-app-concepts). |
40 |
| - |
41 |
| -In this example, you use the **When a new tweet is posted** trigger to search for #Seattle. And if #Seattle is found, update a file in Dropbox with the text from the tweet. In an enterprise example, you could search for the name of your company and update a SQL database with the text from the tweet. |
42 |
| - |
43 |
| -1. Enter *twitter* in the search box on the logic apps designer then select the **Twitter - When a new tweet is posted** trigger |
44 |
| -  |
45 |
| -2. Enter *#Seattle* in the **Search Text** control |
46 |
| -  |
47 |
| - |
48 |
| -At this point, your logic app has been configured with a trigger that will begin a run of the other triggers and actions in the workflow. |
49 |
| - |
50 |
| -> [!NOTE] |
51 |
| -> For a logic app to be functional, it must contain at least one trigger and one action. Use the steps in the next section to add an action. |
52 |
| -
|
53 |
| -## Add a condition |
54 |
| -We are only interested in tweets from users with more than 50 users. So, a condition that confirms the number of followers is added to the logic app first. |
55 |
| - |
56 |
| -1. Select **+ New step** to add the action you would like to take when #Seattle is found in a new tweet |
57 |
| -  |
58 |
| -2. Select the **Add a condition** link. |
59 |
| -  |
60 |
| - This opens the **Condition** control where you can check conditions such as *is equal to*, *is less than*, *is greater than*, *contains*, etc. |
61 |
| -  |
62 |
| -3. Select the **Choose a value** control. In this control, you can select one or more of the properties from any previous actions or triggers. The condition of this property value is evaluated to true or false. |
63 |
| -  |
64 |
| -4. Select the **...** to expand the list of properties so you can see all the properties that are available. |
65 |
| -  |
66 |
| -5. Select the **Followers count** property. |
67 |
| -  |
68 |
| -6. Notice the Followers count property is now in the value control. |
69 |
| -  |
70 |
| -7. Select **is greater than** from the operators list. |
71 |
| -  |
72 |
| -8. Enter 50 as the operand for the *is greater than* operator. |
73 |
| - The condition is now added. Save your work using the **Save** link on the menu. |
74 |
| -  |
75 |
| - |
76 |
| -## Use a Twitter action |
77 |
| -An action is an operation carried out by the workflow defined in a logic app. [Learn more about actions](../logic-apps/logic-apps-overview.md#logic-app-concepts). |
78 |
| - |
79 |
| -Now that there's a trigger, add an action that posts a new tweet with the contents of the tweets found by the trigger. For this walk-through, only tweets from users with more than 50 followers are posted. |
80 |
| - |
81 |
| -In the next step, add a Twitter action that posts a tweet using some of the properties of each tweet that is posted by a user with more than 50 followers. |
82 |
| - |
83 |
| -1. Select **Add an action**. This step opens the search control where you can search for other actions and triggers. |
84 |
| -  |
85 |
| -2. Enter *twitter* into the search box then select the **Twitter - Post a tweet** action. This step opens the **Post a tweet** control where you enter all details for the tweet being posted. |
86 |
| -  |
87 |
| -3. Select the **Tweet text** control. All outputs from previous actions and triggers in the logic app are now visible. You can select any of these outputs, and use them as part of the tweet text of the new tweet. |
88 |
| -  |
89 |
| -4. Select **User name** |
90 |
| -5. Immediately after User name, enter *says:* in the tweet text control. |
91 |
| -6. Select *Tweet text*. |
92 |
| -  |
93 |
| -7. To activate your workflow, save your work, and send a tweet with the #Seattle hashtag. |
94 |
| - |
95 |
| - |
96 |
| -## Connector-specific details |
97 |
| - |
98 |
| -View any triggers and actions defined in the swagger, and also see any limits in the [connector details](/connectors/twitterconnector/). |
| 54 | + |
| 55 | +[!INCLUDE [Create connection general intro](../../includes/connectors-create-connection-general-intro.md)] |
| 56 | + |
| 57 | +1. Sign in to the [Azure portal](https://portal.azure.com), |
| 58 | +and open your logic app in Logic App Designer, if not open already. |
| 59 | + |
| 60 | +1. Choose a path: |
| 61 | + |
| 62 | + * For blank logic apps, in the search box, |
| 63 | + enter "twitter" as your filter. |
| 64 | + Under the triggers list, select the trigger you want. |
| 65 | + |
| 66 | + -or- |
| 67 | + |
| 68 | + * For existing logic apps: |
| 69 | + |
| 70 | + * Under the last step where you want to add an action, |
| 71 | + choose **New step**. |
| 72 | + |
| 73 | + -or- |
| 74 | + |
| 75 | + * Between the steps where you want to add an action, |
| 76 | + move your pointer over the arrow between steps. |
| 77 | + Choose the plus sign (**+**) that appears, |
| 78 | + and then select **Add an action**. |
| 79 | + |
| 80 | + In the search box, enter "twitter" as your filter. |
| 81 | + Under the actions list, select the action you want. |
| 82 | + |
| 83 | +1. If you're prompted to sign in to Twitter, |
| 84 | +sign in now so you can authorize access for your logic app. |
| 85 | + |
| 86 | +1. Provide the necessary details for your selected trigger |
| 87 | +or action and continue building your logic app's workflow. |
| 88 | + |
| 89 | +## Examples |
| 90 | + |
| 91 | +### Twitter trigger: When a new tweet is posted |
| 92 | + |
| 93 | +This trigger starts a logic app workflow when the trigger detects |
| 94 | +a new tweet, for example, with the hashtag, #Seattle. So for example, |
| 95 | +when these tweets are found, you can add a file with the tweets' |
| 96 | +contents to storage, such as a Dropbox account by using the Dropbox connector. |
| 97 | + |
| 98 | +Optionally, you can include a condition that eligible tweets |
| 99 | +must come from users with at least a specified number of followers. |
| 100 | + |
| 101 | +**Enterprise example**: You can use this trigger to monitor tweets |
| 102 | +about your company and upload the tweets' content to a SQL database. |
| 103 | + |
| 104 | +### Twitter action: Post a tweet |
| 105 | + |
| 106 | +This action posts a tweet, but you can set up the action so that the tweet |
| 107 | +contains the content from tweets found by the previously described trigger. |
| 108 | + |
| 109 | +## Connector reference |
| 110 | + |
| 111 | +For technical details about triggers, actions, and limits, which are |
| 112 | +described by the connector's OpenAPI (formerly Swagger) description, |
| 113 | +review the connector's [reference page](/connectors/twitterconnector/). |
| 114 | + |
| 115 | +## Get support |
| 116 | + |
| 117 | +* For questions, visit the [Azure Logic Apps forum](https://social.msdn.microsoft.com/Forums/en-US/home?forum=azurelogicapps). |
| 118 | +* To submit or vote on feature ideas, visit the [Logic Apps user feedback site](http://aka.ms/logicapps-wish). |
99 | 119 |
|
100 | 120 | ## Next steps
|
101 |
| -[Create a logic app](../logic-apps/quickstart-create-first-logic-app-workflow.md) |
| 121 | + |
| 122 | +* Learn about other [Logic Apps connectors](../connectors/apis-list.md) |
0 commit comments