Thank you. My bad, I didn't read the migration guide :-(

Now I've got another problem : when I try to get the completed job, the 
status is always "AWAITING_FILE" for a loooooong time (and I'm just 
uploading 30 campaigns), as if I didn't start the upload.
Here's my code (I'm using the .NET client library)  : 
int delay = MUTATE_JOB_DELAY;
            BatchJobUtilities batchJobUploadHelper = new 
BatchJobUtilities(_user);
            BatchJob batchJob = null;
            try
            {
                BatchJobOperation operation = new BatchJobOperation { 
@operator = Operator.ADD, operand = new BatchJob() };
                var res = _batchJobService.mutate(new BatchJobOperation[] { 
operation });

                if (res != null && res.value.Count() > 0)
                {
                    batchJob = res.value.FirstOrDefault();
                }
                else
                {
                    logger.Error("Unable to create job in account 
{CustomerId}", _customerId);
                    return -1;
                }
            }
            catch
            {
                return -1;
            }

            if (batchJob != null)
            {
                string uploadUrl = batchJob.uploadUrl.url;
                string resumableUploadUrl = 
batchJobUploadHelper.GetResumableUploadUrl(uploadUrl);
                for (int i = 0; i < NB_MUTATE_JOB_RETRIES; i++)
                {
                    try
                    {
                        batchJobUploadHelper.Upload(resumableUploadUrl, 
operations);
                        return batchJob.id;
                    }
                    catch(Exception e)
                    {
                        Thread.Sleep(delay);
                        delay = (int)(delay * 1.33);
                    }
                }
                logger.Error("Unable to upload operations in account 
{CustomerId} after "+NB_MUTATE_JOB_RETRIES+" retries", _customerId);
                return -1;
            }
            else
            {
                logger.Error("Unable to create job in account 
{CustomerId}", _customerId);
                return -1;
            }

Thank you

Le vendredi 19 février 2016 08:07:10 UTC+1, Jbielsa a écrit :
>
> In v201601, you need to make an additional call to exchange the bulk 
> upload URL for a resumable upload URL. The relevant change in code is this 
> line: 
> https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/v201601/CampaignManagement/AddCompleteCampaignsUsingBatchJob.cs#L163
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
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/417ad591-7e1f-45ae-a89d-1c32d9e8664d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • v201... Clément Picou
    • ... 'Yin Niu' via AdWords API Forum
      • ... Jbielsa
        • ... Clément Picou
          • ... Jbielsa
            • ... 'Yin Niu' via AdWords API Forum
              • ... Clément Picou
                • ... 'Yin Niu' via AdWords API Forum
                • ... 'Thanet Knack Praneenararat (AdWords API Team)' via AdWords API Forum

Reply via email to