BTCMarkets / API

API
119 stars 30 forks source link

Server Timezone? Intermittent 'Invalid timestamp' using NTP #130

Closed codingcaveman closed 4 years ago

codingcaveman commented 6 years ago

Hi,

I'm running a trading platform using your API 24h a day, but get several failed API requests per day claiming authentication failed due to an invalid timestamp. I know my request nonce should be within 30 seconds of your server time, and my computer has its time synced via NTP from time.apple.com.

I'm in the Perth timezone (AWST). What time zone is your server running in? Looking on your website your time is currently 1h ahead of mine. Should I be adjusting my timestamps for timezone differences? I can't believe that to be the case, since that would mean that all of my current unadjusted API calls should fail if I needed to add 1h to the timestamp, but 90% of them work fine.

I'm already using an NTP server for the correct time on my computer, I'm not sure what else I could be doing to prevent this error. Any insight would be appreciated.

Thanks

martin-nginio commented 4 years ago

Hi @codingcaveman

Thanks for your message and sorry for the late reply.

I'm closing this ticket and wanted to confirm we now have a new API being released that has better error handling and also you can use /v3/time API to validate your sever timestmap. In general, you should be able to get your local timestamp in millisecond and it should work.

Please feel free to check the latest API v3 below: https://api.btcmarkets.net/doc/v3#section/Introduction

Thanks.

Regards, Martin