Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Simple CURL API POST

Received: by 10.223.99.66 with SMTP id t2mr331520fan.14.1303758495469;
        Mon, 25 Apr 2011 12:08:15 -0700 (PDT)
X-BeenThere: trunkly-dev@googlegroups.com
Received: by 10.223.78.196 with SMTP id m4ls1590359fak.0.gmail; Mon, 25 Apr
 2011 12:08:14 -0700 (PDT)
Received: by 10.223.83.139 with SMTP id f11mr343775fal.0.1303758494518;
        Mon, 25 Apr 2011 12:08:14 -0700 (PDT)
Received: by 10.223.83.139 with SMTP id f11mr343774fal.0.1303758494480;
        Mon, 25 Apr 2011 12:08:14 -0700 (PDT)
Return-Path: <tim.b...@binaryplex.com>
Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53])
        by gmr-mx.google.com with ESMTPS id 20si657202fav.6.2011.04.25.12.08.13
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 25 Apr 2011 12:08:13 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.214.53 is neither permitted nor denied by best guess record for domain of tim.b...@binaryplex.com) client-ip=209.85.214.53;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.214.53 is neither permitted nor denied by best guess record for domain of tim.b...@binaryplex.com) smtp.mail=tim.b...@binaryplex.com
Received: by mail-bw0-f53.google.com with SMTP id 12so2294049bwg.12
        for <trunkly-dev@googlegroups.com>; Mon, 25 Apr 2011 12:08:13 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.204.170.193 with SMTP id e1mr3419128bkz.136.1303758493165;
 Mon, 25 Apr 2011 12:08:13 -0700 (PDT)
Sender: tim.b...@binaryplex.com
Received: by 10.204.101.209 with HTTP; Mon, 25 Apr 2011 12:08:12 -0700 (PDT)
In-Reply-To: <ef8e6ca0-7652-44fa-b3a2-b880ecca742b@f11g2000vbx.googlegroups.com>
References: <5572992f-f7b8-438a-91ea-9287e0f5a46e@t19g2000prd.googlegroups.com>
	<7d30d231-b664-495f-b01f-b546df73748a@o26g2000vby.googlegroups.com>
	<BANLkTi=5uFyvYfdDogAJsWkfaB-JRqkMjw@mail.gmail.com>
	<ef8e6ca0-7652-44fa-b3a2-b880ecca742b@f11g2000vbx.googlegroups.com>
Date: Tue, 26 Apr 2011 05:08:12 +1000
Message-ID: <BANLkTikmMe8-qfA_Aot=N1oMhPqxZrAWCw@mail.gmail.com>
Subject: Re: [trunkly-dev] Re: Simple CURL API POST
From: Tim Bull <t...@trunk.ly>
To: trunkly-dev@googlegroups.com
Content-Type: multipart/alternative; boundary=bcaec52c661fdba9e604a1c2ede1

--bcaec52c661fdba9e604a1c2ede1
Content-Type: text/plain; charset=ISO-8859-1

Trunk.ly is a deliberate exclusion (although undocumented) - it all gets a
bit meta if we start indexing ourselves!

We'll check the NYTimes - that should work, unless perhaps there is some
paywall issue.  We'll let you know.

Cheers,

Tim
On Tue, Apr 26, 2011 at 4:25 AM, carride <carr...@gmail.com> wrote:

> Well my real problem had been using the API to save links to my
> account.  Now what I realize is that my code was ok, but is failing
> when trying to add certain urls. Once I picked a different URL to
> test, it work. I have checked now, and find the similar problem
> happens through your web interface. e.g. I can't create a link to
> "trunkly.com" or "nytimes.com"
>
> This fails:
> curl --data "api_key=18776-19beabf1-a000-4c47-acb1-
> dc9b250bb8a6&url=trunkly.com" http://trunkly.com/api/v1/link/
>
> This works:
> curl --data "api_key=18776-19beabf1-a000-4c47-acb1-
> dc9b250bb8a6&url=space.com" http://trunkly.com/api/v1/link/
>
> Thanks,
>
>
> On Apr 25, 1:45 pm, Tim Bull <t...@trunk.ly> wrote:
> > Awesome! Thanks for letting us know it worked out.  Sorry we couldn't get
> > back to you sooner - we're travelling at the moment.
> >
> > Cheers,
> >
> > Tim
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Apr 26, 2011 at 2:32 AM, carride <carr...@gmail.com> wrote:
> > > Sorry. I found my problem.  I was using the wrong parameter. "user="
> > > was incorrect. "username=" is the correct form.
> >
> > > It is working for me now.
> >
> > > On Apr 25, 12:15 pm, carride <carr...@gmail.com> wrote:
> > > > I want to try a simple trunkly API call with curl sending postdata. I
> > > > have been unsuccessful with what appears to be correct formatting. Is
> > > > there something I am doing wrong? I have tried to sending with and
> > > > without the encoding curl parameter
> >
> > > > curl --data-urlencode "api_key=18776-19beabf1-a000-4c47-acb1-
> > > > dc9b250bb8a6" --data-urlencode "user=alexdong"
> > >http://trunkly.com/api/v1/user/follow/
> >
> > > > --- Headers as seen in proxy logger
> >
> > > > POST /api/v1/user/follow/ HTTP/1.1
> > > > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7
> > > > OpenSSL/0.9.8l zlib/1.2.3
> > > > Host: trunkly.com
> > > > Accept: */*
> > > > Content-Length: 74
> > > > Content-Type: application/x-www-form-urlencoded
> > > > Pragma: no-cache
> > > > Cache-Control: no-cache
> >
> > >
> api_key=18776%2D19beabf1%2Da000%2D4c47%2Dacb1%2Ddc9b250bb8a6&user=alexdong
> >
> > > > ---- Response
> >
> > > > Bad RequestStrings MUST be unicode UTF-8 encodable
> >
> > --
> > Tim Bull
> > Co-founder - Trunk.ly
> > mob: +61 (0) 407 015 623
> >
> > Trunk.ly <http://trunk.ly/> - Never forget a link
> >
> > Twitter: @TimBull <http://twitter.com/timbull>
>



-- 
Tim Bull
Co-founder - Trunk.ly
mob: +61 (0) 407 015 623

Trunk.ly <http://trunk.ly/> - Never forget a link

Twitter: @TimBull <http://twitter.com/timbull>

--bcaec52c661fdba9e604a1c2ede1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Trunk.ly is a deliberate exclusion (although undocumented) - it all gets a =
bit meta if we start indexing ourselves!<div><br></div><div>We&#39;ll check=
 the NYTimes - that should work, unless perhaps there is some paywall issue=
. =A0We&#39;ll let you know.</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Tim<br><div class=3D"g=
mail_quote">On Tue, Apr 26, 2011 at 4:25 AM, carride <span dir=3D"ltr">&lt;=
<a href=3D"mailto:carr...@gmail.com">carr...@gmail.com</a>&gt;</span> wrote=
:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">Well my real problem had been using the API=
 to save links to my<br>
account. =A0Now what I realize is that my code was ok, but is failing<br>
when trying to add certain urls. Once I picked a different URL to<br>
test, it work. I have checked now, and find the similar problem<br>
happens through your web interface. e.g. I can&#39;t create a link to<br>
&quot;<a href=3D"http://trunkly.com" target=3D"_blank">trunkly.com</a>&quot=
; or &quot;<a href=3D"http://nytimes.com" target=3D"_blank">nytimes.com</a>=
&quot;<br>
<br>
This fails:<br>
curl --data &quot;api_key=3D18776-19beabf1-a000-4c47-acb1-<br>
dc9b250bb8a6&amp;url=3D<a href=3D"http://trunkly.com" target=3D"_blank">tru=
nkly.com</a>&quot; <a href=3D"http://trunkly.com/api/v1/link/" target=3D"_b=
lank">http://trunkly.com/api/v1/link/</a><br>
<br>
This works:<br>
curl --data &quot;api_key=3D18776-19beabf1-a000-4c47-acb1-<br>
dc9b250bb8a6&amp;url=3D<a href=3D"http://space.com" target=3D"_blank">space=
.com</a>&quot; <a href=3D"http://trunkly.com/api/v1/link/" target=3D"_blank=
">http://trunkly.com/api/v1/link/</a><br>
<br>
Thanks,<br>
<div class=3D"im"><br>
<br>
On Apr 25, 1:45=A0pm, Tim Bull &lt;<a href=3D"mailto:t...@trunk.ly">t...@tr=
unk.ly</a>&gt; wrote:<br>
&gt; Awesome! Thanks for letting us know it worked out. =A0Sorry we couldn&=
#39;t get<br>
&gt; back to you sooner - we&#39;re travelling at the moment.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Tim<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div><div><div></div><div class=3D"h5">&gt; On Tue, Apr 26, 2011 at 2:32 A=
M, carride &lt;<a href=3D"mailto:carr...@gmail.com">carr...@gmail.com</a>&g=
t; wrote:<br>
&gt; &gt; Sorry. I found my problem. =A0I was using the wrong parameter. &q=
uot;user=3D&quot;<br>
&gt; &gt; was incorrect. &quot;username=3D&quot; is the correct form.<br>
&gt;<br>
&gt; &gt; It is working for me now.<br>
&gt;<br>
&gt; &gt; On Apr 25, 12:15 pm, carride &lt;<a href=3D"mailto:carr...@gmail.=
com">carr...@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; I want to try a simple trunkly API call with curl sending po=
stdata. I<br>
&gt; &gt; &gt; have been unsuccessful with what appears to be correct forma=
tting. Is<br>
&gt; &gt; &gt; there something I am doing wrong? I have tried to sending wi=
th and<br>
&gt; &gt; &gt; without the encoding curl parameter<br>
&gt;<br>
&gt; &gt; &gt; curl --data-urlencode &quot;api_key=3D18776-19beabf1-a000-4c=
47-acb1-<br>
&gt; &gt; &gt; dc9b250bb8a6&quot; --data-urlencode &quot;user=3Dalexdong&qu=
ot;<br>
&gt; &gt;<a href=3D"http://trunkly.com/api/v1/user/follow/" target=3D"_blan=
k">http://trunkly.com/api/v1/user/follow/</a><br>
&gt;<br>
&gt; &gt; &gt; --- Headers as seen in proxy logger<br>
&gt;<br>
&gt; &gt; &gt; POST /api/v1/user/follow/ HTTP/1.1<br>
&gt; &gt; &gt; User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl=
/7.19.7<br>
&gt; &gt; &gt; OpenSSL/0.9.8l zlib/1.2.3<br>
&gt; &gt; &gt; Host: <a href=3D"http://trunkly.com" target=3D"_blank">trunk=
ly.com</a><br>
&gt; &gt; &gt; Accept: */*<br>
&gt; &gt; &gt; Content-Length: 74<br>
&gt; &gt; &gt; Content-Type: application/x-www-form-urlencoded<br>
&gt; &gt; &gt; Pragma: no-cache<br>
&gt; &gt; &gt; Cache-Control: no-cache<br>
&gt;<br>
&gt; &gt; api_key=3D18776%2D19beabf1%2Da000%2D4c47%2Dacb1%2Ddc9b250bb8a6&am=
p;user=3Dalexdong<br>
&gt;<br>
&gt; &gt; &gt; ---- Response<br>
&gt;<br>
&gt; &gt; &gt; Bad RequestStrings MUST be unicode UTF-8 encodable<br>
&gt;<br>
&gt; --<br>
&gt; Tim Bull<br>
&gt; Co-founder - Trunk.ly<br>
&gt; mob: +61 (0) 407 015 623<br>
&gt;<br>
</div></div>&gt; Trunk.ly &lt;<a href=3D"http://trunk.ly/" target=3D"_blank=
">http://trunk.ly/</a>&gt; - Never forget a link<br>
&gt;<br>
&gt; Twitter: @TimBull &lt;<a href=3D"http://twitter.com/timbull" target=3D=
"_blank">http://twitter.com/timbull</a>&gt;<br>
</blockquote></div><br><br clear=3D"all"><br>-- <br>Tim Bull<br>Co-founder =
- Trunk.ly<br>mob: +61 (0) 407 015 623<br><br><div><a href=3D"http://trunk.=
ly/" target=3D"_blank">Trunk.ly</a>=A0- Never forget a link<br><br><div>Twi=
tter:=A0<a href=3D"http://twitter.com/timbull" target=3D"_blank">@TimBull</=
a></div>
</div><br>
</div>

--bcaec52c661fdba9e604a1c2ede1--