Skip to content

Instantly share code, notes, and snippets.

@kylejmhudson
Created March 22, 2013 15:41
Show Gist options
  • Save kylejmhudson/4e8a6154da72972dce50 to your computer and use it in GitHub Desktop.
Save kylejmhudson/4e8a6154da72972dce50 to your computer and use it in GitHub Desktop.
Try and then update
<!— Start a call from coldfusion —>
<!— enter your information for the following parameters —>
<cfset api_key="abc123">
<cfset api_secret="abc123">
<!— make the rest request —>
<cfhttp url="https://rest.nexmo.com/number/buy/" method="post" charset="utf-8">
<cfhttpparam name="Accept" value="application/xml" type="header">
<cfhttpparam name="api_key" value="#api_key#" type="FormField">
<cfhttpparam name="api_secret" value="#api_secret#" type="FormField">
<cfhttpparam name="country" value="US" type="FormField">
<cfhttpparam name="msisdn" value="11234567890" type="formField">
</cfhttp>
<!— display results —>
<cfoutput>
HTTP Response = #cfhttp.statusCode# <br>
<textarea cols="80" rows="10">
#cfhttp.fileContent#
</textarea>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment