Creating a signup for an interest group on an outside webpage

Options

In GetActive this was very simple, the form we created is on this page:

The code of which was:

Tagged:

Comments

  • Attached is a comparable example.

    Some notes about differences between the Convio APIs and the GA APIs.

    The biggest difference is that Convio does not allow you to update a user from a form on a remote site. This is to protect you and your constituents against the potential for cross-site request forgery and is a critical security consideration. Client-side APIs that require a logged in context to operate do not accept just a cookie to provide the logged in context; they require an additional security token that can be rendered on a Convio hosted page. In the near future, we'll be providing a way to indicate trusted third-party sites and get them the appropriate token. For now, you can execute the create method from a remote site but not the createOrUpdate method (which is the equivalent of what you were doing before). There is a lot more information about this at .

    Some of the arguments just have minor name changes domain becomes api_key, return_url becomes redirect, t becomes method. You also need to specify a version (v=1.0); this is so that when/if the API contract is upgraded, older code can still work with a deprecated API version until support is completely dropped.

    Interests/subscriptions are handled as a single argument with multiple values rather than as an argument for each subscription with a true/false.

    Hope that helps,

    Dave

  • DavidHart :

    Attached is a comparable example.

    Some notes about differences between the Convio APIs and the GA APIs.

    The biggest difference is that Convio does not allow you to update a user from a form on a remote site. This is to protect you and your constituents against the potential for cross-site request forgery and is a critical security consideration. Client-side APIs that require a logged in context to operate do not accept just a cookie to provide the logged in context; they require an additional security token that can be rendered on a Convio hosted page. In the near future, we'll be providing a way to indicate trusted third-party sites and get them the appropriate token. For now, you can execute the create method from a remote site but not the createOrUpdate method (which is the equivalent of what you were doing before). There is a lot more information about this at .

    Some of the arguments just have minor name changes domain becomes api_key, return_url becomes redirect, t becomes method. You also need to specify a version (v=1.0); this is so that when/if the API contract is upgraded, older code can still work with a deprecated API version until support is completely dropped.

    Interests/subscriptions are handled as a single argument with multiple values rather than as an argument for each subscription with a true/false.

    Hope that helps,

    Dave

    Thank you very much, I think its exactly what I wanted. Question: Which fields would I change for my specific form (for ucc.org):

    I can assume api-key is one, what about the post action address? (in your example https://bvt-secure.convio.com/bvt101/site/CRConsAPI

    and then also the radio button: code name="add_interest_ids" value="1001"

    I assume the value here would be replaced with the number next to the interest we see on the convio backend? (In this case 1072)

    But the "add_interest_ids" would stay

    Thanks again!

  • Daniel Hazard:

    Thank you very much, I think its exactly what I wanted. Question: Which fields would I change for my specific form (for ucc.org):

    I can assume api-key is one, what about the post action address? (in your example https://bvt-secure.convio.com/bvt101/site/CRConsAPI

    and then also the radio button: code name="add_interest_ids" value="1001"

    I assume the value here would be replaced with the number next to the interest we see on the convio backend? (In this case 1072)

    But the "add_interest_ids" would stay

    Thanks again!

    In the case of UCC, you would want to use the following post address: https://secure3.convio.net/ucc/site/CRConsAPI. For reference, the post URL format is listed here - http://open.convio.com/api/constituent-api/client/create-client.html. You are correct that the Interest ID values are the numbers next to the Interests on the Convio backend. Other than making those changes - and the API Key change - you should be able to use the example code line-for-line.

  • Stephen O:

    In the case of UCC, you would want to use the following post address: https://secure3.convio.net/ucc/site/CRConsAPI. For reference, the post URL format is listed here - http://open.convio.com/api/constituent-api/client/create-client.html. You are correct that the Interest ID values are the numbers next to the Interests on the Convio backend. Other than making those changes - and the API Key change - you should be able to use the example code line-for-line.

    ok, so this line does not get changed?:

    <input type="hidden" name="login_name" id="login_name" value="apiuser" />

  • Daniel Hazard:

    ok, so this line does not get changed?:

    <input type="hidden" name="login_name" id="login_name" value="apiuser" />

    I don't think that field is required (it's required for the SSO API, however). I think it was a mistake to include that in the sample code. Try it without it and it should work.

  • DavidHart :

    Attached is a comparable example.

    Some notes about differences between the Convio APIs and the GA APIs.

    The biggest difference is that Convio does not allow you to update a user from a form on a remote site. This is to protect you and your constituents against the potential for cross-site request forgery and is a critical security consideration. Client-side APIs that require a logged in context to operate do not accept just a cookie to provide the logged in context; they require an additional security token that can be rendered on a Convio hosted page. In the near future, we'll be providing a way to indicate trusted third-party sites and get them the appropriate token. For now, you can execute the create method from a remote site but not the createOrUpdate method (which is the equivalent of what you were doing before). There is a lot more information about this at .

    Some of the arguments just have minor name changes domain becomes api_key, return_url becomes redirect, t becomes method. You also need to specify a version (v=1.0); this is so that when/if the API contract is upgraded, older code can still work with a deprecated API version until support is completely dropped.

    Interests/subscriptions are handled as a single argument with multiple values rather than as an argument for each subscription with a true/false.

    Hope that helps,

    Dave

    Hi Dave. This thread came up in a topic search. "Creating a signup for an interest group on an outside webpage" is exactly what we're trying to do. I've tried implementing the script you attached to your post, but haven't gotten it to work yet. There seem to be some gaps--maybe you can help a newbie fill those in?

    My first thought looking at what's here was "It can't be that simple" but just to get started I gave it a try on my server, substituting our site location into the post action and our api_key into the appropriate hidden field. Everything else I left the same including the redirect. Here's a link to that test page. Rather to my surprise, the form does flip me to the redirect location on submit, so it is communicating with the host in some form. But no data is posted into my Constituent 360. What else does this require to work?

    As far as the back end goes:

    • I've set up an admin account with API Group privileges, which currently just include "Use Convio APIs: Allow administrators in this group to call Convio APIs to add, change, and delete contact records. Administrators in this group will not be able to log in to the site."
    • I created a CONVIO_API_KEY
    • I also entered my full site address (including http://) in CONVIO_API_CROSSDOMAINS_ALLOWED and CONVIO_API_CROSSDOMAINS_TRUSTED

    Is there some additional configuration needed? Here's the script as I adapted it:


    <form method="post" action="https://secure2.convio.net/neaq/site/CRConsAPI">
    <input type="hidden" name="api_key" id="convio_neaq" value="open" />
    <input type="hidden" name="v" id="v" value="1.0" />
    <input type="hidden" name="method" id="method" value="create" />

    <input type=hidden name=redirect value="http://www.uccfiles.com/thanks.htm">

    <table>
    <tr> <td>
    <span class="style4">Email Address</span></td> <td><input name=email type=text size=35 maxlength="100">


    </td> </tr>
    <tr> <td>
    <span class="style4">First Name</span></td> <td><input name=first_names type=text size=35 maxlength="50">
    </td> </tr>
    <tr> <td>
    <span class="style4">Last Name</span></td> <td><input name=last_name type=text size=35 maxlength="50">


    </td> </tr>
    <tr> <td>
    <span class="style4">Email Subscriptions:</span>
    </td>
    <td>
    <span class="style2">
    <input type="checkbox" name="add_interest_ids" value="1001">Daily Devotionals<br>
    </span>
    </td> </tr>
    </table>

    <input type="submit" value="Submit" name="Submit" />


    </form>

  • Bill Bennett:

    Hi Dave. This thread came up in a topic search. "Creating a signup for an interest group on an outside webpage" is exactly what we're trying to do. I've tried implementing the script you attached to your post, but haven't gotten it to work yet. There seem to be some gaps--maybe you can help a newbie fill those in?

    My first thought looking at what's here was "It can't be that simple" but just to get started I gave it a try on my server, substituting our site location into the post action and our api_key into the appropriate hidden field. Everything else I left the same including the redirect. Here's a link to that test page. Rather to my surprise, the form does flip me to the redirect location on submit, so it is communicating with the host in some form. But no data is posted into my Constituent 360. What else does this require to work?

    As far as the back end goes:

    • I've set up an admin account with API Group privileges, which currently just include "Use Convio APIs: Allow administrators in this group to call Convio APIs to add, change, and delete contact records. Administrators in this group will not be able to log in to the site."
    • I created a CONVIO_API_KEY
    • I also entered my full site address (including http://) in CONVIO_API_CROSSDOMAINS_ALLOWED and CONVIO_API_CROSSDOMAINS_TRUSTED

    Is there some additional configuration needed? Here's the script as I adapted it:


    <form method="post" action="https://secure2.convio.net/neaq/site/CRConsAPI">
    <input type="hidden" name="api_key" id="convio_neaq" value="open" />
    <input type="hidden" name="v" id="v" value="1.0" />
    <input type="hidden" name="method" id="method" value="create" />

    <input type=hidden name=redirect value="http://www.uccfiles.com/thanks.htm">

    <table>
    <tr> <td>
    <span class="style4">Email Address</span></td> <td><input name=email type=text size=35 maxlength="100">


    </td> </tr>
    <tr> <td>
    <span class="style4">First Name</span></td> <td><input name=first_names type=text size=35 maxlength="50">
    </td> </tr>
    <tr> <td>
    <span class="style4">Last Name</span></td> <td><input name=last_name type=text size=35 maxlength="50">


    </td> </tr>
    <tr> <td>
    <span class="style4">Email Subscriptions:</span>
    </td>
    <td>
    <span class="style2">
    <input type="checkbox" name="add_interest_ids" value="1001">Daily Devotionals<br>
    </span>
    </td> </tr>
    </table>

    <input type="submit" value="Submit" name="Submit" />


    </form>

    The problem is that you have api_key as "open", instead of the actual api_key for your site. If you remove the redirect and post the form, you'll see the error response:

    Incorrect API key 'open'.

Categories