The Operator must create freespins campaign first by using the following API request to award freespins to a player.
14.1 Create Campaign Request
| Type | Input |
| Method | POST |
| URL | https://<AG-API-BASE-URL> /supplier/freespins/create_campaign |
| Headers | "Content-Type": "application/json" |
| POST Parameters | JSON Object(JSON-RPC 2.0) |
| Example | { "jsonrpc": "2.0", "id": 0, "method": "create_campaign", "params": { "name": "wild_depths_17_04", "description": "wild_depths_17_04", "start_time": "2024-01-12 07:37:00", "end_time": "2024-01-19 07:37:00", "number_of_spins": 10, "coin_value": 0.01, "number_of_coins": 1, "number_of_pay_lines": 100, "game_id": 2707, "hash":"f0d932dcb9c70eb85439658b17636835", "api_key": "gkw6RP2yadeFeSdf8zTs", "site_id": 6, "context": {} } } |
14.2 Request Parameters
| Parameter | Type | Description | Optional |
| name | String | Name of the campaign | |
| description | String | Description of the campaign | |
| start_time | Datetime | Start time of the campaign | |
| end_time | Datetime | End time of the campaign | |
| number_of_spins | Integer | Number of spins in the campaign | |
| coin_value | Decimal | Coin value for the campaign | |
| number_of_coins | Integer | Number of coins for each spin | |
| number_pay_lines | Integer | Number of pay lines for the campaign | |
| game_id | Integer | Game ID of the game associated with the campaign | |
| hash | String | The computed md5().hex digest() value of all mandatory fields refer to section-18. | |
| api_key | String | API key allocated to the Operator | |
| site_id | Integer | Site ID allocated to the Operator | |
| context | JSON Object | Any additional information |
14.3 Response Parameters
| Parameter | Type | Description |
| status | String | Status of the response(success) |
| error | String | Error code (0 for success) |
| campaign_code | Integer | Code of the created campaign |
14.4 Example Success Response
{
"jsonrpc": "2.0",
"result": {
"status": "success",
"error": 0,
"campaign_code": 1510
},
"id": 0
}
14.5 Example Error Response
The error response indicates an InvalidAPIKey (code 1000) with the message " Invalid API Key" providing details about the API key validation. Refer to section 12 for more information.
{
"jsonrpc": "2.0",
"error": {
"code": 1000,
"message": "Invalid APi Key.",
"name": "InvalidApiKey"
},
"id": 0
}