Get Team Roster API call seems to ignore Leagues

We will try and answer Questions in this forum. If you are having any issues with iScore Baseball, this is probably the best place to start. You can also search historical posts here.
Post Reply
User avatar
KevinG
Posts: 10
Joined: Tue Apr 24, 2012 11:31 pm

Get Team Roster API call seems to ignore Leagues

Post by KevinG » Wed Mar 27, 2013 11:36 am

Our team is in only one current league (2013 Nomads) and I've set up current players to be in this league while setting up old players to be in the old league (Default). On the team website Maltby Nomads the roster shows only the current players and the league defaulted to 2013 Nomads as I would expect. If I then select league All, it shows all players from both leagues, again what I would expect. If I use the Get Team Roster API call to retrieve the roster, it returns all players from all leagues as shown on our regular website MaltbyNomads.org. I would like it to return only players for the team's active league(s) or give me an option to select the league(s) I want.

I've tried using lg=(league GUID) and l=(league GUID) as parameters hoping they may be undocumented but neither one filtered the results. How can I retrieve a roster based on the active league (2013 Nomads)? I don't want to delete the old players if I don't have to.

Thanks,

Coach Kevin
Maltby Nomads
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Re: Get Team Roster API call seems to ignore Leagues

Post by FTMSupport » Wed Mar 27, 2013 2:21 pm

We have added lg= as an optional parameter to the Get Team Roster API call now. If you have already tried calling the API with lg= values, you may need to Export from iScore to clear the server side cache for your data (the Website API caches results, and each time you export, those results are cleared for your account).
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Jasperbhouse
Posts: 46
Joined: Mon Aug 30, 2010 4:49 am

Re: Get Team Roster API call seems to ignore Leagues

Post by Jasperbhouse » Thu Mar 28, 2013 4:13 am

Nice youre still using the Joomla component! Note however that iScore API has changed once you move to v4. You need to make some changes in in the php files. For example the batting average changed from calc_avg to bat_avg.
User avatar
KevinG
Posts: 10
Joined: Tue Apr 24, 2012 11:31 pm

Re: Get Team Roster API call seems to ignore Leagues

Post by KevinG » Thu Mar 28, 2013 11:10 am

Support, thanks for the quick response. The lg= parameter is working great for the roster call. I am working through some of the other calls to make sure only the players in the active league show up in the team stats. Right now it looks like they are not being filtered, but I am still verifying and will post my findings.

Coach Kevin
Maltby Nomads
User avatar
KevinG
Posts: 10
Joined: Tue Apr 24, 2012 11:31 pm

Re: Get Team Roster API call seems to ignore Leagues

Post by KevinG » Thu Mar 28, 2013 11:16 am

Jasperbhouse, thanks for the heads-up on the v4 changes. I'll go through them and make the appropriate changes. Hope your team continues to have a great season and thanks again for allowing the public to use your Joomla iScore component. I think it does a great job presenting information to our team and fans.

Coach Kevin
Maltby Nomads
User avatar
FTMSupport
Site Admin
Posts: 13193
Joined: Sat Mar 28, 2009 7:25 pm

Re: Get Team Roster API call seems to ignore Leagues

Post by FTMSupport » Thu Mar 28, 2013 11:17 am

We would not expect the other calls to do this as they were only intended to filter the stats to the leagues. The iScore Team Website essentially does what you are trying to do by making the call to get the Roster for a league, then makes the call to get the Stats based on a league, then only displays the players that are in the active league depending on the setting for the Team Website. Some people want to see all players currently in the roster, some want to see only active players, and some want to filter the players based on what league the player is associated with.

We would not want to change the API to function differently in that regard as people use it differently depending on their use case. Maybe you could put similar logic on your site - a call to Get Roster to get the active players (filtering by a league if you'd like), then apply that list to the call to stats filtering out any players that are not in the league you want to view.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
User avatar
KevinG
Posts: 10
Joined: Tue Apr 24, 2012 11:31 pm

Re: Get Team Roster API call seems to ignore Leagues

Post by KevinG » Thu Mar 28, 2013 11:48 am

Support, I will try to filter based on your recommendations. I don't quite understand the logic, but I can't argue against it.

Thanks,

Coach Kevin
Maltby Nomads
Post Reply