Access sharepoint online list from mobile app - sharepoint-online

I am facing a problem where I need to show the data of sharepoint online list in a mobile app. mobile app can access the data via rest api. but how can i find the sharepoint context as app is external and sits outside boundary of sharepoint.
Any link to the solution or sample code will be highly appreciated.

You need to write REST API which will access SharePoint list data using managed Client object model(CSOM) and return data as JSON.
Following are the detailed steps:
1. Create REST API to access SharePoint list using CSOM
2. Call API from mobile app and include username and password in header in encrypted format
3. Inside API, Decrypt header and use that Username and Password to access SharePoint list.
Sample code for API:

Related

Microsoft Graph API - Sharepoint list unable to call create/update SharePoint list items, GET/DELETE works

Unable to use Microsoft Graph API to create or update SharePoint list items with client credentials access token (getting access token with out a user), I get the following error,
I'm able to successfully call GET and DELETE methods with the same access tokens for the same site/list, additionally I'm able to call all methods GET/POST/PATCH/DELETE for the same site/list using the user generated access token.
For my use case I need to able to create/update list items with out user access so, followed this article - https://learn.microsoft.com/en-us/graph/auth-v2-service, API has required permissions granted in the application
can't seem to find any documentation on what exactly I'm missing, looks like POST/PATCH endpoints are looking for some user info in the token, but client crendentials do not have any user info so not sure what to do next, Here's the documentation I'm following https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=http & I've tried using the .net graph client SDK as well and I get the same error message for both POST/PATCH requests.
Any help on how to successfully create/update sharepoint list items via graph api using client credential token would be highly appreciated.
Followed this article in setting up the application in azure ad - https://learn.microsoft.com/en-us/graph/auth-v2-service, Added app roles are as highlited in this article https://learn.microsoft.com/en-us/answers/questions/756563/app-roles-in-client-credentials-scope-in-azure-b2c.html but no luck.
Hope you are not using delegated permission in your personal account ,
Looks like there is something wrong with your API call ,make sure you are using the correct API call - https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items
You can also Try to create and Update in graph explorer- https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=http#example .
Hope this helps
Thanks

Access Sharepoint List from Teams Tab created using Teams toolkit

I am currently using Graph APIs to connect to share point list from the Teams tab(NOT SPFX TAB) that I created using Teams Toolkit. I would like to know if it's possible to use REST API or PNP library to connect to Share point list items other than Graph API.
Thanks.
You can directly use Sharepoint REST API in Teams Tab. Note that you need to update permission for Azure AD app and request for access token with proper permission with TeamsFx SDK to call Sharepoint REST API.

Registering to get the client id and client secret in sharepoint

I am trying to write a program in java to access the SharePoint using SharePoint REST APIs and download the files in a particular folder inside Documents folder. As the first step which is getting the authentication token, I am trying to register the pp using appregnew.aspx form. As I am new in this area, I am not quite sure what would be my App domain and Request uri. Could someone please help me to understand what are these fields for and what value should be filled in these fields?
Thanks
You could know more about registering SharePoint Add-in from here:
https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/register-sharepoint-add-ins

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

Secure CRUD SharePoint rest apis

Is it possible to secure SharePoint rest APIs?
I have a SharePoint portal that allows users to create accounts an get access to the portal.
The portal uses SharePoint client object model, if any of the users try to access let's say getuserbyid method or retrieving items for lists and changes the ID value, he will be able to retrieve information for other users on the portal.
So it is possible or is their any way to restrict access to the rest APIs outside the portal itself? Because with manipulation using Fiddler or burp suite the request can be replayed with different information or values.
The operations performed by the Client Side Object Model respect the SharePoint site permissions in the SharePoint site you are interacting with. You need to set/customize the site permissions such that you get the results that you want.

Resources