How to create Content type in SharePoint using MSGraph api - sharepoint

Is it possible to create a SharePoint Content Type through MS Graph, like this POST https://graph.microsoft.com/v1.0/sites/{site-id}/ContentTypes? It seams that there are a lot of working endpoints that are not in the documentation.

Related

How do I get started from reading SharePoint list information from outside of SharePoint?

We have a SharePoint subscription and an Azure subscription. I want to make a web app that is hosted in Azure, but the database for the app would basically be SharePoint lists. I'm looking up documentation on how to do this, but I'm just finding how to make "web parts" and they keep assuming I want to build my website inside SharePoint rather than outside.
How do I access a user's SharePoint lists from outside of SharePoint?
The easy part is the request for data. Use the SharePoint REST API. The harder part is authentication. How is the Azure app related to the SharePoint app? Same user login?
A sample REST call for select columns from a list:
https://yourDoamin/sites/yourSite/_api/web/lists/getbytitle('My List')/items?$select=Title,Price,Qty
The REST API also support filtering and sorting along with insert, update and delete.
A filter example:
https://yourDoamin/sites/yourSite/_api/web/lists/getbytitle('My List')/items?$select=Title,Price,Qty&$filter=Title eq 'Toys'
If you would like to experiment with the REST API from your SharePoint site, I have "REST tester" you can add to a Content Editor Web Part.
https://github.com/microsmith/SharePointRESTtester

Add sharepoint custom field using Graph API

I want to upload my documents to my SharePoint site using Graph API. I followed the instruction in these posts and I'm able to upload my docs to Sharepoint site.
How to create SharePoint list item with Microsoft Graph API?
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_put_content
However, I want to update some values of uploaded documents in the Document Library items but I cannot find any document to do that. Please advise me in this situation.
Notice: I found the solution by this post.
How To Retrieve Custom Columns For DriveItems in MS Graph

Microsoft Graph Custom User Properties

I followed instructions here: http://www.learningsharepoint.com/2016/03/08/office-365-working-with-new-delve-profile-page-top-features/ which allows me to add custom profile fields to MS Delve.
Is there anyway to access those created fields via the MS Graph api? I've tried everything I Can think of, including using the beta api, directly $select 'ing the data in the REST request, and can't seem to figure it out.
I've read a lot about extensions, but can't seem to get this data.
You made a custom profile field in the SharePoint User Profile Database. Currently there is no MS Graph API for accessing a user profile in SharePoint. You could use the SharePoint Rest API for this.

Microsoft Graph API - Search content over a sharepoint site

We are creating a Sharepoint webpart that enable searching a Sharepoint site contents using Microsoft Graph Api. I am able to get the Lists and subsites
using graph Api, but not sure how to search any content at site level.
Looking for any pointers if this is even achievable.
Below are some of the API calls that work-
https://graph.microsoft.com/v1.0/sites/tenants/lists?select=id,name
https://graph.microsoft.com/v1.0/sites/tenants:/sites/sitename:/sites?search=subsitename
https://graph.microsoft.com/v1.0/sites/tenants:/sites/sitecollection:/lists
here is an example filtering on a list items
https://graph.microsoft.com/v1.0/sites/myThing.sharepoint.com,ffffffff-ffff-ffff-ffff-ffffffffffff,12345678-1234-1234-1234-123456789012/lists/25dd5a71-69a9-44f8-b60f-ed16718eae54/items?expand=fields(select%3DTitle,ID,ContentType,myLookupID)&top=1000&filter=fields/ContentType eq 'My Page'

How to retrieve data from SharePoint?

I have a web application. When the user clicks on a button in my web application, I'd like to retrieve data from SharePoint on behalf of the user. I have read quite a few articles on SharePoint but I'm still not sure how to proceed. Should I create a provider hosted SharePoint App and use the SharePointREST API? Thank you in advance for your help.
You don't need to create a Provider to use the SharePoint Rest Services.
Quoting http://msdn.microsoft.com/en-us/library/office/jj164022(v=office.15).aspx :
One advantage of using REST is that you don’t have to add references to any SharePoint 2013 libraries or client assemblies. Instead, you make HTTP requests to the appropriate endpoints to retrieve or update SharePoint entities, such as webs, lists, and list items. See Get started with the SharePoint 2013 REST service for a thorough introduction to the SharePoint 2013 REST interface and its architecture.
Inside the page you will find videos and code examples that will help you to connect and execute operations.
It's Correct. Data in SharePoint is Stored in Lists or Libraries (to files).
You can use the Client Object Model, to get data remotely from a SharePoint Server (on-premise or Online). The Client Object Model can be used through Assemblies (DLL files) or REST services provided by SharePoint. Generally you should know the location of the data you are going to get, that is, as I initially mentioned, the data in SharePoint are stored in Lists or Libraries, therefore you must know the name of the List or Library Additional Site or Sub-site of the List or Library is.
If the name of the list where the information is stored is "employees" and the HR website, the URL could be formed as follows:
http://spserver.company.com/HR/Employees
For REST services, simply complete URL of the list you want to see, so that you retrieve the information from the list. If you want to apply filters, sorting, to retrieve specific columns, you must do it through CAML queries which the add on REST service call.

Resources