Access the Highrise API with ColdFusion


/ Published in: ColdFusion
Save to your folder(s)

Accessing the 37signals product Highrise API requires HTTPS. I initially had problems with this (seemingly the certificate authority) from ColdFusion initially. Found the solution by tapping into the underlying Java layer to manage the providers.


Copy this code and paste it in your HTML
  1. <cfset highrise = "https://YOUR_DOMAIN.highrisehq.com/users.xml"/>
  2. <cfset username = "YOUR_TOKEN"/>
  3. <cfset password = "X"/>
  4.  
  5. <!--- Remove JsafeJCE Provider --->
  6. <cfset security = CreateObject( "java", "java.security.Security" )/>
  7. <cfset provider = security.getProvider( "JsafeJCE" )/>
  8. <cfset security.removeProvider( "JsafeJCE" )/>
  9.  
  10. <!--- Do the call --->
  11. <cfhttp url="#highrise#" method="get" username="#username#" password="#password#">
  12. <cfhttpparam type="header" name="Accept" value="application/xml"/>
  13. <cfhttpparam type="header" name="Content-Type" value="application/xml"/>
  14. </cfhttp>
  15.  
  16. <!--- Put it back (not sure if this is needed.) --->
  17. <cfset security.insertProviderAt( provider, 1 )/>
  18.  
  19. <cfdump var="#CFHTTP.FileContent#"/>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.