<faultstring>[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0]]</faultstring> Cancelling A bacth Job

17 views
Skip to first unread message

ro...@growth-rocket.com

unread,
Nov 28, 2017, 3:56:31 AM11/28/17
to AdWords API Forum
Hi Api Team,

Whats the correct code in cancelling a batch Job,

Im receiving OperatorError.OPERATOR_NOT_SUPPORTED, when I tried to do:

BatchJobOperation removeOp = new BatchJobOperation();
BatchJob batchJob = new BatchJob();
batchJob.setId(
awaitingfileBatchJobId);
removeOp.setOperator(Operator.
REMOVE);
removeOp.setOperand(batchJob);

BatchJob batchJobRet = batchJobService.mutate(
new BatchJobOperation[] {removeOp}).getValue(0);

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Nov 28, 2017, 10:08:38 AM11/28/17
to AdWords API Forum
Hi Roger, 

To cancel a BatchJob, you need to perform a BatchJobService.mutate() request and pass a BatchJobOperation with the following attributes set:
  1. operator = SET
  2. operand = a BatchJob with:
    • id = the batch job ID
    • status = CANCELING
Please note that you can only cancel a BatchJob if its status is AWAITING_FILE or ACTIVE. Please check the guide 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

Roger Orteza

unread,
Nov 29, 2017, 12:30:15 AM11/29/17
to adwordsapiadvi...@google.com, AdWords API Forum
Thank You 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 adwor...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/g63-Nf4kVuM/unsubscribe.
To unsubscribe from this group and all its topics, 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/546f94d7-b0d9-47f4-8af2-c506447a6a54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages