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,

Ow yes.. you're right.. I have successfully inserted a post with labels 
into my other blog.
And  then.. failed again to insert the same post into the offending blog.

There is no special settings for these two blogs, however the significant 
difference is that the successful blog only has 8 posts, while the 
offending blog has more than 1300 posts.

May be it already hit the limit set by Google for API access.
However, it still accepts manual posting via blogger website without 
problem as usual.

Maybe Google should improve the error message in JSON response of the API, 
so developers can roughly know what is the problem.
Thank you very much for your help.


2015年6月5日金曜日 7時16分10秒 UTC+7 Luiza C:
>
> Bowo,
>
> The message does not ring any bell... The only thing I can think of is if 
> there is a setting in the blog itself. I created my blogs a long time ago, 
> so I do not remember the settings, and I do not remember any settings 
> related to labels... 
>
> Have you tried to create a new blog just for testing this particular label 
> problem,Then try to post to the newly-created blog and see what happens..
> Just to let you know, I did have the cat and dog labels before I posted. 
> So, I just tried with labels that I did not have, and it also succeeded...
>
> Let us know if you succeed as it can happen to any of us.
>
> On Thursday, June 4, 2015 at 12:46:14 AM UTC-7, Bowo Prasetyo wrote:
>>
>> 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.