Social Media Workflow Issues
I have followed the directions on adding the Social Media Workflow to my HTML5 2.4.1 Viewer as described.
However, i am still getting errors. As far as i know, there are two possible culprits.
1. My Twitter and Instagram tokens are somehow invalid.
2. I am setting the workflow up incorrectly.
This is what happens when i run the workflow.
1. When i select just Twitter in the Workflow, and run a search for say...dog...i get the following error,
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'SocialMediaSearch' failed Unhandled exception: 'One or more errors occurred.' in activity '1.409: WebRequest'. One or more errors occurred. The remote server returned an error: (401) Unauthorized.
2. When i select just Instagram in the Workflow and search for dog again, i get the following error,
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'SocialMediaSearch' failed Unhandled exception: 'One or more errors occurred.' in activity '1.170: WebRequest'. One or more errors occurred. The remote server returned an error: (400) Bad Request.
Here is how i setup the workflow:
i add it to GE, and it prompts me to add two variables.
1. TokenFileLocation
2. IconFolderLocation
I currently have both pointing to a site using http: However, i've also tried pointing them to the actual folders (C:\, D:\ etc.) on my hard drive. I don't know which is right since i'm getting an error either way.
My tokenFileLocation is pointing to: http://mysite/Geocortex/Essentials/REST/sites/sitename/viewers/viewername/VirtualDirectory/Resources/Tokens/apiTokens.xml
My IconFolderLocation is pointing to: http://mysite/Geocortex/Essentials/REST/sites/sitename/VirtualDirectory/Icons/
Any idea how i'm suppose to configure those two locations? Yes, i know the TokenFileLocation is suppose to be in a place the server can get it, but the public can't or something like that. That doesn't tell me what to put in the boxes for TokenFIleLocation and IconFolderLocation.
Any ideas? I know i've probably crossed my i's and dotted my t's somewhere...
Thanks!!!
-
I just had the same exact issue. I had to put in a support call to Latitudes to get it working. Apparently the instructions in the code gallery are incomplete. They had to do some Javascript in order to get the token working for Twitter and there is a certain way you can put your token and secret into a URL and submit it to get the actual token you are supposed to use for Instagram. I would put in a support ticket if I were you but Edmond did say that they were going to update that workflow in the gallery soon. We did a screen share and got the workflow running in about an hour after he was able to generate the correct tokens for making requests to both APIs. I am curious if there are other social media outlets like Flickr that can be quried through REST API and added to this workflow. You can check out my Social Media Search under the I want to menu @ http://gis.cherokeega.com
0 -
@Steven -- It's failing on the web requests to the APIs, which implies that it has sucessfully downloaded your token document and proceeded, but that the tokens are invalid. Also make sure you are using https for access -- these APIs do not work over http.
@Robert -- The instructions for getting the correct tokens are not included in the documentation for this workflow, as they might change without notice. There are however links to the API documentation included and you will find up to date instructions here. Any service which returns geolocated results could be hooked up in a similar manner to these two, but it is a manual process to translate the JSON output from the service to a FeatureSet, and this routine needs to be handcrafted for each one.
The instructions to obtain tokens are aimed at a developers creating their own apps, so they are a bit technical. Twitter in particular requires you to make a specially crafted web request to obtain the correct token. You can do this with Fiddler (no JavaScript required), but you cannot do it with only a web browser. If you are having difficulty with this I would suggest a support call, as the technician will be able to walk you through the process.
0 -
I am also having an issue when running this workflow. I am thinking the Access Token AND the Access Token Secret need to be added somehow. This is the error I get when I run the workflow.
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'Social Media' failed Unhandled exception: 'The remote server returned an error: (502) Bad Gateway.' in activity '1.439: Assign'. The remote server returned an error: (502) Bad Gateway.
Any suggestions?
0 -
Are there any suggestions for how to go about switching to https? I tried and read on twitter that the SSL certificate has to be authenticated by Symantec or Verisign. We are creating this webservice on our internal server so we don't use https. Any similar cases?
0 -
I am not a developer but I would be curious to see an example of how to construct the special web request in Fiddler to obtain the correct token. I somewhat understand what the instructions are telling me to do @ https://dev.twitter.com/oauth/application-only but I lack experience in hand crafting web requests as well as encoding the key and secret to create the bearer token. I just need my hand held a little more here lol. Any screen shots with an additional explanation would be great.
FYI: I have this workflow running already with the help of a developer at Latitudes but I am wanting to know how this works as other Geocortex users in my area are trying to implement this on their sites and are asking me about this particular part.0 -
@Robert,
Using the example at https://dev.twitter.com/oauth/application-only you would use the Fiddler "Composer" function to create the request and view the Bearer token in the response received.
_img_ alt="Fiddler screenshot" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000XZrb&feoid=Body&refid=0EM60000000XqP4" _/_img_
To see the response you would have to click on the request (on the left hand side) on then the Raw tab in the bottom right.
I hope this helps.
Wayne0 -
I was having trouble with the Instagram access token. I created one (this involves using the the client_id, client_secret and code to generate an access token). However, I was getting the error "One or more errors occurred.' in activity '1.170: WebRequest'. One or more errors occurred. The remote server returned an error: (400) Bad Request."
It turns out the web request in the workflow needs modified. In the Instagram WebRequest (activity 1.170), it has parameter names of lat, lng, distance, client_id and count. Try changing the parameter name (not value) from "client_id" to "access_token". That got it working for me.
Chris0
Please sign in to leave a comment.
Comments
7 comments