Microsoft Graph API - Document library creation with navigation link - microsoft-graph-api

I am using Microsoft Graph API create a Document Library in a SharePoint Online site. I would like to know if there is a way to create at the same time I create the doc library a navigation link.
When working directly on SharePoint online there is a checkbox "Show in navigation link", which will automatically create a navigation link on the left column.
I could not find anything in the documentation, I would like to know if there is a way to do that thanks to the API.
POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists
{
"displayName": "TEST1",
"list": {
"contentTypesEnabled": false,
"hidden": false,
"template": "documentLibrary"
}
}

When checked, SharePoint is actually doing to things behind the scenes. First, it creates the Document Library. Then it adds a link to the Page. This isn't supported in v1.0.
I expect it will eventually become available given the recent introduction of the sitePage resource to the Beta API. At the moment there isn't a way to "update" an existing page so it likely wouldn't support your scenario today but it's logical to assume PATCHing a sitePage is coming at some point. .

Related

Using Google Slides API to add/remove emails from custom website

Is it possible to use Google Slides API to enable me to take an email lets say admin#gmail.com from my custom 3rd party website and add it so they can view the presentation only? I would then hopefully have a checkbox on their profile on the site so when it is unchecked it will remove them from the presentation and so on.
This would be a really good feature as it would reduce the admin burden and help me keep track of who I've allowed who to view my documents.
If this is possible does anyone have the code for it?
Sure, you can easily do that using Drive API with a Permissions.Create [1] request. You can start from the quickstart [2] to set up the client in order to be able to make requests. In your case, you would need to know the file ID and use the following parameters:
{
"role": "reader",
"type": "user",
"emailAddress": "user#email.com"
}
[1] https://developers.google.com/drive/api/v3/reference/permissions/create
[2] https://developers.google.com/drive/api/v3/quickstart/js

Get information about the expected syntax of a string in the request body

I have been given a Swagger API with a request body defined as
{
"SqlFilterList": "string",
"SubjectKey": 0,
"SubjectCwaListingKey": 0
}
The programmer who wrote the API is on vacation and can't be reached. I don't have access to the API code. Is there in general anyway to interrogate the api to determine what the valid values of "string" might be? Or do I have to wait for the person to come back to the office?
I have reviewed the API's documentation via its URL (which is why I know that it needs a string), I searched the Swagger website and I searched questions with tag [swagger] in stackoverflow and didn't spot anything.
If the answer is that I am out of luck (which I strongly suspect to be true) is there a way that I can suggest to the author to document the valid syntax of the "string" in the API so that the next person doesn't go through this?
It sounds like you have found your way to the Swagger-UI, displaying the API documentation and interactive "try it out" buttons.
Most likely, the API is just not documented as thoroughly as you need it to be. But there's a chance you might be able to find more information from the Swagger spec. A couple of things you can do to dig deeper:
Look at the Request Model
In the Swagger-UI, click the "model" tab in the operation header:
This will display additional details about the request structure, if the developer has provided property-level descriptions. The misnamed "model schema" tab that displays by default is really an auto-generated example of the message structure; not so useful if you're looking for detailed request documentation.
Inspect the Swagger Source
You might be able to inspect the Swagger source specification that is populating the Swagger-UI. Try using the "view source" command in your browser, and look for the SwaggerUi object constructor. It will look something like this:
var swaggerUi = new SwaggerUi({
url: 'http://petstore.swagger.io/v2/swagger.json',
dom_id: 'swagger-ui-container'
});
Follow the specified url to find the source Swagger spec, and see if there is any further information available. It's unlikely that you'll find more there than what's displayed in the Swagger-UI, but it's worth a shot.
Note that there's another form of the SwaggerUi constructor that doesn't use a url property. Instead, it uses a spec property whose value is a (big!) JSON object. You can copy-paste that object into a Swagger or JSON editor (for easier reading with auto-format, syntax coloring, etc.) and see if there's any further info there.
If the answer is that I am out of luck (which I strongly suspect to be true) is there a way that I can suggest to the author to document the valid syntax of the "string" in the API so that the next person doesn't go through this?
Hopefully the API developer has provided a feedback channel, either through email or a support site. There might be some API documentation widgets that incorporate feedback or discussions directly, but Swagger-UI does not at this time, AFAIK.

API for Creating/Editing Google Slides

Does Google offer a REST or Javascript API for creating and editing slides? I've been able to figure out how to interact with sheets and most of the other services offered as part of Docs/Drive, but haven't had any luck with Slides.
If there is no API, I'd be willing to create files directly myself, but I haven't been able to find any documentation on a Slides file format.
The Google Slides API was launched on 11/9/2016. It provides the ability to read, create, and edit Google Slides presentations.
I was looking into this too. Looks like it's been a requested feature since at least 2012, follow Issue Tracker Link
Right now the best I know of is to automate making a powerpoint file (e.g. use this library for python) and then upload it to google drive where it will autoconvert. Obviously there are many limitations to this strategy, but in a quick test it worked fine for something simple.
I would also love if Google provided an API that allows making slides like the various API calls for microsoft office.

Where can I find / modify Loopbackjs model metadata?

As you might now, Loopbackjs framework displays a swagger-based explorer interface exposing your API endpoints and briefly explaining the methods. The problem it's that this interface it a little too much interactive.
I need to provide an api-docs (ish) documentation for my API, and I'm currently adding #annotations in /common/models js files, but I suspect I'm reinventing the wheel here. For swagger-ui / loopback-explorer to display its interface, the endpoints must be already exposing some kind of metadata, right?
I'd like to get that and complete it with description, examples, custom status codes and without "try it" buttons. The users that will see this wouldn't appreciate so much interactivity.
You can access the "swagger" for your LoopBack Models by clicking the "raw" button at the far right of any Model in LoopBack Explorer and you'll see the swagger JSON that describes you Model.
If you really want to customize your API explorer interface, check out this article:
http://www.podstud.io/blog/angular-swagger-jacking/
Then you'd access the Model Swagger Resources and provide any sort of slick interface you want...
Hope this starts you in the right direction...

Integrating Google Docs API

I'm just beginning with programming, but i wanted to know if it's possible to use google docs api to make documents on another site using the google docs text editor?
Is there some sort of way i can put the google docs text editor onto a website so that we can use that for document creation instead of tiny mce?
Basically the functionality needed would be documents created, openly shared, a postable version of it (take html code) -- so it can go on the document display page, and
Of course there would be google login and everything, but i just wanted to see if this would work.
No, that is not possible, sorry.

Resources