NFL.com Fantasy Football Web Services Documentation - Version 1

Docs Home

NFL.com Fantasy Football Web Services API

Getting Started

To get started, you'll need to get an application key and secret which allow you to authenticate the users. To request your key and secret, send mail to fantasy.football@nfl.com.

Authentication

The majority of services requires the user to be logged in using an authToken. You'll first make a call to the /auth/login web service which will return you back an authToken. You'll then pass that authToken to the rest of the services as a GET or POST parameter.


Most service calls are made by an application on behalf of the user. There are some service calls, however, which allow the application to change it's own state. For these services, a different authToken is needed. For these calls, you'll first make a call to the /application/login web service which will return you an application authToken. You will then pass that application authToken to those application services that need it (e.g. /application/editnotificationstatus).

Example Scenario - Getting a team's roster

  1. Make a call to the /auth/login service to get an authToken for the user.
  2. Make a call to the /user/leagues to get a list of leagues the user is in.
  3. Make a call to the /league/team/roster for a team the user is in.

Service Errors

HTTP Response Codes

A 200 response code will be returned for successful requests. A 400 response code for errors along with a list of the errors. A 500 response code if there was an internal error on our side (no error message will be returned in this case.)

Error Representaton

In the case of a webservice error, an error xml (defaul) or json response will be returned to the caller. The representation can show multiple errors for the same call. Example error representation:



XML:
            
<errors>
  <error id="authToken">You have entered an invalid auth token. Must be between 1 and 40 chars.</error>
  <error id="leagueId">You have entered an invalid league id.</error>
</errors>
            


JSON:
{"errors": [{"id":"authToken","message":"You have entered an invalid auth token. Must be between 1 and 40 chars."},
            {"id":"leagueId","message":"You have entered an invalid league id."}]}

Error Codes - Input Parameters

The following error codes may be returned from a call to any/all of these webservices. These error messages are only for what is passed as parameters. See below for errors that can occur for other reasons.

idmessage
addPlayerIdYou have entered an invalid player id.
appKeyYou have entered an invalid add key. Must be between 1 and 40 chars.
authTokenYou have entered an invalid auth token. Must be between 1 and 40 chars.
countYou have entered an invalid count.
dropPlayerIdYou have entered an invalid player id.
editorIdYou have entered an invalid editor id.
emailTypeYou have entered an invalid email type.
leagueIdYou have entered an invalid league id.
messageBodyYou have entered an invalid message body. Must be between 1 and 1000 chars.
notificationIdUnknown notification id.
notificationStatusUnknown notification status.
offsetYou have entered an invalid offset.
passwordYou have entered an invalid password. Must be between 1 and 20 chars.
phoneNumberYou have entered an invalid phone number.
playerIdYou have entered an invalid player id.
playerStatusYou have entered an invalid player status. Valid values are 'available' or 'taken'.
positionYou have entered an invalid position. Valid values are QB, RB, WR, TE, K, DEF.
You have entered an invalid roster slot.
seasonYou have entered an invalid season.
signatureYou have entered an invalid signature. Must be between 1 and 40 chars.
sortYou have entered an invalid sort.
statSeasonYou have entered an invalid season.
statWeekYou have entered an invalid week.
teamAbbrYou have entered an invalid team abbreviation.
teamIdYou have entered an invalid team id. Must be between 1 and 20.
timestampYou have entered an invalid timestamp.
usernameYou have entered an invalid username. Must be between 1 and 40 chars.
userIdYou have entered an invalid user id.
waiverBidYou have entered an invalid bid. Please enter a bid from 0 to your league setting maximum.
waiverBudgetYour bid exceeds your remaining seasonal waivers acquisition budget, per league settings. Reduce your bid and try again.
weekYou have entered an invalid week. Valid values: 1-17.

Error Codes - Misc

The following error codes may be returned from a call to any/all of these webservices.

idmessage
authTokenInvalidAuth Token is not valid.
authTokenExpiredAuth Token has expired.
appKeyNoAccessApp Key is not authorized.
Auth Token was generated frm a different environment.
leagueInvalidLeague does not exist.
The league is not post-draft.
The season is over for this league.
nflUserNotFantasyNFL user is not a fantasy user.
You have too many players in position %s.
passwordIncorrectUsername and Password combination are invalid.
The player, %s, is on %s's team.
The player, %s, is already involved in an accepted trade.
The player, %s, is locked for this week.
The player, %s, is not editable for the week.
The player, %s, is not eligible to play in position %s.
The player, %s, is not eligible in the league.
%s is not on %s's team.
%s is on %s's team.
The player, %s, is on the undroppable list.
signatureInvalidSignature does not match correctly.
You cannot edit your roster for the week.
teamInvalidTeam does not exist in the league.
You are locked from this action.
The team is over the max player adds per season.
The team, %s, will be over the max roster position limit for %s.
The team, %s, will be under the min roster position limit for %s.
The team is under the min roster size of 1.
userNotLeagueMemberUser is not in the league.
userNotLoggedInUser is not logged in.
The user is not the manager of this team.
The waiver request already exists.
The selected waiver request is not valid due to your league's season being completed and final.
NFL.com Fantasy Football Registration is now closed. Check back next season to sign up.
You are over the max teams allowed.
Copyright © 2014 NFL.com. All Rights Reserved.