Re: Upload images using Blogger API
Vicky <[email protected]>
| Newsgroups | gmane.comp.web.blogger.api |
|---|---|
| Message-ID | <[email protected]> |
If you want to insert an image into your post, you can use:
resource: {
title : 'title',
content : 'Content <img
src="http://pthumbnails.5min.com/10365943/518297116_6_300_170.jpg"/>',
labels : ['XX', 'YY', 'ZZ']
}
Thus, instead of resource.img object, just use HTML in the resource.content
(also be aware about labels array). But if you really want to upload an
image to the server, you should use the Google Picker API
<https://developers.google.com/picker/docs/> to upload the image and obtain
its URL. Then, using the obtained URL, insert the image using method above.
On Thursday, July 10, 2014 11:34:01 AM UTC+3, Jai Ganesh wrote:
>
> Tried to upload image using the following code but so far no success
> through the code was able to create a blogpost with other details
>
> gapi.client.load('blogger', 'v3', function() {
> var request = gapi.client.blogger.posts.insert({
> "blogId": "XXXXX",
> "resource" : {
> "title" : "title",
> "content" : "Content",
> "labels": [XX,YY,ZZ],
> "image" : {
> "url": '
> http://pthumbnails.5min.com/10365943/518297116_6_300_170.jpg'
> }
> }
> });
>
> request.execute(function(response) {
> alert(response.toSource());
> });
> });
>
> Can you help me on what is the mistake i am doing????
>
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.