API 2.0 Basic Help

15 views
Skip to first unread message

Dozza

unread,
Nov 14, 2010, 9:00:38 PM11/14/10
to Posterous development
Hi guys,

I need some help in understanding how this API thing works. I have to
first make a call to get a token for a particular user (let's say i
have a client that wants to log in). Now, using http post and get, how
do i get this token? And does this return the result as a JSON or
http ?value=pair or does the user have to log in using a browser?

I am testing using an HTTP client.

Thanks!

twoism

unread,
Nov 17, 2010, 2:36:54 PM11/17/10
to Posterous development
> I need some help in understanding how this API thing works. I have to
> first make a call to get a token for a particular user (let's say i
> have a client that wants to log in).

The token is to identify YOU the developer. You only need to get this
token once. You do not need the your clients token to make a request.

> Now, using http post and get, how
> do i get this token?

Using Basic Auth with YOUR credentials make a GET request to /api/2/
auth/token.

> And does this return the result as a JSON or
> http ?value=pair  or does the user have to log in using a browser?

JSON

All of this information can be found in the Overview documentation at
http://apidocs.posterous.com.

Alex Popescu

unread,
Dec 11, 2010, 8:29:53 AM12/11/10
to Posterous development
On Nov 17, 9:36 pm, twoism <signalsta...@gmail.com> wrote:
> > I need some help in understanding how this API thing works. I have to
> > first make a call to get a token for a particular user (let's say i
> > have a client that wants to log in).
>
> The token is to identify YOU the developer. You only need to get this
> token once. You do not need the your clients token to make a request.
>

Actually, as I've reported a couple of days ago (though a feedback
email with multiple points, some of them related to the docs that I'm
seeing you've already fixed), I think there are scenarios that require
refreshing the token. At least that's what I've noticed last week when
building my app. Currently just to make sure I'm not hitting that
issue I'm always fetching the token before any other API calls.

Going back to my email, it would be absolutely great if the docs for
each API method would be clear:

- if they require the posterous' user credentials
- if they require the developer's api_token

:- alex

> > Now, using http post and get, how
> > do i get this token?
>
> Using Basic Auth with YOUR credentials make a GET request to /api/2/
> auth/token.
>
> > And does this return the result as a JSON or
> > http ?value=pair  or does the user have to log in using a browser?
>
> JSON
>
> All of this information can be found in the Overview documentation athttp://apidocs.posterous.com.
Reply all
Reply to author
Forward
0 new messages