HTTP Basic Authentication
HTTP Basic authentication is the simplest way of interacting with the Harvest API. Requests require a username and password. HTTPS is required for accessing the API.
Making A Request
Here’s an example of interacting with Harvest via XML. To make requests in XML, specify
application/xml for your
Accept headers. A simple example with curl:
curl -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u "firstname.lastname@example.org:password" https://example.harvestapp.com/account/who_am_i
Successful requests return HTTP response codes in the 2xx range (e.g. 200, 201, etc.). Other response codes indicate a failed request or missing resource, in which case an error message may be returned.
Request headers need to be set up with the following:
- Accept: application/xml
- Content-Type: application/xml
- Authorization: Basic (insert your authentication string here)
Your authentication string is a base64 encoded version of your credentials. You can generate this in Ruby:
Chrome Users: Please use the Postman REST Client to test requests.
Firefox Users: Please use the RestClient plugin to test requests.