cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

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: 

Javascript Timestamp Format

Javascript Timestamp Format

cascadeCommons
Explorer | Level 4
Go to solution

Hello everyone.

 

I'm using the Javascript SDK to create File Requests via the API. Everything was working fine, but I recently upgraded to a Dropbox Professional account and tried to add the "deadline" field. The documentation on GitHub merely says to provide a "Timestamp" but  doesn't explain what format this timestamp should be in. I was wondering if there could be any clarification on this.

Thanks!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

I see you also sent this in to support, so I'm copying the answer that we sent you there here in case anyone else has the same question:

 


The fileRequestsCreate method takes a FileRequestsCreateFileRequestArgs object, where FileRequestsCreateFileRequestArgs.deadline should be a FileRequestsFileRequestDeadline, where FileRequestsFileRequestDeadline.deadline should be a timestamp string with this format:

%Y-%m-%dT%H:%M:%SZ

Apologies that isn't specifically shown in the JavaScript SDK documentation. I'll ask the team to improve that. For reference though, you can find the documentation for the HTTPS endpoints themselves here, such as for /2/file_requests/create, which is what fileRequestsCreate uses, showing the specific expected string formats.

So, the code should look like this:

var deadline = {"deadline": "2020-10-31T12:34:56Z"};

dbx.fileRequestsCreate({title: theTitle, destination: dbxDestination, deadline: deadline, open: true})

 

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

I see you also sent this in to support, so I'm copying the answer that we sent you there here in case anyone else has the same question:

 


The fileRequestsCreate method takes a FileRequestsCreateFileRequestArgs object, where FileRequestsCreateFileRequestArgs.deadline should be a FileRequestsFileRequestDeadline, where FileRequestsFileRequestDeadline.deadline should be a timestamp string with this format:

%Y-%m-%dT%H:%M:%SZ

Apologies that isn't specifically shown in the JavaScript SDK documentation. I'll ask the team to improve that. For reference though, you can find the documentation for the HTTPS endpoints themselves here, such as for /2/file_requests/create, which is what fileRequestsCreate uses, showing the specific expected string formats.

So, the code should look like this:

var deadline = {"deadline": "2020-10-31T12:34:56Z"};

dbx.fileRequestsCreate({title: theTitle, destination: dbxDestination, deadline: deadline, open: true})

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?