Hi Roger, 

To cancel a BatchJob, you need to perform a BatchJobService.mutate() 
<https://developers.google.com/adwords/api/docs/reference/latest/BatchJobService#mutate>
 request 
and pass a BatchJobOperation 
<https://developers.google.com/adwords/api/docs/reference/latest/BatchJobService.BatchJobOperation>
 with 
the following attributes set:

   1. operator 
   
<https://developers.google.com/adwords/api/docs/reference/latest/BatchJobService.BatchJobOperation#operator>
 = 
   SET
   2. operand 
   
<https://developers.google.com/adwords/api/docs/reference/latest/BatchJobService.BatchJobOperation#operand>
 = 
   a BatchJob with:
      - id = the batch job ID
      - status = CANCELING
   
Please note that you can only cancel a BatchJob if its status 
<https://developers.google.com/adwords/api/docs/reference/latest/BatchJobService.BatchJob#status>
 is 
AWAITING_FILE or ACTIVE. Please check the guide 
<https://developers.google.com/adwords/api/docs/guides/batch-jobs#canceling_a_batch_job>
 on 
batch processing for more details. 

Given below is a sample code snippet :
    BatchJob batchjobToCancel = new BatchJob();
    batchjobToCancel.setId(batchJob.getId());
    batchjobToCancel.setStatus(BatchJobStatus.CANCELING);

    BatchJobOperation cancelOperation = new BatchJobOperation();
    cancelOperation.setOperator(Operator.SET);
    cancelOperation.setOperand(batchjobToCancel);

    batchJobService.mutate(new BatchJobOperation[] {cancelOperation}).
getValue(0);

  
Thanks,
Sreelakshmi, AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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+unsubscr...@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+unsubscr...@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/546f94d7-b0d9-47f4-8af2-c506447a6a54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • <faul... roger
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
      • ... Roger Orteza

Reply via email to