Created
July 17, 2018 21:51
-
-
Save danielma156/2412da494c689a16147c29cc90bd4a13 to your computer and use it in GitHub Desktop.
Last updated Timestamp for a Dropbox file (JS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function call() { | |
| $.ajax({ | |
| type: "POST", | |
| beforeSend: function(request) { | |
| request.setRequestHeader("Authorization", '<YOUR KEY HERE>'); | |
| request.setRequestHeader("Content-Type", "application/json"); | |
| }, | |
| url: "https://api.dropboxapi.com/2/files/get_metadata", | |
| data: '{"path":"/path/to/file"}', | |
| processData: false, | |
| success: function(msg) { | |
| var last_update = msg.client_modified; | |
| console.log(last_update); | |
| var last_update_formatted = moment(last_update).format('MMMM Do YYYY, HH:mm:ss'); | |
| console.log(last_update_formatted); | |
| document.getElementById("myText").innerHTML = last_update_formatted; | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment