I receive 401 errors when running the sample code. Looks like the solution is to ensure that the request date within the X-Avangate-Authentication header is in UTC.
Per the documentation the REQUEST_DATE_TIME which is included in the X-Avangate-Authentication header needs to be in UTC.
The AvangateRestClient is constructing the login date using the following statement which is not in UTC time.
Time.now.strftime("%F %T")
This line should be changed to this
Time.now.utc.strftime('%F %T')