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

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.

Related

Uploading documents to a deal in hubspot

I want to implement the following use case and I'm not sure how to do this with the Hubspot API and I don't find any solution within the documentation.
I created a custom request flow which is creating contacts and deals within Hubspot programmatically via the API in the next step the user should upload documents related to his case and I would like to upload and associate these documents with the related deal. Could someone help me or point me to the right spot in the documentation on how such a scenario can be established with the API.
I got the following answer on the community board of Hubspot which worked for me:
You can upload a File (and set the permissions) using the CMS Files
API.
Once you've upload the file you can the associate the file to your
deal (using the File ID returned from the CMS Files API) with the
Create Engagement API.
Link: https://community.hubspot.com/t5/APIs-Integrations/Upload-File-to-a-contact/m-p/398156#M39358

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.

OneDrive API: creating and receiving item (embedded) links

1) How do I create an embedded link via the OneDrive API (https://api.onedrive.com/)? I know that it is possible to create a view or edit link via the following POST call via:
POST https://api.onedrive.com/v1.0/drive/items/{item-id}/action.createLink
Body: { "type": "view|edit" }
But requesting 'embed' isn't possible, although the documentation shows that it is one of the valid types. I know that it is possible via the Live SDK:
https://apis.live.net/v5.0/{file-ID}/embed?access_token=ACCESS_TOKEN
But how do I do this for the OneDrive API?
2) Is it possible to receive the already existing links via the OneDrive API in another way than via creating a new one via {file-ID}/action.createLink call? For example by expanding the metadata?
https://api.onedrive.com/v1.0/drive/items/{item-id}?expand=***links/permissions***
I found that the same question was asked on the Github OneDrive forum. You see their answers below:
Currently the OneDrive API only supports view and read links. You can vote to include embed support via their User Voice page.
In the future, you'll be able to enumerate existing links on an item (at least those links created by your app) to discover existing URLs without the need to call createLink. There is not yet a timeframe for when we'll roll that out, but it should be soon.

Set client_mtime metadata via dropbox API

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.

No Google Drive API writersCanInvite equivalent?

With Docs API deprecated and some nice new functionality in Drive API, I'm working on updating some of my file migration scripts. However, I've found there doesn't seem to be a Drive API equivalent to the writersCanInvite parameter in Docs API v3. Being able to set this attribute on a file would be extremely important during migration scenarios as without it, the migrated file would be left open to having editors share it out further.
Not having writersCanInvite avaialble in addition to not being able to see email addresses (or some Unique ID) for the ACLs is preventing me from fully porting over my migration script to Drive API v2.
Thanks Guys,
Jay
It looks like we now have a writersCanShare attribute that controls this:
https://developers.google.com/drive/v2/reference/files#resource
at the moment, it's not marked as writeable but I had no problems making it False for a new document so I'm guessing that's just a documenation issue.