Hi guys, please i have been struggling with the Rest API request body for creating new ad campaign. I keep getting response errors. Please help me with the correct request body. The operations involved for 'create' are many. I have read all about it too. Please check my code and help me correct it:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "
https://googleads.googleapis.com/v7/customers/{my customer id here}/campaigns:mutate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{
'operations': [
{
'create': {
'name': 'First Campaign #{1}',
'advertisingChannelType': 'SEARCH',
'status': 'PAUSED',
'networkSettings': {
'targetGoogleSearch': true,
'targetSearchNetwork': true,
'targetContentNetwork': false,
'targetPartnerSearchNetwork': false
},
'startDate': '{$start_date}',
'endDate': '{$end_date}',
'paymentMode': 'CLICKS',
Urgent solution needed. Please help.