I am trying to connect to the emma api using ColdFusion. Using the below code. Trying to get a listing of all members in an account as per api docs doing the below. I keep getting status code of 404 on the below call. Any ideas on what I am missing here?
<cfset account_id= '123'/>
<cfset public_key = 'abc'/>
<cfset private_key = 'xyz' />
<cfset the_url = 'https://app.e2ma.net/#account_id#/members/' />
<cfhttp url="#the_url#" method="get" result="Results" timeout="999">
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="header" name="Accept" value="application/json" />
<cfhttpparam type="header" name="public_api_key" value="#public_key#" >
<cfhttpparam type="header" name="private_api_key" value="#private_key#" >
</cfhttp>
<cfdump var="#Results#"/>
Here are the results of the cfdump
:
It looks like you're using the wrong endpoint. In their documentation they say the following:
In your code you're using
app.e2ma.net
, this should beapi.e2ma.net
instead.Also the path for the URL you're requesting doesn't include a trailing slash in their documentation (
GET /#account_id/members
is what they have). You may also want to update that.