Is another parameter added to the Object creation call

7 views
Skip to first unread message

Codomaniac

unread,
Dec 22, 2010, 1:09:53 AM12/22/10
to Brightkite API
Hi,

I have been trying to create an object (note) simple message with
parameters

object[body] -> "xyz"

and also this (trying to do a checkin)

object[body] -> "xyz"
object[place_id] -> "a valid place Id"

I am getting a 422 response as

<errors>
<error>
<field>category</field>
<message>You have provided an invalid value for this field!</
message>
</error>
</errors>

The API documentation has nothing regarding this field?

Codomaniac

unread,
Dec 22, 2010, 6:33:49 AM12/22/10
to Brightkite API
PostMethod method = new PostMethod("http://brightkite.com/
objects.xml");

method.addParameter("object[place_id]", "A valid place id");
method.addParameter("object[body]", "bla bla");
method.addParameter("object[share_with]", "friends");

String auth = Username+":"+Password;

method.setRequestHeader("Authorization","Basic "+
Base64.encodeBytes(auth.getBytes()).trim());

method.addParameter("http.protocol.expect-continue", "false");

try{
int returnCode = client.executeMethod(method);

System.out.println(returnCode);

BufferedReader br = new BufferedReader(new
InputStreamReader(method.getResponseBodyAsStream()));
String readLine;
while(((readLine = br.readLine()) != null)) {
System.err.println(readLine);
}

}catch(Exception e)
e.printStackTrace();


I get this error

<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>
<field>category</field>
<message>You have provided an invalid value for this field!</
message>
</error>
</errors>


Is there a parameter by the name "category" that i am missing? if
there is then what are its valid values?

Please reply.

Codomaniac

unread,
Dec 22, 2010, 8:04:30 AM12/22/10
to Brightkite API
method.addParameter("http.protocol.expect-continue", "false");

this line is not important, even if I remove it, it still doesnot work!

appdeveloper

unread,
Dec 22, 2010, 5:51:00 PM12/22/10
to Brightkite API
Same issue with my app. BrightKite folks please update.

David Ivins

unread,
Jan 23, 2011, 2:25:42 PM1/23/11
to Brightkite API
I am currently having this same problem. Did anyone figure out how to
resolve this?
Reply all
Reply to author
Forward
0 new messages