Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Graph API return empty array when I search for a Sharepoint site by keyword query

(0) ShareShare
ReportReport
Posted on by 66

Hi everyone,

 

When I simply execute the Graph Query after adding my Sharepoint Site name, it returns empty array instead of with value. https://graph.microsoft.com/v1.0/sites?search=[MY _SHAREPOINT_SITE_NAME]

 

I consent all Sites.Read.All and Sites.ReadWrite.All permissions. I am owner of the site and I tried to change the private to public of the state of the Sharepoint site but nothing changed still returning empty array

 

{

    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",

    "value": []

}

What am I really missing? I will be glad if you help me on that. Thanks in advance.

Categories:
  • ltfDre Profile Picture
    ltfDre 66 on at
    Re: Graph API return empty array when I search for a Sharepoint site by keyword query

    Hi @Geeks_D ,

     

    It's works! But it's a bit strange because I used space between the words then it worked.

    I really could not think that it works with spaces 🤔

     

    Thanks for your support! 🤙

  • Geeks_D Profile Picture
    Geeks_D 1,169 on at
    Re: Graph API return empty array when I search for a Sharepoint site by keyword query

    Please accept this as solution if that works for others to Improve Knowledge Management 

  • Verified answer
    Geeks_D Profile Picture
    Geeks_D 1,169 on at
    Re: Graph API return empty array when I search for a Sharepoint site by keyword query

    Hi 
    Can you try this - https://graph.microsoft.com/v1.0/sites?search=
    This will display all SharePoint  Sites in your tenant
    Then look for this in the list 

    Geeks_D_0-1689083212721.png

    This will show the actually name of that site 
    Then you can rewrite your query with that actual name like this 

    https://graph.microsoft.com/v1.0/sites?search=Development
    It will display the Sharepoint site details 

    Geeks_D_1-1689083298936.png

     

  • ltfDre Profile Picture
    ltfDre 66 on at
    Re: Graph API return empty array when I search for a Sharepoint site by keyword query

    Sure, I tried it on Microsoft Graph Explore

     

    ltfDre_1-1689081983002.png

     

  • Geeks_D Profile Picture
    Geeks_D 1,169 on at
    Re: Graph API return empty array when I search for a Sharepoint site by keyword query

    Best option to try your API calls on the Microsoft Graph Explore to be sure all the syntax and id is correct 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard