TeamRaiser GetParticipants and Retrieving All Participants

Options

I'm trying to build a simple Team Roster for our TeamRaisers.

My initial idea was to just pull the full list of participants sorted on last name. However the getParticipants seems to require at least one character to search on, even if my site F2F_PART_FINDER_MIN_CRITERIA option is set as 0.

So then I decided it would be acceptable to have a row of links, a through z, that showed participants starting with the selected letter when clicked. However the search this API uses is 'contains', not 'starts with'. Any advice?

Here's my code so far...

<script type="text/javascript">

$(document).ready(function()

{

getRoster('a');

});

this.getRoster=function(query)

{

$("#results").html("<p>Loading...</p>");

var requestString =

'https://]]CRTeamraiserAPI?' +

'method=getParticipants' +

'&v=1.0' +

'&api_key=]' +

'&response_format=json' +

'&suppress_response_codes=true' +

'&fr_id=1260' +

'&list_sort_column=last_name' +

'&list_ascending=true' +

'&last_name=' + query;

var requestURL = "AjaxProxy?auth=]&cnv_url=" + escape(requestString);

$.getJSON(requestURL,function(data)

{

if(data.errorResponse)

{

$("#results").html("<p>(" + data.errorResponse.message + ")</p>");

} else {

$("#results").html("");

var trObject=data.getParticipantsResponse.participant;



$.each(trObject,function()

{

$("#results").append("<p class=\\'rosterentry\\'>" + this.name.first + " " + this.name.last + " - (<a href=\\"" + this.personalPageUrl + "\\">Personal Page</a>)</p>");

});

}

});

};

</script>

<p>

<a href="#" onclick="getRoster('a'); return false;">a</a> |

<a href="#" onclick="getRoster('b'); return false;">b</a> |

<a href="#" onclick="getRoster('c'); return false;">c</a> |

... |

<a href="#" onclick="getRoster('x'); return false;">x</a> |

<a href="#" onclick="getRoster('y'); return false;">y</a> |

<a href="#" onclick="getRoster('z'); return false;">z</a>

</p>

<div id="results" style="padding: 5px; margin: 10px 0 10px 0; border: 1px solid #6CA0BF; background-color: #D7E5F0;"></div>

Tagged:

Comments

  • Brian,

    You can pass the string '%%%' for first_name to get a full list.

  • Noah Cooper:

    Brian,

    You can pass the string '%%%' for first_name to get a full list.

    Hurray! It works!

    Noah for President!

    Regards, Brian

  • Brian Mucha:

    Hurray! It works!

    Noah for President!

    Regards, Brian

    I posted the plug-in that I came up with in the API forum. ( http://community.customer.convio.com/docs/DOC-3178 )

    Thanks for the help.

    Regards, Brian

  • Noah Cooper:

    Brian,

    You can pass the string '%%%' for first_name to get a full list.

    Hi,

    we like to show event name with getparticipants result, but since there is no event name in the response from Convio, and we don't like to call getevent method each time to load a participant (since if there are 100 participants, we have to call that method many times). is there other way to do it? or is it possible for Convio to add event name to the getParticipants reponse. thanks!

  • TJ Yan:

    Hi,

    we like to show event name with getparticipants result, but since there is no event name in the response from Convio, and we don't like to call getevent method each time to load a participant (since if there are 100 participants, we have to call that method many times). is there other way to do it? or is it possible for Convio to add event name to the getParticipants reponse. thanks!

    Well, all the participants are from the same TeamRaiser event, specified by the fr_id value passed in the requestString. You could easily do the lookup once at the beginning of the script and then store it in a variable for later use.

    Regards, Brian

  • Brian Mucha:

    Well, all the participants are from the same TeamRaiser event, specified by the fr_id value passed in the requestString. You could easily do the lookup once at the beginning of the script and then store it in a variable for later use.

    Regards, Brian

    Thanks for the reply, I can get fr_id, but not sure which method to use to retrieve event name, I tried getEvent (which require event_id) with fr_id, but response is empty. is fr_id same as event_id? if not, is there other method I can use to retrieve event name?

  • TJ Yan:

    Thanks for the reply, I can get fr_id, but not sure which method to use to retrieve event name, I tried getEvent (which require event_id) with fr_id, but response is empty. is fr_id same as event_id? if not, is there other method I can use to retrieve event name?

    Hmmm, it should be a method of the TeamRaiser API, but I also don't see anything helpful. Perhaps getEventDataParameter? The documentation on this is pretty much unusably sparce.(http://open.convio.com/api/#teamraiser_api.getEventDataParameter_method.html)

    Convio guys?

    Regards, Brian

  • Brian Mucha:

    Hmmm, it should be a method of the TeamRaiser API, but I also don't see anything helpful. Perhaps getEventDataParameter? The documentation on this is pretty much unusably sparce.(http://open.convio.com/api/#teamraiser_api.getEventDataParameter_method.html)

    Convio guys?

    Regards, Brian

    Brian,

    Thanks for help! I thought you work for Convio. I looked at that method beofer, not sure what information is in that response.

  • TJ Yan:

    Brian,

    Thanks for help! I thought you work for Convio. I looked at that method beofer, not sure what information is in that response.

    Nope, I just wrote this script and thought others could benefit.

    Regards, B

  • TJ Yan:

    Brian,

    Thanks for help! I thought you work for Convio. I looked at that method beofer, not sure what information is in that response.

    There isn't any API method with which you could pass an fr_id and get back an event name. My suggestion would be to create your own little "API" using Convio's PageBuilder tool -- just create a PageBuilder page with the following:



    ]<?xml version="1.0" encoding="UTF-8"?>
    <eventName>]:title]]</eventName>

    Then call the page using the syntax https://secure2.convio.net/shortname/site/SPageServer?pagename=your_pagename&pgwrap=n&fr_id=1234 (swapping out your secure URL, pagename, and fr_id).

    Since you're potentially going to have several search results with the same fr_id, and you don't want to call this method over and over again, I'd recommend storing a reference to the fr_id. I did something similar for another client at http://www2.jdrf.org/site/PageServer?pagename=walk_participant_search&firstname=noah&lastname=&teamname=&state=TX. If you inspect the page, you'll see there are a series of hidden "tr-meta-provider" inputs that store location information for each TeamRaiser (in this case, I'm using the getTeamraisersByInfo method to retrieve all events in a specific state, rather than retrieving them by fr_id, but the same basic idea).

  • Noah Cooper:

    There isn't any API method with which you could pass an fr_id and get back an event name. My suggestion would be to create your own little "API" using Convio's PageBuilder tool -- just create a PageBuilder page with the following:



    ]<?xml version="1.0" encoding="UTF-8"?>
    <eventName>]:title]]</eventName>

    Then call the page using the syntax https://secure2.convio.net/shortname/site/SPageServer?pagename=your_pagename&pgwrap=n&fr_id=1234 (swapping out your secure URL, pagename, and fr_id).

    Since you're potentially going to have several search results with the same fr_id, and you don't want to call this method over and over again, I'd recommend storing a reference to the fr_id. I did something similar for another client at http://www2.jdrf.org/site/PageServer?pagename=walk_participant_search&firstname=noah&lastname=&teamname=&state=TX. If you inspect the page, you'll see there are a series of hidden "tr-meta-provider" inputs that store location information for each TeamRaiser (in this case, I'm using the getTeamraisersByInfo method to retrieve all events in a specific state, rather than retrieving them by fr_id, but the same basic idea).

    Noah,

    Thanks much for the solution, I am new to Convio, would you mind to tell where to access and use pageBuilder? any documentation? I have just been assigned Convio admin right. does that give me access to pageBuilder to create new page?

  • TJ Yan:

    Noah,

    Thanks much for the solution, I am new to Convio, would you mind to tell where to access and use pageBuilder? any documentation? I have just been assigned Convio admin right. does that give me access to pageBuilder to create new page?

    Should be in the first menu. Content > PageBuilder. (See attached.) Not sure about those with the full CMS.

    Regards, B

  • Noah Cooper:

    There isn't any API method with which you could pass an fr_id and get back an event name. My suggestion would be to create your own little "API" using Convio's PageBuilder tool -- just create a PageBuilder page with the following:



    ]<?xml version="1.0" encoding="UTF-8"?>
    <eventName>]:title]]</eventName>

    Then call the page using the syntax https://secure2.convio.net/shortname/site/SPageServer?pagename=your_pagename&pgwrap=n&fr_id=1234 (swapping out your secure URL, pagename, and fr_id).

    Since you're potentially going to have several search results with the same fr_id, and you don't want to call this method over and over again, I'd recommend storing a reference to the fr_id. I did something similar for another client at http://www2.jdrf.org/site/PageServer?pagename=walk_participant_search&firstname=noah&lastname=&teamname=&state=TX. If you inspect the page, you'll see there are a series of hidden "tr-meta-provider" inputs that store location information for each TeamRaiser (in this case, I'm using the getTeamraisersByInfo method to retrieve all events in a specific state, rather than retrieving them by fr_id, but the same basic idea).

    Noah,

    Thanks, it works!

  • Brian Mucha:

    Should be in the first menu. Content > PageBuilder. (See attached.) Not sure about those with the full CMS.

    Regards, B

    thanks, got it.

  • Noah Cooper:

    There isn't any API method with which you could pass an fr_id and get back an event name. My suggestion would be to create your own little "API" using Convio's PageBuilder tool -- just create a PageBuilder page with the following:



    ]<?xml version="1.0" encoding="UTF-8"?>
    <eventName>]:title]]</eventName>

    Then call the page using the syntax https://secure2.convio.net/shortname/site/SPageServer?pagename=your_pagename&pgwrap=n&fr_id=1234 (swapping out your secure URL, pagename, and fr_id).

    Since you're potentially going to have several search results with the same fr_id, and you don't want to call this method over and over again, I'd recommend storing a reference to the fr_id. I did something similar for another client at http://www2.jdrf.org/site/PageServer?pagename=walk_participant_search&firstname=noah&lastname=&teamname=&state=TX. If you inspect the page, you'll see there are a series of hidden "tr-meta-provider" inputs that store location information for each TeamRaiser (in this case, I'm using the getTeamraisersByInfo method to retrieve all events in a specific state, rather than retrieving them by fr_id, but the same basic idea).

    Turns out I was mistaken -- there is in fact a way to get an event's name (and other data) by passing fr_id using the getTeamraisersByInfo method, e.g.



    https://secure2.convio.net/shortname/site/CRTeamraiserAPI?method=getTeamraisersByInfo&api_key=foo&v=1.0&list_filter_column=fr_id&list_filter_text=1234&name=%

    Where 1234 is your fr_id.

  • Has anyone had any success in getting result of all participants using the "event_type" parameter?

    I'm trying to get a list of all participants in multiple TeamRaiser events (multiple fr_id's) that share the same Event Type.

    This query is returning error code 2656:

    https://secure3.convio.net/ospca/site/CRTeamraiserAPI?method=getParticipants&v=1.0&api_key=ospcaapi&response_format=xml&suppress_response_codes=true&first_name=%%%&event_type=Friends%20for%20Life

    However, it's works in for getTeamsByInfo:

    https://secure3.convio.net/ospca/site/CRTeamraiserAPI?method=getTeamsByInfo&v=1.0&api_key=ospcaapi&response_format=xml&suppress_response_codes=true&event_type=Friends%20for%20Life

    Am I missing something? How can I get all participants of the same Event Type?

    Thanks,

    Francis

  • Brian Mucha:

    I'm trying to build a simple Team Roster for our TeamRaisers.

    My initial idea was to just pull the full list of participants sorted on last name. However the getParticipants seems to require at least one character to search on, even if my site F2F_PART_FINDER_MIN_CRITERIA option is set as 0.

    So then I decided it would be acceptable to have a row of links, a through z, that showed participants starting with the selected letter when clicked. However the search this API uses is 'contains', not 'starts with'. Any advice?

    Here's my code so far...

    <script type="text/javascript">

    $(document).ready(function()

    {

    getRoster('a');

    });

    this.getRoster=function(query)

    {

    $("#results").html("<p>Loading...</p>");

    var requestString =

    'https://]]CRTeamraiserAPI?' +

    'method=getParticipants' +

    '&v=1.0' +

    '&api_key=]' +

    '&response_format=json' +

    '&suppress_response_codes=true' +

    '&fr_id=1260' +

    '&list_sort_column=last_name' +

    '&list_ascending=true' +

    '&last_name=' + query;

    var requestURL = "AjaxProxy?auth=]&cnv_url=" + escape(requestString);

    $.getJSON(requestURL,function(data)

    {

    if(data.errorResponse)

    {

    $("#results").html("<p>(" + data.errorResponse.message + ")</p>");

    } else {

    $("#results").html("");

    var trObject=data.getParticipantsResponse.participant;



    $.each(trObject,function()

    {

    $("#results").append("<p class=\\'rosterentry\\'>" + this.name.first + " " + this.name.last + " - (<a href=\\"" + this.personalPageUrl + "\\">Personal Page</a>)</p>");

    });

    }

    });

    };

    </script>

    <p>

    <a href="#" onclick="getRoster('a'); return false;">a</a> |

    <a href="#" onclick="getRoster('b'); return false;">b</a> |

    <a href="#" onclick="getRoster('c'); return false;">c</a> |

    ... |

    <a href="#" onclick="getRoster('x'); return false;">x</a> |

    <a href="#" onclick="getRoster('y'); return false;">y</a> |

    <a href="#" onclick="getRoster('z'); return false;">z</a>

    </p>

    <div id="results" style="padding: 5px; margin: 10px 0 10px 0; border: 1px solid #6CA0BF; background-color: #D7E5F0;"></div>

    I know this is an old thread, but has anyaone manged to make this work lately?

    i'm trying to generate a list of participants for a given event . running the code from within a page in Luminate but it does not works, sending "%%%" for last_name or first_name only gives me a "(No search criteria was provided. Please enter something to search for.)" error message on the page and passing just 'a' indicates that more than 3 characters are required.


    This is what I have thus far;


    <script type="text/javascript">

    $(document).ready(function()
    {
    getRoster('%%%');
    });

    this.getRoster=function(query)
    {

    $("#results").html("<p>Loading...</p>");

    var requestString =
    'https://secure2.convio.net/cco/site/CRTeamraiserAPI?' +
    'method=getParticipants' +
    '&v=1.0' +
    '&api_key=XXXXXX' +
    '&response_format=json' +
    '&suppress_response_codes=true' +
    '&fr_id=23454' +
    '&list_sort_column=last_name' +
    '&list_ascending=true' +
    '&first_name=' + query;


    var requestURL = requestString;

    $.getJSON(requestURL,function(data)
    {
    if(data.errorResponse)
    {
    $("#results").html("<p>(" + data.errorResponse.message + ")</p>");
    } else {

    $("#results").html("");

    var trObject=data.getParticipantsResponse.participant;

    $.each(trObject,function()
    {
    $("#results").append("<p class=\\'rosterentry\\'>" + this.name.first + " " + this.name.last + " - (<a href=\\"" + this.personalPageUrl + "\\">Personal Page</a>)</p>");
    });

    }
    });

    };

    </script>

    <p>
    <a href="#" onclick="getRoster('a'); return false;">a</a> |
    <a href="#" onclick="getRoster('b'); return false;">b</a> |
    <a href="#" onclick="getRoster('c'); return false;">c</a> |

    ... |

    <a href="#" onclick="getRoster('x'); return false;">x</a> |
    <a href="#" onclick="getRoster('y'); return false;">y</a> |
    <a href="#" onclick="getRoster('z'); return false;">z</a>

    </p>

    <div id="results" style="padding: 5px; margin: 10px 0 10px 0; border: 1px solid #6CA0BF; background-color: #D7E5F0;"></div>

  • Samuel Gomez Recuero:

    Brian Mucha:

    I'm trying to build a simple Team Roster for our TeamRaisers.

    My initial idea was to just pull the full list of participants sorted on last name. However the getParticipants seems to require at least one character to search on, even if my site F2F_PART_FINDER_MIN_CRITERIA option is set as 0.

    So then I decided it would be acceptable to have a row of links, a through z, that showed participants starting with the selected letter when clicked. However the search this API uses is 'contains', not 'starts with'. Any advice?

    Here's my code so far...

    <script type="text/javascript">

    $(document).ready(function()

    {

    getRoster('a');

    });

    this.getRoster=function(query)

    {

    $("#results").html("<p>Loading...</p>");

    var requestString =

    'https://]]CRTeamraiserAPI?' +

    'method=getParticipants' +

    '&v=1.0' +

    '&api_key=]' +

    '&response_format=json' +

    '&suppress_response_codes=true' +

    '&fr_id=1260' +

    '&list_sort_column=last_name' +

    '&list_ascending=true' +

    '&last_name=' + query;

    var requestURL = "AjaxProxy?auth=]&cnv_url=" + escape(requestString);

    $.getJSON(requestURL,function(data)

    {

    if(data.errorResponse)

    {

    $("#results").html("<p>(" + data.errorResponse.message + ")</p>");

    } else {

    $("#results").html("");

    var trObject=data.getParticipantsResponse.participant;



    $.each(trObject,function()

    {

    $("#results").append("<p class=\\'rosterentry\\'>" + this.name.first + " " + this.name.last + " - (<a href=\\"" + this.personalPageUrl + "\\">Personal Page</a>)</p>");

    });

    }

    });

    };

    </script>

    <p>

    <a href="#" onclick="getRoster('a'); return false;">a</a> |

    <a href="#" onclick="getRoster('b'); return false;">b</a> |

    <a href="#" onclick="getRoster('c'); return false;">c</a> |

    ... |

    <a href="#" onclick="getRoster('x'); return false;">x</a> |

    <a href="#" onclick="getRoster('y'); return false;">y</a> |

    <a href="#" onclick="getRoster('z'); return false;">z</a>

    </p>

    <div id="results" style="padding: 5px; margin: 10px 0 10px 0; border: 1px solid #6CA0BF; background-color: #D7E5F0;"></div>

    I know this is an old thread, but has anyaone manged to make this work lately?

    i'm trying to generate a list of participants for a given event . running the code from within a page in Luminate but it does not works, sending "%%%" for last_name or first_name only gives me a "(No search criteria was provided. Please enter something to search for.)" error message on the page and passing just 'a' indicates that more than 3 characters are required.


    This is what I have thus far;


    <script type="text/javascript">

    $(document).ready(function()
    {
    getRoster('%%%');
    });

    this.getRoster=function(query)
    {

    $("#results").html("<p>Loading...</p>");

    var requestString =
    'https://secure2.convio.net/cco/site/CRTeamraiserAPI?' +
    'method=getParticipants' +
    '&v=1.0' +
    '&api_key=XXXXXX' +
    '&response_format=json' +
    '&suppress_response_codes=true' +
    '&fr_id=23454' +
    '&list_sort_column=last_name' +
    '&list_ascending=true' +
    '&first_name=' + query;


    var requestURL = requestString;

    $.getJSON(requestURL,function(data)
    {
    if(data.errorResponse)
    {
    $("#results").html("<p>(" + data.errorResponse.message + ")</p>");
    } else {

    $("#results").html("");

    var trObject=data.getParticipantsResponse.participant;

    $.each(trObject,function()
    {
    $("#results").append("<p class=\\'rosterentry\\'>" + this.name.first + " " + this.name.last + " - (<a href=\\"" + this.personalPageUrl + "\\">Personal Page</a>)</p>");
    });

    }
    });

    };

    </script>

    <p>
    <a href="#" onclick="getRoster('a'); return false;">a</a> |
    <a href="#" onclick="getRoster('b'); return false;">b</a> |
    <a href="#" onclick="getRoster('c'); return false;">c</a> |

    ... |

    <a href="#" onclick="getRoster('x'); return false;">x</a> |
    <a href="#" onclick="getRoster('y'); return false;">y</a> |
    <a href="#" onclick="getRoster('z'); return false;">z</a>

    </p>

    <div id="results" style="padding: 5px; margin: 10px 0 10px 0; border: 1px solid #6CA0BF; background-color: #D7E5F0;"></div>

    You'll want to be sure you encode the input, e.g. '&first_name=' + encodeURIComponent(query). Or, if you always want everyone, just encode it yourself, and use %25%25%25.

Categories