Get embed URL through onedrive API - onedrive

Is there a way to get the embed URL through onedrive's API.
An embed URL is a publicly accessible URL that does not require a login since it contains an authkey.
I did manage to get the cid and resid, however, I can't figure out how to get authkey. Is there any way to get it?
I'm currently on onedrive's python SDK.

You should be able to use the createLink API to request an embed link.
POST /me/drive/items/{item-id}/createLink
Content-Type: application/json
{
"type": "embed"
}
See this documentation for full details.
The SDK should also have createLink exposed so the above should map relatively easily into your use-case.

Related

DownLoad VichBundle file Api Platform

I'm using API platform with VichBundle to store file on the back side and React Native on the Front side.
I've followed the documentation of API platform and the upload part is working well, but I don't know how to download the document.
When I make a GET request I have the entity with the url of the file but I can't do a GET request with this url because there is no route to this file.
Can somebody give me an exemple of how to download file with api platform and Vichbundle.
Thanks
If you are following Api Platfom's documentation your files should be uploaded to your project's ./app/public/media/ folder and available making an HTTP GET request to http(s)://<yourdomain>/public/media/<filename>.<extension>. Just open the URL in your browser.
To get the exact url query yout API for me mediaObject information (for example, /api/media_objects/{id}) and check the contentUrl property.

Is it possible to share RAML file via APIKIT Console?

We want not just to share the API console that is provided via apikit component in a Mule application, but also the raw RAML file so consumers can create their own clients based on the RAML. As far as I know, there is not user friendly way to download the published raw RAML file from within the APIKit console. I just found that one can point to the /api url and do a GET with "application/raml+yaml" content-type, but it is not user friendly enough. Any clues? Thanks
You can use the URL to your console with ?raml on the end of the url.
http://myapp.cloudhub.io/api/v1/console?raml
In at least Mule 4.3.0 (maybe earlier), you can append ?api to the console URL, e.g.
http://localhost:88/myproject/console/?api

Whether it is possible to add redirect link in RAML file e.g. to another API version?

As in subject, I have two RAMLs files one is related with v1 API version, second one is belongs to v2 API version. My problem is that, if I pass to someone my root url with API documentation I wan't to be sure that when someone enters into API v1 page he will be able to se some info ("This is old api version please go to API v2: link") and redirect link to API v2?
Is any way to put this redirect link into v1 RAML file?
Thank for any responses
The documentation section supports Markdown so you can easily insert a link there.
yes You can add Direct URL if its not working then you can try bellow syntax as well
response:
200:
example:
{
"redirecturl":"URL Location"
}

Get Dropbox public folder's metadata without authentication

I'm about to create a blog and wanted to host the content on Dropbox (only Markdown files, everything else is on my server) because I want to be able to quickly upload and edit posts from all my devices without having to get some FTP app on them.
So far I managed to access files via https://dl.dropboxusercontent.com/u/********/<sub-folder>/<file name>.md and like pointed out here I can get the last-modified attribute via etags.
However, I'm stuck at getting a file list (or a folder's metadata in general). Is this possible without using OAuth?
No, this isn't possible without using the API. But why are you against using the API?
Feel free to use my tool https://dbxoauth2.site44.com/ to get an OAuth access token for your account. Then just do an HTTP GET to https://api.dropbox.com/1/metadata/auto/<path> with an Authorization header of Bearer <token>. Ditto for getting the actual file contents, just use /files/auto/<path> instead.
Oh, unless you're doing this client-side in JavaScript? In that case, this won't work since you can't give your access token out to the client (where it could be abused by anyone who visited your website).
make "Public" folder and go https://www.dropbox.com/enable_public_folder
back to your dropbox folder (web) right mouse at file in public folder and chose "Copy public link..."
Update: As of September 1, 2017 public links have been disabled for all users.
https://help.dropbox.com/files-folders/share/public-folder

Receive video ID after posting to YouTube API via Ajax

My question is an extension of this one.
I am using JavaScript to post videos to the v2 YouTube API, via Plupload (HTML5 runtime). I am using OAuth2 to get authorized tokens and a CORS request to set the metadata. I am able to upload videos successfully, but the 302-coded response returned by YouTube gets lost. I am not able to retrieve the ID of the uploaded video, which would ordinarily be present as a GET parameter of the URL redirected to as part of the 302 response.
After uploading the video, how can I get the ID of the video?
It seems like xhr.getResponseHeader(location) would give it to me, but it is undefined with Plupload. Is this because Plupload is overriding the default XMLHttpRequest object and only exposing certain attributes? If I used vanilla XMLHttpRequest objects, would it work OK? Can the 302 be intercepted in all browsers?