I hope someone can help me with this.
I built a coldfusion tool that would pull in the last three tweets from our local councils account.
This has worked fine for many months now but I have just been informed that its stopped working and may have been broken for a few days.
I have looked at the code and nothing has changed.
When I run the debug on the code I get the debug messages back:
Charset = [empty string]
ErrorDetail = I/O Exception: peer not authenticated
Filecontent = Connection Failure
Header = [empty string]
Mimetype = Unable to determine MIME type of file.
Responseheader = struct [empty]
Statuscode = Connection Failure. Status code unavailable.
Text = YES </code>
I guess that the tool is not getting past the authorization but I've checked and I'm using the correct KEYS and it has been working for a while.
Heres part of my coldfusion function that attempts to connect to twitter api. I cant see anything wrong.
<cfargument name="screen_name" required="no" default="fifecouncil">
<cfargument name="display_name" required="no" default="Fife Council">
<cfargument name="count" required="no" default="3">
<cfset consumerKey = "*****************************">
<cfset consumerSecret = "**********************************************************">
<cfset bearerToken = ToBase64(consumerKey & ":" & consumerSecret)>
<cfset authorization = "Basic " & bearerToken>
<cfhttp url="https://api.twitter.com/oauth2/token" method="post" charset="utf-8">
<cfhttpparam type="header" name="Authorization" value="#authorization#">
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded;charset=UTF-8">
<cfhttpparam type="body" value="grant_type=client_credentials">
</cfhttp>
<cfset bearerTokenResponse = DeserializeJSON(cfhttp.fileContent)>
<cfset authorization2 = "Bearer " & bearerTokenResponse.access_token>
<cfhttp url="https://api.twitter.com/1.1/statuses/user_timeline.json" method="get" charset="utf-8">
<cfhttpparam type="header" name="Authorization" value="#authorization2#">
<cfhttpparam type="url" name="screen_name" value="#arguments.screen_name#">
<cfhttpparam type="url" name="count" value="#arguments.count#">
</cfhttp>
<cftry>..........
Can anyone see a problem or have any information that may help me sort this out.
Thanks
Steven