Pages:
Author

Topic: Bitcoin-Central.net API technical support thread - page 2. (Read 4999 times)

legendary
Activity: 1372
Merit: 1007
1davout
Is a token-based authentication (like OAuth) planned for the near future ?
Yes, that's on the TODO, still hesitating between OAuth 1 and 2.

Also could you explain what is the point of regestering iOS/Android devices ? Currently what is pushed to the devices ?
We use these calls to register devices to push notifications using APN/C2DM to our Paytunia apps on Android/iOS.
These calls are documented because the people developing the mobile apps needed a clear reference, regular developers shouldn't really use them, consider them undocumented Smiley
newbie
Activity: 35
Merit: 0
Is a token-based authentication (like OAuth) planned for the near future ?

Also could you explain what is the point of regestering iOS/Android devices ? Currently what is pushed to the devices ?

Thank you
legendary
Activity: 1372
Merit: 1007
1davout
Am I doing it wrong?
Yup, look at the very last API call description.

Found a minor data screwup at bitcoincharts. I would normally tell tcatm, but he's not on.

bitcoincharts says you started trading 2000-01-02 00:00:00 Smiley

946771200,9.000000000000,10.000000000000
946771200,75.000000000000,0.792600000000
1294311545,0.249900000000,15.000000000000
1294317813,0.254990000000,50.000000000000

Weird
donator
Activity: 2772
Merit: 1019
Found a minor data screwup at bitcoincharts. I would normally tell tcatm, but he's not on.

bitcoincharts says you started trading 2000-01-02 00:00:00 Smiley

946771200,9.000000000000,10.000000000000
946771200,75.000000000000,0.792600000000
1294311545,0.249900000000,15.000000000000
1294317813,0.254990000000,50.000000000000
donator
Activity: 2772
Merit: 1019
Do you plan to offer historical trade data calls or interface with bitcoincharts?
None of these are on our TODO.

However, if you actually have a look for yourself and go visit our page on Bitcoin charts or have a look at the trading section in our full API docs you'll find that it's ok since we already offer both of these features.  Kiss

lol. I'm guilty. But not of negligence, but of incompetence:

I tried both your suggestions before posting, but did it wrong at least in case of bitcoincharts:

went to http://bitcoincharts.com/markets/, hit Ctrl-F, entered "central" -> no luck. Point taken, should've looked harder.

It doesn't seem to me you offer any API call to get all trades (not just mine), though.

This is what I did: I went to https://bitcoin-central.net/s/api, Ctrl-F, enter "trades". Find API call to "List your trades". Well, that's now what I want, so I look at list of "API Methods" manually -> no luck in finding a method to get all trades (not just mine).

Am I doing it wrong?

legendary
Activity: 1372
Merit: 1007
1davout
Do you plan to offer historical trade data calls or interface with bitcoincharts?
None of these are on our TODO.

However, if you actually have a look for yourself and go visit our page on Bitcoin charts or have a look at the trading section in our full API docs you'll find that it's ok since we already offer both of these features.  Kiss
donator
Activity: 2772
Merit: 1019
Do you plan to offer historical trade data calls or interface with bitcoincharts?
legendary
Activity: 1372
Merit: 1007
1davout

TL;DR; -- The documentation is here : https://github.com/Paymium/Paytunia-API-v1-documentation

I got a bunch of interesting questions from someone wanting to consume the Bitcoin-Central.net/Paytunia.com API and thought that it might be useful to share it publicly.

If you happen to have questions on the API feel free to ask or comment here.

Paytunia and Bitcoin-Central are basically two different front-ends to the same application, they are served by the same code and they sit on the same database. The main difference is the UI. Also some API calls, and especially these related to trading are only available when using Bitcoin-Central based URIs.

It may seem kind of crazy from an external point of view, but there is a good reason it was set this way. The reason is simply that we tried to get a Paytunia iPhone app approved a while ago, and in order to get it approved we felt that we should not mention any trading at all on the app or on the Paytunia website whatsoever.

That's why Paytunia pretty much only has the wallet functionality of Bitcoin-Central.

In short : use https://bitcoin-central.net as base for *all* your API calls.

If you wish to have French localized human strings use https://fr.bitcoin-central.net, (you could also use https://en.bitcoin-central.net but English being the default it doesn't really make sense).

Quote
I am currently trying to add your platform to my program, but I find it difficult to read you API instructions. It is said that I should use the API of paytunia.com and there are path for the specific requests given. I assume one path could be https://paytunia.com/order_book. But when I enter that address into my browser, I don't get a JSON object.
What you experience on the order book is perfectly normal, with a RESTful API you request a resource, and if you do not tell the server which format should be used for the response it will default to HTML. If you want the resource returned in JSON you must tell the server. To do so you have two different options : either you add a .json extenstion at the end of the URL (when using a browser for example), or you add a HTTP header "Accept: application/json". That's explained in the "Required HTTP headers" part of the documentation.

Quote
I want to add your trading platform to my bot. It is said, that I have to give account id and password as parameters for authentication, but the names of that parameters are not given.
Regarding the authentication of calls there are no specific fields you must pass in the body of your request, in fact the authentication mechanism is standard HTTP Basic authentication (see : http://en.wikipedia.org/wiki/Basic_access_authentication). The credentials are passed in a header. Any decent HTTP access library will have this functionality already built-in. Check your library if any, otherwise just add the header as described on the wikipedia page. For example if you use cURL just pass a -u 'user:password' option to the command.

Quote
When I want to delete an order, I have to put the order ID into the URL. When I want to place an order, I have to send a JSON string. Why, why don't you just use ONE thing: parameters, URLs OR json strings. And if you ask me: sending JSON strings is the worst of the three, I think there is a reason why no other trading platform uses this.
Our API is RESTful, meaning it's based on resource URIs and HTTP verbs. For example with a trade order, if you issue a GET request against the order URI you'll be given the order representation, either in HTML or in JSON, depending on what you request, you may also issue DELETE requests against the same URI to cancel it. If you want to place an order you can just POST to the URI of the order collection (/account/trade_orders IIRC) in order to add an order to the collection. It's just the REST paradigm. Lots of APIs work this way. Regarding the fact that you have to submit a JSON string, you can also pass parameters in the URL in the following way : POST /account/trade_orders?trade_order[amount]=30&trade_order[currency]=EUR&... or as posted form data, it doesn't really matter, it'll get parsed the same way. Have a look here for more information on RESTful web services : http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_services

Quote
It is said that a successfull call returns HTTP 200 or 201, but it is not said which is returned when!?
Whenever a resource gets created (you post a trade order, you create a money transfer etc.) you'll get 201. For all other successful responses you'll get a 200.

Quote
I am trying https://paytunia.com/ticker?currency=LRUSD to see if that is a suitable URL for getting answers. I am getting HTTP 500
Yeah, that's a mistake in the documentation you should query /ticker.json (with the optional currency parameter). You're getting an error because you're implictly requesting HTML but there is no specific HTML representation of the ticker. (we'll fix that in the documentation)

Quote
Inside the JSON string there is "ppc". Does that mean price per coin? Why don't you define such names?
Yes, we should define them better. But I guess with the example it's pretty transparent, isn't it ?

Quote
There is the possibility to give an order type, in the example it is limit order. What other types are there and how do they work?
You can also post market orders. Market orders are like limit orders except they don't have a limit price and will execute at any available market price. Have a look on the trade order creation form, you'll find a link to an in-depth explanation.

Quote
Coincidally I saw that there is the possibilty to activate an order, that was placed with unsufficent funds. If there is this feature, why is there no explanation how it works?
That's because I want to remove this feature and simplify the logic around trade order execution. Right now, the way it works is that you can not place an order if you don't have enough funds (BTC or currency) to honor it fully, if you place your order and then withdraw currency or BTC leading to a state where you're unable to honor the order completely it gets inactivated. If you then add funds the order remains inactive, if it wasn't so, users could come to a point where they have old outstanding orders that suddenly execute when they add funds, at prices that aren't in line with the moving price of Bitcoins.

Quote
Can I place an order and have it removed instantly when I do not have enough funds?
No, currently if you do not have enough funds, the system will not let you place an order.

This logic should be changed because it is not very intuitive and straightforward.
Pages:
Jump to: