cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in Auditlog API with start date parameter

Highlighted

Error in Auditlog API with start date parameter

Explorer | Level 4

Hello,

I am facing issue while verifying Curl Dropbox API in json for audit logs by specifying start time and end time, Kindly help me to solve this issue

curl -X POST https://api.dropboxapi.com/2/team_log/get_events --header "Authorization: Bearer ABC" --header "Content-Type: application/json" --data "{\"limit\": 50,\"start_date\": 2019-08-25T15:51:30Z,\"end_date\": \"2019-08-30T15:51:30Z\"}"

ERROR: Error in call to API function "team_log/get_events": request body: could not decode input as JSON

1 Accepted Solution

Accepted Solutions
Highlighted

Re: Error in Auditlog API with start date parameter

Super Collaborator | Level 20

Hi @umor,

Can you clarify, why you expect that parameters "start_date" and "end_date" are available? As far as I can see in documentation only available are "limit", "account_id", "time" and "category".

If you want to use "start_date" and "end_date", have to 'catch' them in "time" parameter. (format="%Y-%m-%dT%H:%M:%SZ")

Hope this helps.

View solution in original post

5 Replies 5
Highlighted

Re: Error in Auditlog API with start date parameter

Super Collaborator | Level 20

Hi @umor,

The "start_date"'s value isn't quoted!

Hope this helps.

PS: To avoid such errors in future (and easy find out the reason) use some local tool for check (like json_pp for example). Usually much more error details are available in such a way.

Highlighted

Re: Error in Auditlog API with start date parameter

Explorer | Level 4

Hello,

Thanks for your response,

I try this CURL command with the correct syntax but still giving an error "Error in call to API function "team_log/get_events": request body: unknown field 'start_date'"

curl -X POST https://api.dropboxapi.com/2/team_log/get_events --header "Authorization: Bearer ABC" --header "Content-Type: application/json" --data "{\"limit\": 50,\"start_date\": 1564617600,\"end_date\": 1567295999}"

Highlighted

Re: Error in Auditlog API with start date parameter

Super Collaborator | Level 20

Hi @umor,

Can you clarify, why you expect that parameters "start_date" and "end_date" are available? As far as I can see in documentation only available are "limit", "account_id", "time" and "category".

If you want to use "start_date" and "end_date", have to 'catch' them in "time" parameter. (format="%Y-%m-%dT%H:%M:%SZ")

Hope this helps.

View solution in original post

Highlighted

Re: Error in Auditlog API with start date parameter

Dropboxer

@umor Здравко is correct, your datetime strings need to be quoted, and nested inside the "time" parameter, per the documentation

I recommend using the API v2 Explorer to help prototype these calls. It can build the code for you. (Click "Show Code".)

In your actual app's code, we recommend using a JSON library to build the JSON for you, as that will be much less error-prone than attempting to write it by hand.

Highlighted

Re: Error in Auditlog API with start date parameter

Explorer | Level 4

Thanks for your kind response, My problem has been solved. According to document start_date and end_date was nested in time parameters and my format was also wrong in epouch format. Really appreacite your support Sir

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?