Box API Troubleshooting / Common Issues

1 post / 0 new
Posted: 7 March 2017 - 8:52am
Box API Troubleshooting / Common Issues

Response [401] - Authentication Required

A 401 Unauthorized is usually due to an API call with an invalid / incorrect HMAC header. Notes about the header:

  1. Make sure the hash algorithm you are using is either SHA-1 or SHA-256. The 'x-hp-hmac-algorithm' header is optional and defaults to SHA-1 but if you use SHA-256, it will need to be specified.
  2. Make sure the timestamp format follows the ISO 8601 format UTC time. Make sure the time follows the 24 hour cycle and not the 12 hour cycle.
  3. The String to encode for part of the 'x-hp-hmac-authentication' header has a space between the HTTP method and API path / endpoint.
  4. Verify the Key / Secret is correct.

Error Message: Unable to identify proxy for host: PrintOSSecure and url

  1. This is most likely caused by trying to upload a file into the amazon upload url while including the base url of either production or staging server. Since the url belongs to amazon, you only need to use a PUT or POST to just the amazon upload url without needing to include the printos base urls.