snipt

Ctrl+h for KB shortcuts

PHP

Post a checkin in Facebook

$facebook->api('/'.$uid.'/checkins', 'POST', array(
'access_token' => $facebook->getAccessToken(),
'place' => 'place_id',
'message' =>'I went to placename today',
'picture' => 'http://www.place.com/logo.jpg',
'coordinates' => json_encode(array(
   'latitude'  => 'lattiude',
   'longitude' => 'lattitude',
   'tags' => $uid),
 )
)
https://snipt.net/embed/6d4297c14f4b0b812e1e1009badf845c/
/raw/6d4297c14f4b0b812e1e1009badf845c/
6d4297c14f4b0b812e1e1009badf845c
php
PHP
12
2019-06-27T08:18:58
True
False
False
/api/public/snipt/30979/
post-a-checkin-in-facebook
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">$facebook-&gt;api(&#39;/&#39;.$uid.&#39;/checkins&#39;, &#39;POST&#39;, array(</span> </span><span id="L-2"><a name="L-2"></a><span class="x">&#39;access_token&#39; =&gt; $facebook-&gt;getAccessToken(),</span> </span><span id="L-3"><a name="L-3"></a><span class="x">&#39;place&#39; =&gt; &#39;place_id&#39;,</span> </span><span id="L-4"><a name="L-4"></a><span class="x">&#39;message&#39; =&gt;&#39;I went to placename today&#39;,</span> </span><span id="L-5"><a name="L-5"></a><span class="x">&#39;picture&#39; =&gt; &#39;http://www.place.com/logo.jpg&#39;,</span> </span><span id="L-6"><a name="L-6"></a><span class="x">&#39;coordinates&#39; =&gt; json_encode(array(</span> </span><span id="L-7"><a name="L-7"></a><span class="x"> &#39;latitude&#39; =&gt; &#39;lattiude&#39;,</span> </span><span id="L-8"><a name="L-8"></a><span class="x"> &#39;longitude&#39; =&gt; &#39;lattitude&#39;,</span> </span><span id="L-9"><a name="L-9"></a><span class="x"> &#39;tags&#39; =&gt; $uid),</span> </span><span id="L-10"><a name="L-10"></a><span class="x"> )</span> </span><span id="L-11"><a name="L-11"></a><span class="x">)</span> </span></pre></div> </td></tr></table>
checkin, facebook, post