Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7088381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:47:38+00:00 2026-05-28T07:47:38+00:00

We are trying to communicate with a remote API which requires JSON formatted data.

  • 0

We are trying to communicate with a remote API which requires JSON formatted data. We tried to submit this using JQuery as follows, but were getting SOP errors:

<script type="text/javascript">
  $.ajax({
    username: 'username',
    password: 'password',
    url:  "https://api.e2ma.net/123/members/add",
    dataType: 'json',
    type: 'POST',
    data:
     {
       "fields": {
       "name_first": "Name"
     },
     "email": "email@domain.com"
    }
  });
</script>

Unfortunately, their API does not support JSONP.

How can we post this JSON data to their remote API directly from within Coldfusion 9?

Also, what do we need to do to parse the response from their API?

Here is a link to the docs: http://myemma.com/api-docs/

And here is snippet of a simple add new member call from those docs:

import_single_member(account_id)
POST /#account_id/members/add

Adds or updates an audience member

Parameters: 

  email (string) – Email address of member to add or update
  fields (dictionary) – Names and values of user-defined fields to update
  group_ids (integer) – Optional. Add imported members to this list of groups.
  signup_form_id – Optional. Indicate that this member used a particular signup form.

Returns:    
  The member_id of the new or updated member, and whether the member was added or an  existing member was updated

Example:

POST /123/members/add
{
  "fields": {
    "first_name": "Benjamin"
  }, 
  "email": "benjamin@myemma.com"
}

{
  "added": true, 
  "member_id": 1024
}

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:47:38+00:00Added an answer on May 28, 2026 at 7:47 am

    You’ll need to build a proxy since you can’t POST to another server from JavaScript. Your JS code should look something like:

    $.ajax({
    url:  "https://yourserver/proxy.cfm",
    dataType: 'json',
    type: 'POST',
    data:
     "name_first": "Name",
     "email": "email@domain.com"
    }
    });
    

    And your ColdFusion code should look something like this:

    <cfhttp url="https://api.e2ma.net/123/members/add" method="post" username="username" password="password">
        <cfhttpparam name="email" value="#form.email#">
        <cfhttpparam name="fields" value='{"name_first":"#form.name_first#"}'>
    </cfhhtp>
    

    I’m not sure if the fields will be in the format needed but ti should be pretty close.

    You can also return whatever you get back to JavaScript like this after you do the post:

    <cfoutput>#cfhttp.filecontent#<cfoutput>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to communicate with u rban airship API using a ROR web application.
I am trying to communicate with Google's spell check service using jQuery. Google's service
I am trying to communicate between an applet and a servlet. I first tried
I get this message when trying to communicate with software that communicates with SOAP?
I have an applet that throws this exception when trying to communicate with the
So I'm stuck at this point. I am trying to communicate with JanRain's auth_info
I'm trying to communicate to a device using RS-485 through the serial port. Everything
I'm trying to delete the highest value from a group. Given this data: group_table
I'm trying to communicate with a system which I have no control over, however
I am trying to communicate with a embedded system using a communication port COM0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.