API question - fields to pass

Options

We're going to use the "create" api to pass newsletter sign ups from one site to Convio. Will Convio accept just email address via API, or will I need to collect at least first name, last name and email address as three seperate fields? Is there a work around for this? Several of our websites only require email address for newsletter sign up, which does not jive with Convio's overly restrictive first, last name and email requirement.

Thanks.

Ben Smith

Tagged:

Comments

  • Hey Ben,

    Yes you can absolutely choose to only capture the email address using the create method. In fact, we created some sample code and a cookbook to enable a two-step registration form which allows your site to first simply capture the email address, and then immediately ask for more information (e.g. first and last name as separate fields). This can be done with AJAX (our cookbook has the code) without reloading the page or with simple HTML on two separate pages, or not at all, just capture their email in a simple HTML form.

    Here's the cookbook for the AJAX two-step registration form: http://open.convio.com/api/constituent-api/client/code/two-step-registration.html

    This specific example uses the createOrUpdate method.

    Note: for security reasons (cross-domain cookie scripting) it's easiest if the pages serving the AJAX are hosted by Convio. This is not absolutely necessary, but it requires less coding on your end. You can do a virtual copy-paste from the toolkit. If the web pages where you want this to live are not hosted by Convio then additional work is required to take advantage of the AJAX features. But again... you don't need AJAX if you simply want to capture the email and use the create method. It's only when you're using AJAX that the cross-domain cookie thing becomes an issue.

  • tommy Spann:

    Hey Ben,

    Yes you can absolutely choose to only capture the email address using the create method. In fact, we created some sample code and a cookbook to enable a two-step registration form which allows your site to first simply capture the email address, and then immediately ask for more information (e.g. first and last name as separate fields). This can be done with AJAX (our cookbook has the code) without reloading the page or with simple HTML on two separate pages, or not at all, just capture their email in a simple HTML form.

    Here's the cookbook for the AJAX two-step registration form: http://open.convio.com/api/constituent-api/client/code/two-step-registration.html

    This specific example uses the createOrUpdate method.

    Note: for security reasons (cross-domain cookie scripting) it's easiest if the pages serving the AJAX are hosted by Convio. This is not absolutely necessary, but it requires less coding on your end. You can do a virtual copy-paste from the toolkit. If the web pages where you want this to live are not hosted by Convio then additional work is required to take advantage of the AJAX features. But again... you don't need AJAX if you simply want to capture the email and use the create method. It's only when you're using AJAX that the cross-domain cookie thing becomes an issue.

    U Da' Best! Thanks Tompkins.

  • tommy Spann:

    Hey Ben,

    Yes you can absolutely choose to only capture the email address using the create method. In fact, we created some sample code and a cookbook to enable a two-step registration form which allows your site to first simply capture the email address, and then immediately ask for more information (e.g. first and last name as separate fields). This can be done with AJAX (our cookbook has the code) without reloading the page or with simple HTML on two separate pages, or not at all, just capture their email in a simple HTML form.

    Here's the cookbook for the AJAX two-step registration form: http://open.convio.com/api/constituent-api/client/code/two-step-registration.html

    This specific example uses the createOrUpdate method.

    Note: for security reasons (cross-domain cookie scripting) it's easiest if the pages serving the AJAX are hosted by Convio. This is not absolutely necessary, but it requires less coding on your end. You can do a virtual copy-paste from the toolkit. If the web pages where you want this to live are not hosted by Convio then additional work is required to take advantage of the AJAX features. But again... you don't need AJAX if you simply want to capture the email and use the create method. It's only when you're using AJAX that the cross-domain cookie thing becomes an issue.

    >Here's the cookbook for the AJAX two-step registration form: http://open.convio.com/api/constituent-api/client/code/two-step-registration.html

    Does that content still exist somewhere? The link comes up 404 alas.

  • Bill Bennett:

    >Here's the cookbook for the AJAX two-step registration form: http://open.convio.com/api/constituent-api/client/code/two-step-registration.html

    Does that content still exist somewhere? The link comes up 404 alas.

    Answering my own question, I think this is where it currently lives--at least the bit about doing this on non-Convio pages:

    http://community.customer.convio.com/docs/DOC-2729

  • Ben Smith:

    We're going to use the "create" api to pass newsletter sign ups from one site to Convio. Will Convio accept just email address via API, or will I need to collect at least first name, last name and email address as three seperate fields? Is there a work around for this? Several of our websites only require email address for newsletter sign up, which does not jive with Convio's overly restrictive first, last name and email requirement.

    Thanks.

    Ben Smith

    This is exactly something that we want to accomplish, is the cookbook example available anywhere? Can someone provide a link?
  • You can definitely just pass the email address. Here's our base code, written in PHP for Drupal. It creates a constituent record with the desired interest/group ID:


    $uri = 'https://secure3.convio.net/yoursite/admin/SRConsAPI';

    $post_params = array(
    'method' => 'createOrUpdate,
    'api_key' => 'key',
    'v' => '1.0',
    'response_format' => 'json',
    'primary_email' => 'email@email.com',
    'login_name' => 'name',
    'login_password' => 'password',
    'add_interest_ids' => 1234,
    'add_group_ids' => 5678,
    );

    $data = http_build_query($post_params);

    $options = array(
    'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'),
    'method' => 'POST',
    'data' => $data,
    );

    $result = drupal_http_request($uri, $options);

    It makes a post request to this URL:

    https://secure3.convio.net/yoursite/admin/SRConsAPI?api_key=key&v=1.0&response_format=json&primary_email=email@email.com&login_name=name&login_password=password&add_interest_ids=1234&add_group_ids=5678



Categories