String searchQuery =
"SELECT media_file.source_url, "
+ "media_file.resource_name, "
+ "media_file.type, "
+ "media_file.video.youtube_video_id, "
+ "media_file.id "
+ "FROM media_file "
+ "LIMIT 50";
The response -
2019-10-17 19:07:21,614 INFO [Gax-3] logging.RequestLogger (RequestLogger.java:157) - SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v2.services.GoogleAdsService/Search, Endpoint: googleads.googleapis.com:443, CustomerID: 6985622543, RequestID: agbz5rYn1UFLY_c7_oOzbw, ResponseCode: OK, Fault: null. media file report:media img data '', source url '', resource name 'customers/6985622543/mediaFiles/22178892389', media file id 22178892389, youtube video id '', type 'UNKNOWN ' media file report:media img data '', source url '', resource name 'customers/6985622543/mediaFiles/22819931017', media file id 22819931017, youtube video id '', type 'UNKNOWN ' media file report:media img data '', source url '', resource name 'customers/6985622543/mediaFiles/22820898477', media file id 22820898477, youtube video id '', type 'UNKNOWN '
The source url, youtube video id are empty, type 'UNKNOWN' while it should be IMAGE & VIDEO. Is this because my assets are under review? I can pull the asset reporting though with the API, and youtube_video_id is clearly shown, see attachment.
Another question, one of my clients is trying to use the MediaFile API as well, and got "general_upload" for source_url, is this normal?
Please let me know, thanks!!
Best,
naomi

Hello,
Thank you for writing to us and sharing the complete details. The media_file.source_url field is only used for media of type AUDIO and IMAGE and so this will not be populated for video files. Also, I tried to generate the report for ads under review using the media_file resource and was successfully able to get the YouTube video id and the media_file.type = Video against my test account. Could you please try generating the reports using the sample report query below and let me know if you are still facing any issue?
SELECT media_file.source_url, media_file.resource_name, media_file.type, media_file.id, media_file.video.youtube_video_id from media_file
For your other concern, the source_url field gives you the URL of where the original media was downloaded from or a file name. It is possible that the name of the file from where the media was downloaded for client was 'general_upload' and this is the reason he is getting the same details via API. Let us know if this clarifies your concern.
Regards,
Nikisha Patel, Google Ads API Team