Hi,

No, ApiError array is not indexed the same as input array. If in input
array 3rd item has an error, then the first item in ApiError array
will point to the 3rd item (it can't point to first because first item
in input array didn't had any error).

In v2009 ApiError has new property: fieldPath (http://code.google.com/
apis/adwords/v2009/docs/reference/
CampaignService.ApiError.html#fieldPath) - The OGNL field path to
identify cause of error.

You can extract Index from there. For example, if 3rd item in input
array had some error ApiError.fieldPath would be something like
"operations[3].operand.criterion.text".

Here some code (C#) that we use for extracting index:

                string text = this.FieldPath ?? String.Empty;

                Regex extractIndex = new Regex(@"operations\[(?<index>
\d+)\].*", RegexOptions.Compiled | RegexOptions.CultureInvariant);

                Match m = extractIndex.Match(text);
                if (m == null || !m.Success)
                    return -1;
                else
                {
                    int result;
                    return int.TryParse(m.Groups["index"].Value, out
result) ? result : -1;
                }

Regards,
--
Josip
GemBox.Ppc - http://www.GemBoxSoftware.com/Ppc/Overview.htm - Advanced
AdWords API for C# / VB.NET

--

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.


Reply via email to