OneDrive API: creating and receiving item (embedded) links - onedrive

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.

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

OneDrive Custom Metadata on Files

I would like to store some additional metadata with documents that I am uploading to OneDrive (Business) using the OneDrive API, for example type of document, some additional information to search on , ...
Does anyone know if this is possible at this time? I noticed the following URL
https://github.com/OneDrive/onedrive-api-docs/blob/master/misc/custom-metadata.md
But only support for OneDrive Personal??
To create a new facet, the OneDrive team needs to be informed via mail ?
Before a new custom facet can be used, you need to define its schema and register it with OneDrive. To register your custom facet, contact OneDrive Facet Registration and provide your client_id and schema definition JSON.
Best regards,
Jens
Reviving a post a bit later because my search found this question. I am going through custom facet registration at present. It is necessary to email the OneDrive team, and as part of that I needed to confirm in my reply that this was indeed only for OneDrive personal, not business / Sharepoint.
The e-mail link is shown in the OneDrive dev docs:
https://dev.onedrive.com/misc/custom-metadata.htm

How do I upload a photo / image to LinkedIn via API?

LinkedIn has a /share API endpoint which accepts a link and a message. The link is afterwards expanded to an OpenGraph card and that gives you a way to stick an image preview in there, but it seems there's no other way to upload an image/picture to LinkedIn feed like you can do in the web app itself.
Is there a way, private API, undocumented endpoint or some other way to do that?
Creating a rich media share is done in two steps. First, the media is uploaded to LinkedIn's media platform. Then, a personal or organization share referencing that media is created.
This URL might be help you.
https://developer.linkedin.com/docs/guide/v2/shares/rich-media-shares#upload
No. You need to give us the URL and we'll scrape it (or pull it from our cache).

How can I get the users who don't add me back via G+ API?

Now, I can view people I have added through Google plus api but I can't find the way to view people that have added me.
https://developers.google.com/+/api/latest/people#resource
That feature isn't currently available in the API. I'd suggest adding a feature request here: https://code.google.com/p/google-plus-platform/issues/list

How to delete an image on Imageshack using its API

I'm trying to use the Imageshack api to delete an image uploaded to my account.
I have successfully managed to upload an image to it using the API.
https://www.imageshack.us/upload_api.php?url=[URL_OF_THE_IMAGE]&key=[MY_KEY]
I can delete the image uploaded by using the standard interface.
Any solution using the API?
I have managed it by doing the following:
First log in to get an auth_token:
HTTP POST
https://api.imageshack.us/v1/user/login?username=YOUR_USERNAME&password=YOUR_PASSWORD
Parse "auth_token" from the response
Then delete:
HTTP DELETE
https://api.imageshack.us/v1/images/SERVER/FILENAME?auth_token=AUTHTOKEN
In addition to AUTHTOKEN you need include SERVER and FILENAME, I store these from files.server and files.image.filename that come back in the response to the upload API call.
Jamie Clark's solution is what you need, using the proper v1 api. Your sample script is still using the posting methodology from their older API as described here. That one doesn't expose any deletion methods. What Jamie is describing is the API as it is currently, documented here. It's not clear if the API keys are the same, but I'm guessing no - my new one doesn't seem to work with this old call and the link from that google code page for requesting an API key is defunct.