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',
                       'campaigneBudget': '5'                    
                    }
                  }
                ],
                  'partialFailure': false,
                  'validateOnly': false
            }",
            CURLOPT_HTTPHEADER => array(
                "Content-Type: application/json",
                "developer-token: {my developer token here}",
                "login-customer-id: {my manager id here}",
                "Authorization: Bearer {my auth token}"
                ),
            ));
            $response = curl_exec($curl);
            
            curl_close($curl);
            
            var_dump($response)

Urgent solution needed. Please help.

On Monday, November 23, 2020 at 6:54:53 AM UTC adsapiforumadvisor wrote:

> Hi Steve,
>
> Thank you for reaching out.
>
> You may refer to this guide 
> <https://developers.google.com/google-ads/api/docs/rest/common/mutate> on 
> how you can derive and construct URLs if you choose to use the REST 
> interface for mutate requests.
>
> I hope this helps and please let me know if you have additional 
> clarifications.
>
> Best regards,
> [image: Google Logo] 
> Peter Laurence Napa Oliquino 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q27vHQp:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/472d3607-aa3c-4ea2-aa91-a0b1008f92ccn%40googlegroups.com.

Reply via email to