How to access Sharepoint files from external application

Hendrik Geerts 20 Reputation points
2024-08-12T07:33:34.0433333+00:00

Dear community,

We have been trying to access the files stored inside Sharepoint inside our CMS, such that they can be used by our end-users.

Using the following endpoint https://graph.microsoft.com/v1.0/sites/' . $siteId . '/pages?' . http_build_query($parameters), we are able to retrieve a response containing the site details, which has a list with URLS of the files.

However, the issue arise when we try to access an URL of one of the files, and we get a 403 Forbidden. When we then log-in to our account using OAuth we do get access. However, for our use case the files would have to be loaded into a browser which does not have the possibility to login since the browser which loads them will be run as a digital signage kiosk.

So our question would be: is it possible to use Sharepoint in this manner, where we access the files from Sharepoint inside a browser without having to have an active session where we are explicitly logged-in?

Kind regards,

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,864 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,582 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Hendrik Geerts 20 Reputation points
    2024-08-22T08:47:15.3866667+00:00

    Hi,

    Apologies, for some reason we missed the notifications.

    I'll try and elaborate:

    We have a back-end platform where our users can manage their digital signage screens (screens that hang in supermarkets, schools, etc. to display information) When users log in the back-end, they can authenticate themselves with their personal Microsoft account and as such we can perform requests to the API to get the URLS of images that are linked to Sharepoint sites.

    The use case is that we are showing these Sharepoint sites on our custom templates that can then be shown on the screens. These sites have header images which we would also like to display.

    However these screens, are just smart-tvs with a browser which visit a public URL configured in our back-end, and are usually not corrected to a keyboard or mouse. As such it is not possible (and preferable) to require users to authenticate with Microsoft on those screens separately and as such does not have a authenticated session. Because of this, when trying to access the URLs of the images on these screens we get a 403.

    Our questions would be:

    • if there is some kind of way to either perform an API call to retrieve the images (so we could use a JWT token, that would authorize us to do so)?
    • If not; if there is some other alternative to get us to display these images on our templates?

    Kind regards,

    0 comments No comments

  2. Xyza Xue_MSFT 24,011 Reputation points Microsoft Vendor
    2024-08-26T07:45:02.4366667+00:00

    Hi @Hendrik Geerts ,

    Due to the complexity of your situation and my low level of access, the forums cannot be tested for environments that have non-Microsoft products, making it difficult for us to continue to resolve your issue quickly through the forums. In order for you to have a better experience in solving the problem efficiently, we recommend you to create a new service request in the M365 Admin Center as an administrator, so that a more professional person will be able to help you.

    (Microsoft 365 Admin Center -> Support -> Help and Support)

    Hope the information can help you. Your understanding and patience will be highly appreciated! Hope you have a good day and keep safe!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.