Pages:
Author

Topic: Bter API problem (Read 3627 times)

newbie
Activity: 1
Merit: 0
April 18, 2014, 07:02:28 PM
#30
I am having a strange behavior too.

It seems that bter modifies the orders before creating them, if we use the API.


I used the python API provided here (https://github.com/hsharrison/bter-api) to create a "buy" order:
Price: 0.02499999 BTC per LTC

I received the confirmation from the server, with the correct price.

But on the webpage I see my order with this price: 0.02531011

Does Bter take an extra fee if we use the API, or is it buggy ?
full member
Activity: 145
Merit: 100
April 16, 2014, 04:27:59 PM
#29
I observe some very strange behaviour: my balance (as reported by getFunds call) jumps from one (correct) value to another (incorrect) value approximately once per minute, although no trading activity is in place:

2014-04-03 11:02:04 bter:    0.06835592btc, 26.44739516vtc
2014-04-03 11:02:20 bter:    0.11959352btc, 4.45710196vtc
2014-04-03 11:02:22 bter:    0.06835592btc, 26.44739516vtc
2014-04-03 11:03:40 bter:    0.11959352btc, 4.45710196vtc
2014-04-03 11:03:42 bter:    0.06835592btc, 26.44739516vtc
and so on.

Nothing suspicious in other parts of json (result is always true, etc).

I contacted support with detailed logs and json files, but their response is not encouraging as yet ("we'll look into it in later").

Has anyone run into the issue? Can anyone reproduce? Any ideas of a workaround?


I have this same problem, now, too.  It's been working fine for a week, but now I get what seems to be a cached funds list from like yesterday or something.  It happens about every 2 or 3 minutes with me.  Did you figure out the problem?  Any help would be appreciated.
member
Activity: 80
Merit: 10
April 03, 2014, 12:25:51 AM
#28
I observe some very strange behaviour: my balance (as reported by getFunds call) jumps from one (correct) value to another (incorrect) value approximately once per minute, although no trading activity is in place:

2014-04-03 11:02:04 bter:    0.06835592btc, 26.44739516vtc
2014-04-03 11:02:20 bter:    0.11959352btc, 4.45710196vtc
2014-04-03 11:02:22 bter:    0.06835592btc, 26.44739516vtc
2014-04-03 11:03:40 bter:    0.11959352btc, 4.45710196vtc
2014-04-03 11:03:42 bter:    0.06835592btc, 26.44739516vtc
and so on.

Nothing suspicious in other parts of json (result is always true, etc).

I contacted support with detailed logs and json files, but their response is not encouraging as yet ("we'll look into it in later").

Has anyone run into the issue? Can anyone reproduce? Any ideas of a workaround?
sr. member
Activity: 393
Merit: 250
March 28, 2014, 12:35:14 PM
#27
Bter API "documentation":
Notice: The returned order_id is meaningless, please use this API https://bter.com/api/1/private/orderlist to obtain all your open order IDs

perhaps your order has already been filled?

No. Balance stay the same
full member
Activity: 149
Merit: 102
March 28, 2014, 09:52:16 AM
#26
Bter API "documentation":
Notice: The returned order_id is meaningless, please use this API https://bter.com/api/1/private/orderlist to obtain all your open order IDs

perhaps your order has already been filled?
sr. member
Activity: 393
Merit: 250
March 28, 2014, 06:04:07 AM
#25
Hi guys! I keep getting this message after using my code and bter API to place order:

{"result":true,"msg":"Success","order_id":12332706}

Then I using this link ('https://bter.com/api/1/private/orderlist') for check my orders and got this one:

{"result":true,"orders":[],"msg":"Success"}

And there is no open order at my account though. (I was checking through the site)

Has someone faced with the same problem? Thanks in advance!
hero member
Activity: 905
Merit: 1001
February 28, 2014, 05:34:32 PM
#24
bter API is just very unstable. i dont know what they are doing all the time Cheesy
full member
Activity: 169
Merit: 100
February 28, 2014, 04:24:10 PM
#23
{"result":"false","message":"Error: invalid data"}  This is the above return result.

Repeat request. Send query over and over while you get good result.
newbie
Activity: 58
Merit: 0
February 27, 2014, 10:47:22 AM
#22
I have wasted days on this API.

Sitting trying to work out the issues. Using the PHP example is okay but using JavaScript from node just does not work.

Glad I found this forum post as I thought I was going mad. I have tried every method over the past 3 days to get private responses but just get {"result":"false","message":"Error: invalid key or sign"} (no matter what is signed here using Crypto just doesn't resolve) and {"result":"false","message":"Error: invalid data"}

Even looking http://www.cryptocoincharts.info/v2/tools/bter_balances where they have a private JS fund checker, this does not work and responds 500 Internal Server Error

All my API calls for tickers work fine but private key calls just don't. Damn you BTER i'll never get that time back.
newbie
Activity: 21
Merit: 0
February 20, 2014, 02:43:24 AM
#21
Too much problem when use bter api
newbie
Activity: 6
Merit: 0
February 20, 2014, 01:24:07 AM
#20
{"result":"false","message":"Error: invalid data"}  This is the above return result.
newbie
Activity: 6
Merit: 0
February 20, 2014, 01:14:56 AM
#19
private static String generateHMAC(String datas) {

      // final Charset asciiCs = Charset.forName( "utf-8" );
      Mac mac;
      String result = "";
      try {

         SecretKeySpec secretKey;

         try {
            secretKey = new SecretKeySpec(
                  (new BASE64Decoder()).decodeBuffer("**************************************"),
                  "HmacSHA512");
            mac = Mac.getInstance("HmacSHA512");
            mac.init(secretKey);
            final byte[] macData = mac.doFinal(datas.getBytes());
            result = (new BASE64Encoder()).encode(macData);
            
         } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }

         

      } catch (final NoSuchAlgorithmException e) {

      } catch (final InvalidKeyException e) {

      }
      return result;

   }
newbie
Activity: 6
Merit: 0
February 20, 2014, 01:07:09 AM
#18
I have signed the post data.
URL getUrl = new URL("https://bter.com/api/1/private/orderlist");
      HttpURLConnection aConnection = (HttpURLConnection) getUrl
            .openConnection();
      Map data = new HashMap();
      // data.put("dad", "fff");
      // data.put("order_id", "fff");
      data.put("nonce", String.valueOf(System.currentTimeMillis()));
      String postdata = httpBuildQuery(data);
      String sign = generateHMAC(postdata);
      aConnection.setRequestMethod("POST");
      //aConnection.setDoOutput(true);
      aConnection.setRequestProperty("Key",
            "*************");
      aConnection.setRequestProperty("Sign", sign.replaceAll("\n", ""));
      
      aConnection.connect();
      BufferedReader reader = new BufferedReader(new InputStreamReader(
            aConnection.getInputStream(), "utf-8"));

I dont know what is wrong.
   private static String httpBuildQuery(Map data)
         throws UnsupportedEncodingException {
         String result = new String();
           for (String hashkey : data.keySet()) {
               if (result.length() > 0) result += '&';
               try {
                   result += URLEncoder.encode(hashkey, "UTF-8") + "="
                           + URLEncoder.encode(data.get(hashkey), "UTF-8");
               } catch (Exception ex) {
                   // Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
               }
           }
           return result;
   }
full member
Activity: 169
Merit: 100
February 19, 2014, 04:36:37 PM
#17
I use java to access the Restful bter api, the public info can be reached. Once tried private api, it returns "..".
I dont know what is wrong. Maybe sign and key are not matched.
Could u give me a privelege authentication example written in java? Thanks!

You must sign the post data. ( see php example code of bter api documentation )
PHP example code work good. Try it your sign keys.

php:
$sign = hash_hmac('sha512', $post_data, $secret);

java:
            byte[] bytesKey = ....
            final SecretKeySpec secretKey = new SecretKeySpec( bytesKey, "HmacSHA512" );
            mac = Mac.getInstance( "HmacSHA512" );
            mac.init( secretKey );
            final byte[] macData = mac.doFinal( datas.getBytes( ) );
            byte[] hex = new Hex( ).encode( macData );
            result = new String( hex, "ISO-8859-1" );
newbie
Activity: 6
Merit: 0
February 16, 2014, 10:10:22 PM
#16
I use java to access the Restful bter api, the public info can be reached. Once tried private api, it returns "..".
I dont know what is wrong. Maybe sign and key are not matched.
Could u give me a privelege authentication example written in java? Thanks!
full member
Activity: 169
Merit: 100
February 06, 2014, 10:39:38 AM
#15
I found a few other problems with the Bter API today

1) in the json result, a result of true is as expected ("result":true), but false results have quotes around the "false", making the json_decode treat it as a string ("response":"false").  This makes for undesired behavior, as the string "false" can evaluate as true.

2) The order_id returned by  https://bter.com/api/1/private/placeorder is incorrect.  I just tried this a few times today, and the order_id returned is not even close to the actual order ID which gets assigned (off by over 7,000,000).

I have emailed Bter support about it, but of course I don't expect a response from such a shoddy operation.

Bter API "documentation":
Notice: The returned order_id is meaningless, please use this API https://bter.com/api/1/private/orderlist to obtain all your open order IDs
full member
Activity: 238
Merit: 100
February 02, 2014, 02:19:04 PM
#14
I found a few other problems with the Bter API today

1) in the json result, a result of true is as expected ("result":true), but false results have quotes around the "false", making the json_decode treat it as a string ("response":"false").  This makes for undesired behavior, as the string "false" can evaluate as true.

2) The order_id returned by  https://bter.com/api/1/private/placeorder is incorrect.  I just tried this a few times today, and the order_id returned is not even close to the actual order ID which gets assigned (off by over 7,000,000).

I have emailed Bter support about it, but of course I don't expect a response from such a shoddy operation.
full member
Activity: 169
Merit: 100
January 29, 2014, 05:31:11 AM
#13
wow... incomprehensible! Cheesy
it's working for me too... with the same code Smiley

but one question:
i will place a doge_btc order with a rate of "0.00000268" ... webrequest is okay, but in my account i see only 6 decimal places: "0.000003"?

don't know what to do :/

Always rounded values ​​displayed on the website, but the calculations use the floated value.
newbie
Activity: 28
Merit: 0
January 28, 2014, 03:00:40 PM
#12
wow... incomprehensible! Cheesy
it's working for me too... with the same code Smiley

but one question:
i will place a doge_btc order with a rate of "0.00000268" ... webrequest is okay, but in my account i see only 6 decimal places: "0.000003"?

don't know what to do :/
full member
Activity: 169
Merit: 100
January 24, 2014, 08:47:13 AM
#11
Bter fixed problem. All API ( private too ) queries work again successfully. Now good everything.  I hope will work for a long time.
Pages:
Jump to: