Get an campaign

Get an campaign

Request

GET https://api.frontcore.com/v2/campaigns/:id

For every API request you make, you'll need to present the API access key in the HTTP Header as X-API-Key to be authenticated.

Example code in PHP

$request_url = 'https://api.frontcore.com/v2/campaigns/22353';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  'X-API-Key: {your-api-key}',
  'Accept: application/json',
));
$result = curl_exec($ch);
curl_close($ch);
               

Response

If the method is successful it responds with an JSON structure, as it is shown below.

{
    "successful": false,
    "errors": [
        {
            "code": "resource_not_found",
            "message": "We can not find any valid campaigns with given code."
        }
    ]
}

Unsuccessful response sample:

{
    "error": "Wrong API Key"
}      
© 2025 FrontCore