Bitcoin Forum
September 27, 2025, 05:38:40 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Exchanges / Re: Huobi API returns error: Invalid time format on: June 06, 2018, 08:29:04 PM
Which language are you making API requests? I'm digging deeper and looks like, Timestamp should be current request time, so you must generate timestamp on request. Have you looked at their REST API Demos? Here is url https://github.com/huobiapi/REST-API-demos

I found the problem - the time should be strictly Greenwich (UTC-0) time without any offsets.
Thank you for your help!

I sends API in PHP and C#. If you need something - I'm always ready to help.
2  Economy / Exchanges / Re: Huobi API returns error: Invalid time format on: June 06, 2018, 05:49:23 PM
I'm just making a blind guess, but I think you don't include Time zone in your Date format, you just passing current date without time zone, which they mentioned in documentation, that you need to include it.

There is js snippet to encode this string: encodeURIComponent("2018-05-04T12:10:36+UTC TIME ZONE"); or encodeURIComponent("2018-05-04T12:10:36+00:00"); which results in something like this 2018-05-04T12%3A10%3A36%2B00%3A00

Thank you. It's a good point. I tried to include my UTC zone (UTC-5) this ways:

2018-05-04T12%3A10%3A36%2B-5%3A00
and
2018-05-04T12%3A10%3A36%2B-5

and got another error - Incorrect Time Format.
But, maybe  2018-05-04T12%3A10%3A36%2B-05%3A00 will work. I'll try it.
Thanks.
I think Time zone format has a strict rules it should always be +00:00, or -03:00, you must include all four numbers.

I tried 2018-05-04T12%3A10%3A36%2B-05%3A00 but got  Incorrect Time Format. Maybe I get this error, because I have zero balances in Huobi. Sad
Wierd. Maybe you already find solution? because in google there is no answers at all.
I found a similar problem in chat here https://github.com/ccxt/ccxt/issues/1485. But it didn't help me. Do you use Houbi API sometimes?
3  Economy / Exchanges / Re: Huobi API returns error: Invalid time format on: June 05, 2018, 11:04:36 PM
I'm just making a blind guess, but I think you don't include Time zone in your Date format, you just passing current date without time zone, which they mentioned in documentation, that you need to include it.

There is js snippet to encode this string: encodeURIComponent("2018-05-04T12:10:36+UTC TIME ZONE"); or encodeURIComponent("2018-05-04T12:10:36+00:00"); which results in something like this 2018-05-04T12%3A10%3A36%2B00%3A00

Thank you. It's a good point. I tried to include my UTC zone (UTC-5) this ways:

2018-05-04T12%3A10%3A36%2B-5%3A00
and
2018-05-04T12%3A10%3A36%2B-5

and got another error - Incorrect Time Format.
But, maybe  2018-05-04T12%3A10%3A36%2B-05%3A00 will work. I'll try it.
Thanks.
I think Time zone format has a strict rules it should always be +00:00, or -03:00, you must include all four numbers.

I tried 2018-05-04T12%3A10%3A36%2B-05%3A00 but got  Incorrect Time Format. Maybe I get this error, because I have zero balances in Huobi. Sad
4  Economy / Exchanges / Re: Huobi API returns error: Invalid time format on: June 05, 2018, 05:30:42 PM
I'm just making a blind guess, but I think you don't include Time zone in your Date format, you just passing current date without time zone, which they mentioned in documentation, that you need to include it.

There is js snippet to encode this string: encodeURIComponent("2018-05-04T12:10:36+UTC TIME ZONE"); or encodeURIComponent("2018-05-04T12:10:36+00:00"); which results in something like this 2018-05-04T12%3A10%3A36%2B00%3A00

Thank you. It's a good point. I tried to include my UTC zone (UTC-5) this ways:

2018-05-04T12%3A10%3A36%2B-5%3A00
and
2018-05-04T12%3A10%3A36%2B-5

and got another error - Incorrect Time Format.
But, maybe  2018-05-04T12%3A10%3A36%2B-05%3A00 will work. I'll try it.
Thanks.
5  Economy / Exchanges / Huobi API returns error: Invalid time format on: June 05, 2018, 01:08:07 AM
Please, someone, help me to resolve my problem.
I try to retrieve my Huobi balances with API and always get error: "Signature not valid: Invalid time format".
Everything is done according to their help documents.

1) I create a signature using SHA256 generator with my secret key and text like this:

GET\n
api.huobi.pro\n
/v1/account/accounts/xxxxx.com/balance\n
AccessKeyId=e2xxxxxx-99xxxxxx-84xxxxxx-7xxxx&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2018-06-04T15%3A19%3A30

2) Enter this URL to my browser:

https://api.huobi.pro/v1/account/accounts/xxxxx.com/balance?AccessKeyId=e2xxxxxx-99xxxxxx-84xxxxxx-7xxxx&order-id=1234567890&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2018-06-04T15%3A19%3A30&Signature=4F65x5jkbLyMWVQj3Aqp%2BB4w%2BivaAty5Oi2SuYtCJ9o%3D

The result is  {"status":"error","err-code":"api-signature-not-valid","err-msg":"Signature not valid: 无效的提交时间","data":null}

无效的提交时间 is  Invalid time format.

May be someone have experience with this stuff. Thank you in advance.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!