Tuesday, 12 April 2016

Switching from MutateJobService to BulkJobService

Hi,

I am trying to change the old 'MutateJobService' to 'BulkJobService' as the former service has been deprecated in the last version of the API. 
I use PHP, and my code currently looks like this:

    public function create_mutate_job($client_id, $operations) {

        $user = new AdWordsUser();
        $user->SetClientCustomerId($client_id);

        $mutateJobService = $user->GetService('MutateJobService ', ADWORDS_VERSION);

        $policy = new BulkMutateJobPolicy();
        $policy->prerequisiteJobIds = array();

        $job = $mutateJobService->mutate($operations, $policy);

        if (!empty($job->id)) {
            $job_details = new stdClass();
            $job_details->job_id = $job->id;
            $job_details->client_id = $client_id;

            return $job_details;
        }
    }

I tried to change the service name to 'BatchJobService', however that doesn't work (just fails silently). There is an 'uploadurl' property which needs to be used and that is where I need a help. 

How could I change the code above so it works with 'BatchJobService'?

Cheers,

Kanan

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/5d8efb3c-c412-40a6-8908-18b11a7ad356%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment