Post
Topic
Board Securities
Re: [BTC-TC] Community Exchange w/ Options, DRIP, 2FA, API, CSV, etc.
by
inh
on 25/05/2013, 07:58:50 UTC
Here's the code I mentioned earlier on IRC:

http://dpaste.com/hold/1197404/


Just change the credentials at the top.  This requires python 2.7 with a couple of dependencies (you'll get errors if they aren't there, just use pip to install them)

This takes the consumer key and consumer secret and generates the other tokens.  It will ask you to visit in the browser and grab the verification string, like you have been doing, then paste it back to the app to generate your oauth client secret.  You should save those, since this authorization is only needed once and you can skip the verification steps in the future if you have these stored.

I also put in an example of using the credentials to call the get_portfolio method to return your info.

I'm actually having the exact opposite problem.  It seems like the api is treating ALL callback_url as if they are oob.  I place an url into the callback_url parameter, but it never hits my callback url.



The python code is working fine for me, so I assume it must be an issue with the oauth package i was using (http://godoc.org/github.com/garyburd/go-oauth/oauth) and not with BTC-TC.

Whew.  One less thing to worry about.  Wink  Thank you for the update!


OK so I lied  Cheesy

Looks like the problem is that the RFC states that the server should accept an HTTP POST for the token request, however it only seems to work when the token is requested using a GET.

Just to help clarify, the code gets a set of temporary credentials, then it uses those plus the verification string to request an access token for future use. I was trying to use the packages built in request-token method, which uses a POST per the standard. In order to get it to work I had to manually create the token request and send it using a GET.

Hope that makes sense  Roll Eyes