Users

Top level endpoint. You can use retrieve or update User information.

Get user data

Get user information based on username in the provided token.

GET HTTPS /v1/users/
Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
username Unique user identifier String

Response payload

User

Response Status Code

Code Description Body
200 OK Return User information
204 No Content Return Error Response indicating the root cause

Update a user

Only the fields that are in the request body will be updated.

PUT HTTPS /v1/users/{username}

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
username Unique user identifier String

Body

Name Required Values Description
CONTENT-TYPE Y application/json Used to alert the rest service to the presence of a json body

Body Fields

Name Type Description
firstName String first name
lastName String last name
birthDay Integer (1-12) day of birth
birthMonth Integer (1-31) month of birth
birthYear Integer (>1900) year of birth
optIn Boolean mailing opt in (default true)
emailAddress String email address
street String street
city String city
state String state
country String country
zip String zip code
favoriteTeams Array in order of preference, each in TeamCode

Team Code

ARI,ATL,BAL,BUF,CAR,CHI,CIN,CLE,
DAL,DEN,DET,GB,HOU,IND,JAC,KC,
MIA,MIN,NE,NO,NYG,NYJ,OAK,PHI,
PIT,SD,SEA,SF,STL,TB,TEN,WAS

Request JSON

{
    "firstName": "Tom",
    "city": "Los Angeles",
    "favoriteTeams": [
        "STL",
        "BAL",
        "DAL"
    ]
}

Response Status Code

Code Description Body
202 Accepted No body
400 Bad Request No body

Delete a user

DELETE HTTP /v1/users/{username}

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
username Unique identifier for user to be deleted String

Get all Roles for the given User

GET HTTPS /users/{username}/roles

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Fields

Name Description Type
username Unique user identifier String

Response payload

{
   "roles":[
      {
         "name":"FAN",
         "domain":"ALL",
         "mutable":false
      },
      {
         "name":"AUTHOR",
         "domain":"ALL",
         "mutable":true
      }
   ]
}
Code Description Body
200 OK Return Role information
204 No Content Return Error Response indicating the root cause

Remove a role for a given user

This will remove a single role from this user's list of roles

DELETE HTTPS /users/{username}/roles

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
username Unique user identifier String

Body

Name Required Values Description
CONTENT-TYPE Y application/json Used to alert the rest service to the presence of a json body

Body fields

Name Description Type
roleName Role's name String

Request JSON

{
   "roleName":"FAN"
}
Code Description Body
202 Accepted No body

Add a role for a given user

This will add a single role to this user's list of roles

PUT HTTPS /v1/users/{username}/roles

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
username Unique user identifier String

Body

Name Required Values Description
CONTENT-TYPE Y application/json Used to alert the rest service to the presence of a json body

Body fields

Name Description Type
roleName Role's name String

Request JSON

{
   "roleName":"FAN"
}

Response Status Code

Code Description Body
202 Accepted No body

Get devices used by a user

GET HTTPS /v1/users/{username}/devices

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
username Unique user identifier String

Response payload

Device

Response Status Code

Code Description Body
200 OK Returns list of Devices for the given user