We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for writing this node wrapper.
node
I'm trying to create a display ad with an image. Currently I managed to:
Image
base64
My current approach is:
const request = require( 'request-promise-native' ) const api = new AdwordsUser( { ... } ) const uploadImage = url => new Promise( async ( resolve, reject ) => { const mediaService = api.getService('MediaService', 'v201809') let imgSrc = { 'xsi:type': 'Image', type: 'IMAGE', name: 'Generic' + ' - ' + Date.now(), data: Buffer.from( await request( url ), 'binary' ).toString( 'base64' ) } mediaService.upload( { media: [ imgSrc ] }, ( error, img ) => error ? reject( error ) : resolve( img.value[0] ) ) } )
Which results in:
{"faultcode":"soap:Client","faultstring":"[ImageError.INVALID_IMAGE @ media[0].data]","detail":{"ApiExceptionFault":{"message":"[ImageError.INVALID_IMAGE @ media[0].data]","ApplicationException.Type":"ApiException","errors":{"attributes":{"xsi:type":"ImageError"},"fieldPath":"media[0].data","fieldPathElements":[{"field":"media","index":0},{"field":"data"}],"trigger":"","errorString":"ImageError.INVALID_IMAGE","ApiError.Type":"ImageError","reason":"INVALID_IMAGE"}}}}
toString('base64')
Buffer.from
binary
utf8
If there is any useful information I can share let me know.
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
No branches or pull requests
Thanks for writing this
node
wrapper.I'm trying to...
I'm trying to create a display ad with an image. Currently I managed to:
Image
type which usesbase64
dataMy current approach is:
The unexpected result...
Which results in:
I've tried...
base64
(error)toString('base64')
to my console to manually check validityBuffer.from
encoding asbinary
andutf8
If there is any useful information I can share let me know.
The text was updated successfully, but these errors were encountered: