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

Luiza C <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>
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.