Create Contest

Create new contest

Request URL

http://fanvictor.com/api/mobile/CreateContest/{api_key}/{user_id}

Request Method

POST

Request parameters

api_key
string
Subscription key which provides access to this API.
user_id
interger
User id of account from client site.
league_name
string
Name of league
pool_id
interger
The id of event
game_type
string
PLAYERDRAFT, PICKEM, PICKSPREAD, PICKSQUARES
size
interger
2 for head to head, over 2 for league
entry_fee (Optional)
interger
0 for Free
structure
string
winnertakeall or top3
opponent
string
public or private
multi_entry (Optional)
interger
User can enter a contest multiple time, value 1 or 0
fight_id
string
A string of fight id splited by comma. For example: 123456,789456,456789
team1_spread_points (Optional)
string
A json string (only used for PICKSPREAD game type)
Array format array( 'fight_id' => {point} )
Sample json: {"12345":"1","45678":"-3"}
team2_spread_points (Optional)
string
A json string (only used for PICKSPREAD game type)
Array format array( 'fight_id' => {point} )
Sample json: {"12345":"1","45678":"-3"}

Sample Code

$params = array(
     'league_name' => '{league_name}',
     'pool_id' => '{pool_id}',
     'game_type' => '{game_type}',
     'size' => '{size}',
     'entry_fee' => '{entry_fee}',
     'structure' => '{structure}',
     'opponent' => '{opponent}',
     'multi_entry' => '{multi_entry}',
     'fight_id' => '{fight_id}',
     'team1_spread_points' => '{team1_spread_points}',
     'team2_spread_points' => '{team2_spread_points}',
)

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://fanvictor.com/api/mobile/CreateContest/{api_key}/{user_id}");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, urlencode(http_build_query($params)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close ($ch);