Set client_mtime metadata via dropbox API - dropbox

I'd like to be able to set the client_mtime in the dropbox file metadata. In the dropbox api docs it states
client_mtime For files, this is the modification time set by the
desktop client when the file was added to Dropbox, in the standard
date format. Since this time is not verified (the Dropbox server
stores whatever the desktop client sends up), this should only be used
for display purposes (such as sorting) and not, for example, to
determine if a file has changed or no
I'd like to be able to set this via the API. It clearly is possible to set because the desktop client does it but I can't find a documented way.
Is there a way to set this?

Replying to my own question a couple of years later...
The Dropbox v2 API does allow you to set client_modified when you upload a file now.
You don't appear to be able to change it without uploading the file again though.

[This answer is out of date. The Dropbox API v2 supports setting the modified time.]
This can't be explicitly set via the API, though it does get updated to the current time when you upload a file via the API.

Related

Is there a OneDrive REST API call to get file revisions metadata - by who and when?

I know that OneDrive does not support file versions, but I have read that Sharepoint does support file versions.
But Sharepoint is not OneDrive. I was unable to find API calls to see who made changes to files, but I can see in the OneDrive web front end there is a way to see the revision data (different times the file was modified and by who). Is there an API call to retrieve this data (by who and when the file was modified and not the different versions of the file)? I was unable to find an api call in the documentation.
Note: I am not looking to get different versions of the file, just the modification history of the file. Thanks.
I think what you are looking for is the versions api. You can call this api as follows:
https://tenant-my.sharepoint.com/_api/v2.0/drive/root:/test.docx:/versions
This will return the metadata associated with the file versions. It does have lastModifiedDateTime, but is missing lastModifiedBy property. If I find some documentation for the api, I will update my answer with it. In the meantime, feel free to reach me in case you have more questions.

Can I use Autodesk viewing API to render local DWG (2D) files to my browser?

The main goal of my project is to read Autocad(DWG) drawings from my local server to output them in a web browser (Chrome).
I managed to do it with the View and Data API in JAVA from Autocad with buckets, Key, etc. but when it comes to read offline files with this sample code from https://github.com/Developer-Autodesk/view-and-data-offline-sample, the DWG format did not work.
Do you have suggestion or have a clue to use the offline API with DWG files?
The Autodesk View & Data API (developer.autodesk.com) allows you to display a DWG on your website using a zero-client (WebGL) viewer. You need to upload the DWG to the Autodesk server, translate it, and either then download the translation to store on your local server (as demonstrated on extract.autodesk.io) or keep it on the Autodesk server. You might consider downloading it to be advantageous because then you don't need to implement the OAuth code on your server.
Buckets on the Autodesk server can only be accessed using the accesstoken created from your API keys, so it is secure in that only someone with your accesstoken and who knows the URN can access your translated file. However, for the viewer on your client-page to access the file, you need to provide it with your accesstoken. This does mean that someone could separately access your translated file by grabbing the accesstoken and URN from your webpage. But if you're serving up the model on a public page, then you presumably don't care about that.
There is a 'list' API available, but this is white-listed (available on request), so getting your accesstoken and urn for one file doesn't automatically give access to your other files - unless someone can guess the other filenames (or iterate to find them).
If you use a non-permanent bucket, then your original (untranslated file) becomes unavailable when the bucket expires, or you can explicitly delete the untranslated file (using the delete API).
Files translated via the View & Data API are not accessible via A360. They are stored in a separate area. (But I wouldn't be at all surprised if an A360 file access API became available in the near future :-).
Finally, unless you want to interact with the displayed file via the viewer's JavaScript API, you may prefer just to upload your files to A360, share the translated model, and then iframe embed them in your webpage.

Using Dropbox API for (subscription) content delivery

I run a multi-gigabyte audio content subscription service. Right now all of our clients get download links via email for all of the content.
I had an idea of employing the Dropbox API after a "successful charge" webhook and giving (read-only) access to a shared Dropbox folder with all of the content. That way, the customer would stay in sync with all updates, changes etc...
The way I picture it, the user checks out and is immediately asked if he would like to add our company's folder to his/her Dropbox.
Does this seem feasible/practical?
Looking at the API, I only see an option to provide a download link but not an actual shared folder. Am I correct in this observation?
That's correct, the Dropbox API doesn't currently offer any API calls for managing shared folders. It only has a way to get the read-only share links like you mentioned.
However, if you'd be interested in potentially participating in a shared folder API beta in the future, please sign up here.
#Greg's answer is correct, but I thought I'd mention a couple other options:
You could use the Saver to let users save the files directly into their Dropbox. This wouldn't help you to push new content to them—they'd still have to visit your site to save the new files—but it would let you cut down on your bandwidth costs, since Dropbox would cache the files for you.
You could use a combination of /copy_ref and /fileops/copy to copy the contents from a central Dropbox account into each user's Dropbox. This wouldn't use any of your bandwidth (once the file was in the central Dropbox account).
Please note, however, that free Dropbox accounts only start with 2GB of storage space. Since you mentioned "multi-gigabyte," you'll need to keep in mind whether your customers will actually have sufficient Dropbox space to store the files you want to share with them. (Even if you were able to use a shared folder, they would need to have enough space left to accept the shared folder invitation.)

Dropbox web hook on file added?

My application currently utilises an integration with the Dropbox API. The purpose of which is to allow clients to put certain documents into a dedicated folder in the Apps/My_App_Name/ directory, my application then periodically polls the folder to see if anything has been added and if a document is found it will automatically move it into the client's document management area within my application.
At the moment there are approx 300 users (and counting) who have their Dropbox accounts synced with me in this way. I believe I am doing something very inefficient here, but essentially my application polls all 300 accounts to see if a file has been added. This happens every 10 minutes but I'm having to widen this interval as more accounts are added to prevent an overlap. Each time I poll all accounts, usually I'd find only 1 or 2 out of those 300 who have new documents.
My question therefore is.. Is there a method within the Dropbox API to post a Web Hook or notification of some sort only when a client adds a file to that Dropbox folder? This could then trigger my application to poll only that account and save a whole load of resources on my side.
Additional Information:
Platform: ASP.NET C#
Wrapper: SharpBox
I contacted Dropbox and they have confirm that currently (15th March 2013) they do not have a web-hook or notification system for when users upload files. They did however indicate that this is something they are looking to add in the future.
UPDATE 19th February 2014
Great News! Dropbox recently announced WebHooks:
If you're interested in helping us out, just click through to fill out
your information, and we'll be in touch:
https://dropboxapi.wufoo.com/forms/dropbox-webhooks-api-beta-feedback-contact-info
Happy Dropboxing!
Dropbox now offers webhooks so that you can get notifies when a file is added
https://www.dropbox.com/developers/blog/90/announcing-dropbox-webhooks

How do you store data remotely in an iOS app?

I have an app that relies on some key value pairs where the value could change at a point in the future due to 3rd party api. The app is only useful when connected to the internet by the way. If any values change I don't want issue a new version of the app - I would rather that these values were pulled from a webservice/static xml file on my server. I would only need to pull these if I encountered an error.
Is there a standard way to do this or should I just roll my own?
EDIT: I'm not so interested in a server side technology - I think a flat file will suffice. What I'm interested in is what format should the flat file should be and how to cache it into my application once I get an error.
try redis, high-performance key-value store. used by some of the big cloud players, like cloudfoundry. Have a look at http://redis.io/. Objective-c client is available at http://redis.io/clients.
I figured out the best way for my use scenario:
I setup a json file on S3 which required authentication. I then used AWS for Objective C to authenticate so I could access that file.
I decided that I only needed to update the local info when the applicationDidBecomeActive in the App Delegate. I then got the json async and on success I then checked a version number in the json and if outdated wrote the changes to NSUSerDefaults (which are then used through the app.) If there was an error getting the json file I just continued as I would already have the previous set of NSUserDefaults that would do the job until the user next made the app active.
This solution worked best for me as it's simple to maintain and should easily handle the load even if my app were popular.
Have you considered using iCloud? It has support for key value pairs. More info here: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/iCloud/iCloud.html