Re: MediaService : Get a MediaId of one ImageAd ?

2014-03-10 Thread Anash P. Oommen (AdWords API Team)
Hi,

I think you could filter by ReferenceId instead - that's returned by bot 
AdGroupAdService and MediaService.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Monday, February 24, 2014 5:42:08 AM UTC-5, xpander wrote:
>
> Hello Anash 
>
> I'm sorry but Eric Koleda (an other guy AdWords API Advisor) dont say the 
> same think in this post "Cannot select image.mediaId and image.name using 
> AdGroupAdService" 
> I try it witjh AdGroupAdService and i cannot get the mediaid ...
> How can i get this mediaID ?
>
> Thank
>
> Arnaud
>
> ---
> Eric Koleda 01/02/12
> Unfortunately the selector field reference is inaccurate in this case. 
>  Although the MediaId and Name fields are part of the Media type (which 
> Image inherits from) they aren't always populated.  MediaId will only be 
> populated in the MediaService, and the name field isn't populated for 
> Images at all.  We'll work on updating that documentation to make this more 
> accurate.
> Best,
> - Eric Koleda, AdWords API Team
> -
>
>
>
>
>
> Le vendredi 21 février 2014 16:34:29 UTC+1, Anash P. Oommen (AdWords API 
> Team) a écrit :
>>
>> Hi,
>>
>> You need to first retrieve the mediaId associated with your imageAd. 
>> You'd need AdGroupAdService to do this. and your predicates should be the 
>> ones listed here: 
>> https://developers.google.com/adwords/api/docs/reference/v201309/AdGroupAdService.Image.
>>  
>> Next, you can use MediaService to filter for media with MediaId = 
>> your_media_id. An example is here: 
>> https://github.com/googleads/googleads-adwords-dotnet-lib/blob/master/examples/adwords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs
>>
>> The reason why you cannot filter using AdId in MediaService is because 
>> AdId is not a globally unique id, and also because there's no 1:1 mapping 
>> between a media and the ad that uses it.
>>
>> Cheers,
>> Anash P. Oommen,
>> AdWords API Advisor.
>>
>> On Friday, February 21, 2014 10:17:19 AM UTC-5, xpander wrote:
>>>
>>> Hello,
>>>
>>> I'm on adwords API document, it's a nightmare you can't find anywhere 
>>> witch predicate can be used with MediaService (or other service).
>>>
>>> My problem is simple : i have an ImageAd, i want to retrieve the 
>>> MediaId. I use MediaService. 
>>> Assume _AdID is the id of ImageAd.
>>> Wiitch Predicate.field i must use ? i try ID, Id , id, ImageAd ...
>>>
>>>
>>> Selector _Selector = new Selector ();
>>>
>>> Predicate _Predicate = new Predicate ();
>>> _Predicate.field = "id"; 
>>> _Predicate.@operator = PredicateOperator.EQUALS;
>>> _Predicate.operatorSpecified = true;
>>> _Predicate.values = new string[] { _AdID.ToString () };
>>> _Selector.predicates = new Predicate[] { _Predicate };
>>>
>>> _Selector.fields = new string[] { "MediaId" };
>>>
>>> MediaPage _MediaPage = _MediaService.get (_Selector);
>>>
>>>
>>> Thk
>>>
>>> Arnaud
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.


Re: MediaService : Get a MediaId of one ImageAd ?

2014-02-24 Thread xpander
Hello Anash 

I'm sorry but Eric Koleda (an other guy AdWords API Advisor) dont say the 
same think in this post "Cannot select image.mediaId and image.name using 
AdGroupAdService" 
I try it witjh AdGroupAdService and i cannot get the mediaid ...
How can i get this mediaID ?

Thank

Arnaud

---
Eric Koleda 01/02/12
Unfortunately the selector field reference is inaccurate in this case. 
 Although the MediaId and Name fields are part of the Media type (which 
Image inherits from) they aren't always populated.  MediaId will only be 
populated in the MediaService, and the name field isn't populated for 
Images at all.  We'll work on updating that documentation to make this more 
accurate.
Best,
- Eric Koleda, AdWords API Team
-





Le vendredi 21 février 2014 16:34:29 UTC+1, Anash P. Oommen (AdWords API 
Team) a écrit :
>
> Hi,
>
> You need to first retrieve the mediaId associated with your imageAd. You'd 
> need AdGroupAdService to do this. and your predicates should be the ones 
> listed here: 
> https://developers.google.com/adwords/api/docs/reference/v201309/AdGroupAdService.Image.
>  
> Next, you can use MediaService to filter for media with MediaId = 
> your_media_id. An example is here: 
> https://github.com/googleads/googleads-adwords-dotnet-lib/blob/master/examples/adwords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs
>
> The reason why you cannot filter using AdId in MediaService is because 
> AdId is not a globally unique id, and also because there's no 1:1 mapping 
> between a media and the ad that uses it.
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.
>
> On Friday, February 21, 2014 10:17:19 AM UTC-5, xpander wrote:
>>
>> Hello,
>>
>> I'm on adwords API document, it's a nightmare you can't find anywhere 
>> witch predicate can be used with MediaService (or other service).
>>
>> My problem is simple : i have an ImageAd, i want to retrieve the MediaId. 
>> I use MediaService. 
>> Assume _AdID is the id of ImageAd.
>> Wiitch Predicate.field i must use ? i try ID, Id , id, ImageAd ...
>>
>>
>> Selector _Selector = new Selector ();
>>
>> Predicate _Predicate = new Predicate ();
>> _Predicate.field = "id"; 
>> _Predicate.@operator = PredicateOperator.EQUALS;
>> _Predicate.operatorSpecified = true;
>> _Predicate.values = new string[] { _AdID.ToString () };
>> _Selector.predicates = new Predicate[] { _Predicate };
>>
>> _Selector.fields = new string[] { "MediaId" };
>>
>> MediaPage _MediaPage = _MediaService.get (_Selector);
>>
>>
>> Thk
>>
>> Arnaud
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: MediaService : Get a MediaId of one ImageAd ?

2014-02-21 Thread Anash P. Oommen (AdWords API Team)
Hi,

You need to first retrieve the mediaId associated with your imageAd. You'd 
need AdGroupAdService to do this. and your predicates should be the ones 
listed 
here: 
https://developers.google.com/adwords/api/docs/reference/v201309/AdGroupAdService.Image.
 
Next, you can use MediaService to filter for media with MediaId = 
your_media_id. An example is 
here: 
https://github.com/googleads/googleads-adwords-dotnet-lib/blob/master/examples/adwords/CSharp/v201309/Miscellaneous/GetAllVideosAndImages.cs

The reason why you cannot filter using AdId in MediaService is because AdId 
is not a globally unique id, and also because there's no 1:1 mapping 
between a media and the ad that uses it.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Friday, February 21, 2014 10:17:19 AM UTC-5, xpander wrote:
>
> Hello,
>
> I'm on adwords API document, it's a nightmare you can't find anywhere 
> witch predicate can be used with MediaService (or other service).
>
> My problem is simple : i have an ImageAd, i want to retrieve the MediaId. 
> I use MediaService. 
> Assume _AdID is the id of ImageAd.
> Wiitch Predicate.field i must use ? i try ID, Id , id, ImageAd ...
>
>
> Selector _Selector = new Selector ();
>
> Predicate _Predicate = new Predicate ();
> _Predicate.field = "id"; 
> _Predicate.@operator = PredicateOperator.EQUALS;
> _Predicate.operatorSpecified = true;
> _Predicate.values = new string[] { _AdID.ToString () };
> _Selector.predicates = new Predicate[] { _Predicate };
>
> _Selector.fields = new string[] { "MediaId" };
>
> MediaPage _MediaPage = _MediaService.get (_Selector);
>
>
> Thk
>
> Arnaud
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/groups/opt_out.


MediaService : Get a MediaId of one ImageAd ?

2014-02-21 Thread xpander
Hello,

I'm on adwords API document, it's a nightmare you can't find anywhere witch 
predicate can be used with MediaService (or other service).

My problem is simple : i have an ImageAd, i want to retrieve the MediaId. I 
use MediaService. 
Assume _AdID is the id of ImageAd.
Wiitch Predicate.field i must use ? i try ID, Id , id, ImageAd ...


Selector _Selector = new Selector ();

Predicate _Predicate = new Predicate ();
_Predicate.field = "id"; 
_Predicate.@operator = PredicateOperator.EQUALS;
_Predicate.operatorSpecified = true;
_Predicate.values = new string[] { _AdID.ToString () };
_Selector.predicates = new Predicate[] { _Predicate };

_Selector.fields = new string[] { "MediaId" };

MediaPage _MediaPage = _MediaService.get (_Selector);


Thk

Arnaud

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/groups/opt_out.