Re: Could not set post labels using Blogger v3 API?

Bowo Prasetyo <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
Hi Luiza,

Wow.. thank you very much for the demonstration.
I am exciting to see that you have actually succeeded posting with labels 
using Blogger v3 API.
So, it became more strange that I could not do the same thing using exactly 
the same API Explorer and the same post.
If I post it without label, then it is successfully posted using the same 
API Explorer.
However, I could post with labels manually through blogger website 
interface as usual without any problem.

I think, the secret is hidden inside the error message that I got.
Do you know the meaning of it?

"We're sorry, but the value for field labels was not valid."


2015年6月4日木曜日 13時38分10秒 UTC+7 Luiza C:
>
> Bowo,
>
> I tried the cat,dog labels using the API suggested by Luke. It was 
> successful. Do you have a test blog?
>
> Here is the response (edited to take my blog id):
> POST 
> https://www.googleapis.com/blogger/v3/blogs/****************/posts?key={YOUR_API_KEY}
>  
> {
>  "labels": [
>   "Cat",
>   "Dog"
>  ],
>  "title": "test"
> }
>  
> Response
>
>  
> 200 OK
>  
> - Show headers -
>   
> {
>
>  "kind": "blogger#post",
>  "id": "****************",
>  "blog": {
>   "id": "**************"
>  },
>  "published": "2015-06-03T21:19:00-07:00",
>  "updated": "2015-06-03T21:19:46-07:00",
>  "etag": 
> "\"GtyIIQmNmmUjEA0nwhSqMElCJ1g/dGltZXN0YW1wOiAxNDMzMzkxNTg2OTE4Cm9mZnNldDogLTI1MjAwMDAwCg\"",
>  "url": "http://cbhtest.blogspot.com/2015/06/test.html",
>  "selfLink": "
> https://www.googleapis.com/blogger/v3/blogs/********************/posts/6814094815373406591
> ",
>  "title": "test",
>  "content": "",
>  "author": {
>   "id": "09349174109900942292",
>   "displayName": "***",
>   "url": "http://www.blogger.com/profile/09349174109900942292",
>   "image": {
>    "url": "
> http://3.bp.blogspot.com/-67qt_huoBbs/VL_s4R3sV-I/AAAAAAAAC_o/Bz8J9Z1_UFc/s35/*
> "
>   }
>  },
>  "replies": {
>   "totalItems": "0",
>   "selfLink": "
> https://www.googleapis.com/blogger/v3/blogs/*******************/posts/6814094815373406591/comments
> "
>  },
>  "labels": [
>   "Cat",
>   "Dog"
>  ],
>  "status": "LIVE",
>  "readerComments": "ALLOW"
> }
>
> On Wednesday, June 3, 2015 at 8:27:38 PM UTC-7, Bowo Prasetyo wrote:
>>
>> Hi Luiza,
>>
>> I used Google API Explorer, so I could not add the curly bracket by my 
>> self.
>>
>> 2015年6月4日木曜日 5時51分22秒 UTC+7 Luiza C:
>>>
>>> I use Java, not rest. Labels need to be a set. So, I think that you 
>>> probably forgot "{ }" that is:
>>> "labels": [ {
>>>   "test"
>>> }
>>>  ]
>>> Give it a try and let us know.
>>>
>>>
>>>

-- 
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.