You get this error when an HMAC signature has not been generated correctly.
When you generate an HMAC, server time is also included in the parameter, and you need to generate and send an HMAC at every API call.
This also means that you get an Unauthorized error when sever time is incorrect.
If you are working with .NET, go to your default “WebRequest / WebClient” and check if the encoded “~” string is not decoded by the Framework.