Configure AOP and Social Media

For AOP, the value of access to social media is in its immediacy and proximity to an incident. Social media makes it possible to take advantage of people witnessing and photographing events. Incident commanders can gain intelligence on a developing incident within seconds. The usefulness of the data is dependent on time and the geographic location being filtered down to a reasonable set of results.

In AOP, the incident commander can define an area and all the spatially located Twitter and Instagram feeds are provided.

Set up Social Media Accounts

Because social media can be a valuable source of real-time information, AOP includes photos from Twitter and Instagram into its communication channels to enable you to use the data during emergency situations.

You can also configure AOP to use data from the Open Weather API to provide real time weather data information for any point on the map, or to automatically determine downwind evacuation zones when using the ERG Chemical Spill Workflow.

Before you begin social media configuration, ensure that your organization has set up standard free accounts dedicated for AOP use.

Set up dedicated accounts for the following source websites:

When you have the accounts, you need configure the tokens provided by each account to give the AOP application access to them.

Connect Twitter to AOP

Once you have set up your dedicated AOP Twitter account, you need to:

  1. Create an application in Twitter.
  2. Connect AOP to twitter by using the new application's Consumer Key and Consumer Secret.

In order to create the application, you need a valid mobile phone number to associate with the Twitter account you are using.

Create an Application in Twitter

To create an application in Twitter: 

  1. In a browser on a computer, go to https://apps.twitter.com/.

  2. Sign in using the username and password for your AOP-specific Twitter account.

  3. On the Twitter Apps page, click Create New App.

  4. On the Create an Application page, fill in the information.

    The mobile phone number must be valid and URLs you enter need to be fully qualified to work
  5. Click Create your Twitter application.

    Your application opens.

  6. Select the Keys and Access Tokens tab.

  7. Copy and paste the Consumer Key and the Consumer Secret so that you can use them to configure Twitter in AOP.

Give AOP Access to Twitter

To grant AOP access to Twitter:

  1. Log into Geocortex Essentials Manager.

  2. Click your AOP site to edit it.

  3. On the Map page, click the Map Services tab.

  4. In the sidebar, click Workflows.

  5. Click beside the Twitter_Identifier workflow.

  6. Click Next.

    The Workflow Create/Edit Wizard opens.

  7. Paste the Twitter Application Consumer Key (API Key) into the _consumerKey Value box.
  8. Paste the Twitter Application Consumer Secret (API Secret) into the _consumerSecret Value box.
  9. Click Finish and then Save Site.

Connect Instagram to AOP

Recent changes to the Instagram API closed access to public images. So granting AOP access to public images is more complex. Once you have set up your dedicated AOP Instagram account, you need to do the following:

  1. Use Latitude's client ID and redirect URI to request a CODE from Instagram.

  2. Send the CODE you received from Instagram to Latitude within an HTML request to Instagram - to exchange the CODE for an Access Token.

    You can copy the client_ID and other information for the Instagram request from the procedure below, but for security reasons, you need to request the Client Secret from Latitude Support.
    It is also easier to make the HTML request to Instagram using a free application like Postman. Do not use the Chrome extension with the same name. The procedure below describes the steps for making the CODE request assuming that you have downloaded and installed the Postman app.
    Because the CODE from Instagram has a time limit of 60 seconds, you may find it easier to set up everything in Postman before you request the Instagram Code.
  3. Add the access token to the Instagram workflow within AOP to grant AOP access to Instagram pubic images through your account.

Use Latitude Info to Request an Instagram Code

Use Latitude's client ID and redirect-URI to request a CODE:

  1. Open a browser and copy the following URL into the address:

    https://api.instagram.com/oauth/authorize/?client_id=e7bbdb0f841943d1a4f4b626d05b0196&scope=public_content&redirect_uri=http%3A%2F%2Fwww.geocortex.com%2F&response_type=code

  2. When the Instagram login appears, type in the Username and Password of your Instagram account and then click Log in.

    The following message appears:

  3. Click Authorize.

    The following message appears in the browser:

  4. Copy the code - just the numbers - and paste it into the code key in the request in Postman.

Use Postman to Send an HTML Request

To set up the exchange request in Postman:

  1. Open the Postman app.
  2. Click the Show/Hide Sidebar icon if it the sidebar is not visible.
  3. In the function drop-down list, select POST.
  4. In the Params field, type https//api.instagram.com/oauth/access_token.
  5. Click the Body tab to display form-data.
  6. Enter the following Keys and Values:

  7. When you have all the correct information in Postman, click Send.

    The request to exchange the CODE for an access token is sent to Instagram.

    Instagram returns an access token that appears highlighted in blue.

  8. Copy the access token in order to paste it into the Instagram workflow in AOP to grant it access to Instagram.

Give AOP Access to Instagram

To grant AOP access to Instagram:

  1. Log into Geocortex Essentials Manager.

  2. Click your AOP site to edit it.

  3. On the Map page, click the Map Services tab.

  4. In the sidebar, click Workflows.

  5. Click beside the Instagram_Identifier workflow.

  6. Click Next.

    The Workflow Create/Edit Wizard opens.

  7. Paste the Instagram access_token into the _accessToken Value box.
  8. Click Finish and then Save Site.

Connect OpenWeatherMap to AOP

Once you have created an OpenWeatherMap account for AOP, you need to connect OpenWeatherMap to AOP.

The procedure follows these high-level steps:

  1. Obtain an API key from your OpenWeatherMap account.
  2. Add the API key to the AOP configuration files in the module that you want to be able to use the OpenWeatherMap information. You must add the key to the Desktop.json.js, Handheld.json.js and Tablet.json.js files.
  3. Add the API key to any Workflows that you want to be able to use the weather information.

Obtain the OpenWeatherMap API Key

To obtain the API key from OpenWeatherMap:

  1. Open a browser and sign in to your account on OpenWeatherMap.

  2. Select the API keys tab.

  3. Copy the Default key.

Add the API Key to the Configuration Files

To Add the API key from OpenWeatherMap:

  1. In Windows Explorer, navigate to the folder that contains the AOP viewer configuration files.

    The default installed folder is

    C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sites\AOP\Viewers\AOP_Viewer\VirtualDirectory\Resources\Config\Default

  2. Open Desktop.json.js, Handheld.json.js and Tablet.json.js files in a text editor.

  3. Search for the ContextMenuWeatherViewModel.

  4. Paste the API key into the apiKey value.

  5. Save the files.

Add the API Key to a Workflow

To add the OpenWeather Map API key the Chemical Spill Workflow:

If you want the ERG_By_Chemical feature to use weather information to estimate the impact of weather on a chemical spill, you can copy the OpenWeatherMap API key into the ERG_By_Chemical workflow.

  1. Log into Geocortex Essentials Manager.

  2. Click your AOP site to edit it.

  3. On the Map page, click the Map Services tab.

  4. In the sidebar, click Workflows.

  5. Click beside the Instagram_Identifier workflow.

  6. Click Next.

    The Workflow Create/Edit Wizard opens.

  7. Paste the Instagram API Token into the _WeatherAPIKey Value box.
  8. Click Finish and then Save Site.

See also...

Configure Social Media Workflows

© 2018 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 2.0