toggl / toggl_api_docs

Documentation for the Toggl API
1.39k stars 235 forks source link

Error calling Toggl report API #305

Closed jeevacodepro closed 6 years ago

jeevacodepro commented 6 years ago

I have been trying to use the Toggl's report API and hit with a problem. Calling a weekly report endpoint by passing the required headers. One of the header is "user_agent", even though this header is added to the request and sent, I keep getting an error "Required parameter 'user_agent' is missing from request. You should specify the name of your application or your email address so we can get in touch with you in case you're doing something wrong." Any idea why this is happening. I have tried the same from postman but result is the same.

Curl output below

Note: Unnecessary use of -X or --request, GET is already inferred.

webervin commented 6 years ago

Your request is indeed missing value for user_agent, as is written in response. It is not header, and should be specified as GET query parameter: ?user_agent=way_to_contact@developer-of-api.client, blank value is not accepted. workspace_id is also obligatory. and probably you want to specify value for since for weekly report as well.

See https://github.com/toggl/toggl_api_docs/blob/master/reports.md#request-parameters for more information.