14. CREATE FREESPIN CAMPAIGN

The Operator must create freespins campaign first by using the following API request to award freespins to a player.

14.1 Create Campaign Request

TypeInput
MethodPOST
URLhttps://<AG-API-BASE-URL> /supplier/freespins/create_campaign
Headers "Content-Type": "application/json"
POST ParametersJSON 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

ParameterTypeDescriptionOptional
nameStringName of the campaign
descriptionStringDescription of the campaign
start_timeDatetimeStart time of the campaign
end_timeDatetimeEnd time of the campaign
number_of_spinsIntegerNumber of spins in the campaign
coin_valueDecimalCoin value for the campaign
number_of_coinsIntegerNumber of coins for each spin
number_pay_linesIntegerNumber of pay lines for the campaign
game_idIntegerGame ID of the game associated with the campaign
hashStringThe computed md5().hex digest() value of all mandatory fields refer to section-18.
api_keyStringAPI key allocated to the Operator
site_idIntegerSite ID allocated to the Operator
contextJSON ObjectAny additional information

14.3 Response Parameters

ParameterTypeDescription
statusStringStatus of the response(success)
errorStringError code (0 for success)
campaign_codeIntegerCode 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
}