Making a public post

1 view
Skip to first unread message

roxy

unread,
Jul 30, 2010, 9:29:37 AM7/30/10
to Brightkite API
Hi

I have been trying to make a public post without success, using this
the post is restricted and can be seen only by me, how can it be made
to that the post are public?

<?php

$username='username';
$password='password';
$message=' is this on? ';
$place = '00000000000000000000000000000000';

$ch = curl_init();
$url = '';

if (strlen($message)+strlen($url)+1 > 140) {
$end = 140-(strlen($url)+1);
$message = substr($message, 0, $end);
$message = $message . ' ' . $url;
}
else
{
$message = $message . ' ' . $url;
}
$note = array('note[body]' => $message);
curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($ch, CURLOPT_URL, 'http://brightkite.com/places/' .
$place . '/notes.json');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $note);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response, TRUE);


print_r($json);

?>

alavoil

unread,
Jul 31, 2010, 6:58:24 PM7/31/10
to Brightkite API
I'm having a similar issue. I am trying to check in via the API, but
it's showing up as "Somewhere in the world". Any idea what I can do
to make the check-in public?

LJHarb

unread,
Jul 31, 2010, 9:48:01 PM7/31/10
to Brightkite API
Hi guys -

Please refer to the API documentation at http://api.brightkite.com/objects.html
which should answer your questions.

We're trying to get a better idea of how people are using the API -
would you mind explaining your use cases?

- Jordan

alavoil

unread,
Aug 1, 2010, 3:28:22 PM8/1/10
to Brightkite API
I tried using the 'who' parameter and setting it to friends, but the
check-in still returns with the 'share_with' as 'only me'. Here is my
CURL url string:

http://brightkite.com/places/[venue id]/checkins.json?who=friends

What am I doing wrong?

LJHarb

unread,
Aug 1, 2010, 3:33:51 PM8/1/10
to Brightkite API
"who" is the parameter for a GET request (it's listed under "search
objects").

object[share_with] is the parameter for a POST request (listed under
"Create an object")

alavoil

unread,
Aug 1, 2010, 4:21:00 PM8/1/10
to Brightkite API
That worked great! Thanks for the help.
Reply all
Reply to author
Forward
0 new messages