Teamraiser API - Question

Options
Hello,



I'm using Brain Mucha's very useful jQuery plugin (jquery.getParticipantRoster.js v1.2) to get the list of participants for a Teamraiser. It works great out of the box. I'm trying however to get the participants of a specific team and run into what seems to be a simple issue.



When making the call, the request is successful only when the "&" symbol after the team name string is not encoded.



So this call works (with "&" after team_name value):

https://secure3.convio.net/[shortname]/site/AjaxProxy?auth=XXX_url=https%3A//secure3.convio.net/[shortname]/site/CRTeamraiserAPI%3Fmethod%3DgetParticipants%26v%3D1.0%26api_key%3Dopen%26response_format%3Djson%26suppress_response_codes%3Dtrue%26fr_id%3D1340%26team_name%3DTeam%20Early&list_sort_column%3Dname%26list_ascending%3Dtrue%26list_page_size%3D40%26list_page_offset%3D0%26first_name%3D%25%25%25



But this call results in a "Unable to process request" error (with "%26" after team_name value):

https://secure3.convio.net/[shortname]/site/AjaxProxy?auth=XXX_url=https%3A//secure3.convio.net/[shortname]/site/CRTeamraiserAPI%3Fmethod%3DgetParticipants%26v%3D1.0%26api_key%3Dopen%26response_format%3Djson%26suppress_response_codes%3Dtrue%26fr_id%3D1340%26team_name%3DTeam%20Early%26list_sort_column%3Dname%26list_ascending%3Dtrue%26list_page_size%3D40%26list_page_offset%3D0%26first_name%3D%25%25%25



Anyone have any ideas as to what's going on?



​Thanks!
Tagged:

Comments

  • Hey! Cool, nice to see it being used.



    That's pretty strange. Have you tried turning on API debugging?







    Set it to 'DEBUGGING' to get the most information. (Yes, it's a pain finding the log for your transaction! Check out Noah's tip.)



    My first thought is that is has something to do with list_sort_column.



    Without encoding the ampersand I think you are really passing:

    team_name=Team Early&list_sort_column=name



    It chokes when it sees:

    team_name=Team Early

    list_sort_column=name



    Which seems right. The logs will tell you what the server is actually seeing, which may give us some clues.

  • Brian Mucha:

    Hey! Cool, nice to see it being used.



    That's pretty strange. Have you tried turning on API debugging?







    Set it to 'DEBUGGING' to get the most information. (Yes, it's a pain finding the log for your transaction! Check out Noah's tip.)



    My first thought is that is has something to do with list_sort_column.



    Without encoding the ampersand I think you are really passing:

    team_name=Team Early&list_sort_column=name



    It chokes when it sees:

    team_name=Team Early

    list_sort_column=name



    Which seems right. The logs will tell you what the server is actually seeing, which may give us some clues.

    Hey Brian,



    Thanks for the response and the script.



    I tried removing the list_sort_column paramter and it works great. Do you see any issue with removing aside form not being able to sort by the name?



    On a related know, is there anyway to look for the team by team ID instead of team name?



    I looked at the debugging info and nothing is standing out to me (pretty new to APIs). But I've attached it here incase you see anything.



    Thanks again Brian.



    Just checked the debugging and not sure I understand what's going on there (pretty new to APIs). I've attached it here.
  • That's what I guessed.

    Error: ORA-00918: column ambiguously defined
    So this seems to mean that there is a column called 'name' in more than one of the tables being joined behind the scenes in Oracle. I think those are the team and reg tables.



    There is no problem omitting this param, but you could also try passing team.name rather than just name.
  • Don't forget to turn debugging back down as it impacts your site speed.
  • Brian Mucha:

    Don't forget to turn debugging back down as it impacts your site speed.

    Thank Brian for your help!



    By the way any idea if we can search by team ID instead of team name?
  • You can't search by teamId with getParticipants, but there is a similar method you could use.



    http://open.convio.com/api/#teamraiser_api.getTeamMembers_method.html



    There's no pagination which simplifies things, but there is also no sorting. If you wanted to keep sorting, you'd have to handle that in the plugin inside of if ($(trObject).size() > 0) { } at line 160.

  • Brian Mucha:

    You can't search by teamId with getParticipants, but there is a similar method you could use.



    http://open.convio.com/api/#teamraiser_api.getTeamMembers_method.html



    There's no pagination which simplifies things, but there is also no sorting. If you wanted to keep sorting, you'd have to handle that in the plugin inside of if ($(trObject).size() > 0) { } at line 160.

    Ah ok awesome. Thanks a lot Brian!
  • Glad to help. Post what you come up with!
  • Brian Mucha:

    Glad to help. Post what you come up with!

    Hey Brian,

    Wanted to share how we used your script. Swapped out "getParticipants" for "getTeamMembers". What it does is show you a list of members on a team when clicking "Donate Now" from a team page, giving them the option to a donate to a team member before making a general team donation.


    http://engage.acfb.org/site/TR/HungerWalkJewishFederationofGreaterAtlanta/HungerWalk?team_id=32947&pg=team&fr_id=1735

Categories