none
SharePoint Online Search Api via Microsoft Graph RRS feed

  • Question

  • Is it possible to make a (fulltext) search in SharePoint Online via the Microsoft Graph Api?

    I can grant a permission "Office 365 SharePoint Online - Run search queries as a user" in the App registration in the Azure portal.

    But I can't find such request in the API doc:

    https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/sharepoint

    I need to make the request via oauth because the required request is cross domain.

    Sunday, August 5, 2018 6:55 PM

All replies

  • Hi,

    Based on document below, Full-text search is only available for a subset of entities such as messages.

    https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/concepts/known_issues.md

    You could submit feedback for this in uservoice below.

    https://officespdev.uservoice.com/

    As a workaround, you could follow the steps below to access SharePoint rest api remotely.

    https://gallery.technet.microsoft.com/office/SharePoint-Online-access-d224a674

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    • Marked as answer by Mattjas Monday, August 6, 2018 2:08 PM
    • Unmarked as answer by Mattjas Monday, August 6, 2018 2:08 PM
    Monday, August 6, 2018 6:01 AM
  • Hi,

    I am checking to see how things are going there on this issue. Please let us know if you would like further assistance.

    You can mark the helpful post as answer to help other community members find the helpful information quickly.

    You can also share your own solution here and mark it as answer, so it may help others who has similar requirement.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Tuesday, August 21, 2018 7:14 AM
  • OAuth

    When I use the Graph Api, I use OAuth for authentication.
    This works fine.

    SharePoint Api

    Your Link https://gallery.technet.microsoft.com/office/SharePoint-Online-access-d224a674 references another doc http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx
    This doc tells me, that I need SAML for authentication.
    => So do I have to use SAML, when I want to access the SharePoint REST Api?
    SAML is a problem for me because I use Java and can not rely on the C# libraries.

    Azure Permissions

    At the first place I asked how to do a fulltext search via Graph Api.
    Obviously fulltext search is not available.

    But then I found a permission in the azure app permissions: "Office 365 SharePoint Online - Run search queries as a user"

    Where do I need this permission?


    Thursday, August 23, 2018 9:16 AM
  • Hi,

    You could check the sample code to authenticate SharePoint from Java.

    https://stackoverflow.com/questions/49480459/how-to-upload-files-to-sharepoint-sites-document-library-using-graph-api-on-and/49485812#49485812

    Then call SharePoint online search rest api.

    https://docs.microsoft.com/en-us/sharepoint/dev/general-development/sharepoint-search-rest-api-overview

    The permission ‘Run search queries as a user’  of Azure permissions used for Office 365 app(call Microsoft graph api), not used to access SharePoint search rest api.

    Here is permission explanation.

    Run search queries as a user

    Allows the app to run search queries and to read basic site info on behalf of the current signed-in user. Search results are based on the user's permissions instead of the app's permissions.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, August 24, 2018 8:51 AM