I found a great thread by Sean that details how to submit a roster update with curl and PHP here:
http://developer.yahoo.net/forum/index.php?showtopic=6238I am stuck on an error response I get that says: "Invalid XML POSTed. Error at line 2 of input XML.Return code: 400".
My XML is almost verbatim from his description except with my own league values inserted so I'm a bit stuck. My XML is as follows:
CODEBOX
$postdata = '<fantasy_content>
<roster>
<coverage_type>date</coverage_type>
<date>2011-07-06</date>
<players>
<player>
<player_key>7662</player_key>
<position>C</position>
</player>
</players>
</roster>
</fantasy_content>';
The url I am submitting this to is:
$url = "http://fantasysports.yahooapis.com/fantasy/v2/league/253.l.6248/transactions";
My error response says "Line 2" which is the <roster> tag. Not sure what else I could try here.
I'm reasonably sure that authorization is ok because if I make any changes to the OAuth token or consumer secret then instead it tells me: Please provide valid credentials....
The league key in the URL is probably okay also because if I change the league key to a team key like this:
$url = "http://fantasysports.yahooapis.com/fantasy/v2/league/253.l.6248.t.10/transactions";
then I get an error saying: Invalid league key 253.l.6248.t.10 provided.Return code: 400
So it just seems like I am doing everything right. The one thing that makes me uneasy is that I never provide any information as to which team I am updating the roster. Obviously a particular authorized user should only have the ability to update their own team. But it seems like I should still pass that team number up to the server somehow.
Thanks.