Error adding video

65 views
Skip to first unread message

Миша Васильев

unread,
Sep 14, 2018, 3:35:36 AM9/14/18
to AdWords API and Google Ads API Forum
Hello! I can't create a video for a universal campaign. I use .Net library v201806. I use the following code:

public static long[] UploadYoutubeVideo()
{
var videos = new List<string> { "RHwYAB2plr8" };
using (var mediaService = ServiceFactory.GetMediaService())
{
var media = new Media[videos.Count];
for (var i = 0; i < videos.Count; i++)
{
media[i] = new Video
{
youTubeVideoIdString = videos[i],
type = MediaMediaType.VIDEO
};
}
return (from video in mediaService.upload(media) select video.mediaId).ToArray();
}
}

Request:
<?xml version="1.0" encoding="utf-16"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201806"> <clientCustomerId>XXX-XXX-XXXX</clientCustomerId> <developerToken>-------------------------</developerToken> <userAgent>unknown (AwApi-DotNet/23.6.0, Common-Dotnet/9.4.0, .NET CLR/4.0.30319.42000, , gzip)</userAgent> </RequestHeader> </s:Header> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <upload xmlns="https://adwords.google.com/api/adwords/cm/v201806"> <media xsi:type="Video"> <type>VIDEO</type> <youTubeVideoIdString>RHwYAB2plr8</youTubeVideoIdString> </media> </upload> </s:Body> </s:Envelope> Error: The specified type is not supported.. (Error: MediaError.UNSUPPORTED_TYPE, FieldPath: media[0], Trigger: )

Luis Xander Talag (AdWords API Team)

unread,
Sep 14, 2018, 5:02:50 AM9/14/18
to AdWords API and Google Ads API Forum
Hi,

I'm afraid video media are currently not supported for uploading via the API. However, you could upload your videos using the AdWords UI. Once done uploading your videos via UI, you could get their mediaId using the MediaService.get() and set them to your UACs youtubeVideoMediaIds.

Let me know if you have further clarifications.

Thanks and regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages