Skip to main content
Skip table of contents

Sample: Create an Integration with Twitter


This sample Twitter integration connects with the Twitter API and pulls relevant information by searching for a specific hashtag.

This integration is intended to provide an example of how you might choose to integrate with Twitter and should not be used in a production org.


Create a Twitter Application

An administrator must create a Twitter application to give the integration setting access to basic information from Twitter.

  1. Go to https://apps.twitter.com/.
  2. Log in with your Twitter account. 
  3. Click Create New App.
  4. Populate NameDescription, and Website.
  5. Click Create Your Twitter Application.
  6. Make note of the Consumer Key and Consumer Secret

Create Callout Integration Setting

  1. In the tab bar, click 
    App Launcher, or in Salesforce Classic, click 
    Nimble AMS, Staff View, Button, All Tabs.
  2. Click Integration Settings.
  3. Click New.

  4. In Record Type, select Callout.

  5. In Name, enter a name in pascal case to identify the integration.
  6. In Description, enter a description you can reference to understand the integration setting's purpose.
  7. In Authentication Key, enter a secure authentication key. 

    We recommend using a unique 256-bit WEP authentication key for each integration setting. You can generate a random key, using a random key generator such as Random Key Generator (external).

  8. In Class, enter SampleCalloutIntegration.

  9. Statusis populated.

  10. If you want to record log detail for the integration setting, in Logging Level, select the log detail level. More information about the level of detail stored can be found on the Understanding Logging Level page.

  11. To set the number of days the integration callout is retained within Nimble AMS, set the Archive Schedule Information:

    1. In Archive Format, enter the Apex scheduler expression. This field controls the frequency with which the archiving scheduled job is executed. See Apex Scheduler (external) to learn more about Apex schedules.

    2. In Archive Completed Storage Days, enter the number of days the integration callouts with a Status of Completed will be retained. 

    3. In Archive Failed Storage Days, enter the number of days the integration callouts with a Status of Failed will be retained.

    4. Deselect Archive Active.

      The archiving scheduled job must be created before it is activated. Any changes to the archiving scheduled job must be made while the archiving job is inactive.

  12. Click Save.

  13. Click Edit.

  14. Select Archive Active.

  15. Click Save.

Create Callout Integration Parameters

  1. Click Integration Settings.
  2. Select a list view—like All Inbound Integrations—and click Go!
  3. Click the name of the integration setting to which you want to add an integration parameter
  4. Create the Endpoint integration parameter:

    1. From the Inbound Integration Settings related list, click New Integration Parameter.

    2. Integration Setting is populated. 

    3. In Key, enter Endpoint.

    4. In Value, enter https://api.twitter.com/1.1/search/tweets.json?q=%23

    5. Click Save.

  5. Create the Hashtag integration parameter:

    1. From the Inbound Integration Settings related list, click New Integration Parameter.

    2. Integration Setting is populated. 

    3. In Key, enter Hashtag.

    4. In Value, enter the hashtag value for which the integration will search. For example, if you want to search for #Awesome, enter Awesome.

    5. Click Save.

  6. Create the Key integration parameter:

    1. From the Inbound Integration Settings related list, click New Integration Parameter.

    2. Integration Setting is populated. 

    3. In Key, enter Key.

    4. In Value, enter the Consumer Key for your Twitter Application.

    5. Click Save.

  7. Create the Secret integration parameter:

    1. From the Inbound Integration Settings related list, click New Integration Parameter.

    2. Integration Setting is populated.

    3. In Key, enter Secret

    4. In Value, enter the Consumer Secret for your Twitter Application.

    5. Click Save.

Create Integration Callout Worker

Administrators must create an integration callout worker to build and send the request to the third-party API. During the communication process, the integration callout worker saves the Request and Response on the integration callout for each execution. 

  1. In the tab bar, click 
    App Launcher, or in Salesforce Classic, click 
    Nimble AMS, Staff View, Button, All Tabs.
  2. Click Integration Settings.
  3. Select a list view—like All Callout Integrations—and click Go!
  4. Click the name of the integration setting to which you want to add an integration callout worker.
  5. From the Integration Callout Workers related list, click New Integration Callout Worker.

  6. Integration Setting is populated.

  7. In Worker Schedule, enter the Apex scheduler expression. This field controls the frequency with which the integration callout worker is executed. See Apex Scheduler to learn how to configure this field.

  8. Deselect Worker Active.

    The integration callout worker must first be created before it is activated. Changes to the integration callout worker must be made while the integration callout worker is inactive.

  9. Click Save.

  10. Click Edit.
  11. Select Worker Active to activate the integration callout worker.

  12. Click Save.


Create Integration Response Worker

Administrators must create an integration response worker to collect integration callouts with the Status of Pending. The integration response worker processes the response and updates the Status of the integration callout to Completed or Failed. The IntegrationSetting Apex class processes the response and determines whether the Status of the integration callout is set to Completed or Failed.

  1. In the tab bar, click 
    App Launcher, or in Salesforce Classic, click 
    Nimble AMS, Staff View, Button, All Tabs.
  2. Click Integration Settings.
  3. Select a list view—like All Callout Integrations—and click Go!
  4. Click the name of the integration setting to which you want to add an integration response worker.
  5. From the Integration Response Workers related list, click New Integration Response Worker.

  6. Integration Setting is populated.

  7. In Worker Schedule, enter the Apex scheduler expression. This field controls the frequency with which the integration response worker is executed. See Apex Scheduler to learn how to configure this field.

  8. In Worker Batch Size, enter the number of integration callouts with a Status of Pending the integration response worker will processes at a time.

  9. Deselect Worker Active.

    The integration response worker must first be created before it is activated. Changes to the integration response worker must be made while the integration response worker is inactive.

  10. Click Save.

  11. Click Edit.
  12. Select Worker Active to activate the integration response worker.

  13. Click Save.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.