Graph Api: Region is required when request with application permission

Siek, Stephan 21 Reputation points
2022-07-14T13:24:28.63+00:00

Hi,

i do a simple POST Request to the Graph-Api and i get an error "Region is required when request with application permission."

POST https://graph.microsoft.com/v1.0/search/query
BODY:
{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "contoso"
}
}
]
}

Response:
SearchRequest Invalid (Region is required when request with application permission.)
Region is required when request with application permission.

Do someone know how to fix this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,043 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 42,031 Reputation points
    2022-07-15T02:58:29.66+00:00

    Hi @Siek, Stephan

    Do not call the /search/query endpoint with application permissions, this endpoint does not yet support application permissions, only delegated permissions are currently supported.

    220897-image.png
    220935-image.png


    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.


1 additional answer

Sort by: Most helpful
  1. Sandeep Bari 26 Reputation points
    2022-09-12T14:29:52.64+00:00

    Hi,
    I am facing same issue, and could not fix it just changing permission type from application to delegated in app registration.
    In my case I have a designed a console app for custom Microsoft Graph connector using this article . And I want to delete all the items in external connection. I am using search api to query all items in external connection, and delete one by one.

    Could you please provide some insights what changes you did to fix the issue.


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.