Getting "Unsupported sort property 'deletedDateTime' for 'Group'" error - azure-ad-graph-api

I am trying to get the list of deleted Azure AD groups via Graph API by using below query:
GET
https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.group?$count=true&$orderBy=deletedDateTime+asc&$select=id,DisplayName,deletedDateTime
But I got the error like below:
{ "error": { "code": "Request_UnsupportedQuery", "message":
"Unsupported sort property 'deletedDateTime' for 'Group'.",
"innerError": { "date": "2022-05-20T10:30:41", "request-id":
"2884a7a0-ee08-4484-b63a-d927310c1dde", "client-request-id":
"0ec6c500-e899-65bf-acd8-dbd786c59773" } } }
Can anyone help me with this error? I have all the required permissions,not understanding what's going wrong.

The error usually occurs if you missed adding required header while executing the query.
I tried to reproduce the same in my environment without adding the header and got below error:
To resolve the error, make sure to add header as ConsistencyLevel: eventual like below:
After adding the header got the results successfully like below:
Reference:
List deletedItems (directory objects) - Microsoft Graph v1.0 | Microsoft Docs

Related

Unable to modify existing properties of groups from Graph API

I am trying to modify the existing Azure Ad group display name and description from Microsoft Graph API.
I am using the query below:
PUT
https://graph.microsoft.com/v1.0/groups/mygroupobjectid
Body
{
"displayName": "Test_Group1",
"description": "This is my test group",
"groupTypes": [
"Unified"
],
"mailEnabled": true
}
But I am getting the response like below:
{
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"date": "2022-06-15T10:32:53",
"request-id": "253a0a13-f721-4798-911f-d3ab3903da17",
"client-request-id": "8de28bb9-bafe-d186-264d-db614b05a67f"
}
}
}
Can anyone suggest what I am doing wrong? Any help will be appreciated
Please note that, you need to use PATCH method to update properties of existing Azure AD groups via Microsoft Graph API as stated in this MsDoc.
I tried to reproduce the same in my environment like below:
Before updating, my group has properties like this:
To update those properties, I ran query like below:
After executing the above query, properties are updated successfully like below:

Facebook Marketing API returns error on "breakdowns call"

I'm trying to make an API call with the folowing URL
act_XXXXXXXX/insights?fields=ad_id,clicks,unique_clicks,impressions,reach,spend,date_start,date_stop,actions,action_values,unique_actions,account_id&level=ad&breakdowns=platform_position&time_range={"since":"2019-09-07","until":"2019-09-07"}
and the response is :
{
"error": {
"message": "(#100) Current combination of data breakdown columns (action_type, platform_position) is invalid ",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "XXXXXXXXXXXXXXXXXXXX"
}
}
the reason is in "breakdown" value = "platform_position"
but the problem is that I need exactly that breakdown :(
when I do an API call and change "breakdown" in URL to something else, for example to "publisher_platform":
act_XXXXXXX/insights?fields=ad_id,clicks,unique_clicks,impressions,reach,spend,date_start,date_stop,actions,action_values,unique_actions,account_id&level=ad&breakdowns=publisher_platform&time_range={"since":"2019-09-07","until":"2019-09-07"}
it is OK and responds with data.
I don't know why it happens because I'm not specifying any "action_type" breakdown but it tells that I am :(
What I've tried:
I tried to remove all the parameters from that URL one by one but it still returns an error
The main questions are: why the API call for "breakdown" value = "platform_position" fails and how to make it work.
Thanks.
PS: you can use FB API testing tool to test requests to FB api.
I'm using API version v8.0
You will need both publisher and position:
breakdowns=publisher_platform,platform_position

What is the expected request to get GoToWebinar webinar details based on organiser_key?

I am trying to fetch GoToWebinar details via the
Get Webinars method
​/organizers​/{organizerKey}​/webinars
listed on the GoToWebinar API reference.
I'm passing the below body:
{
"fromTime":"2015-07-13T10:00:00Z",
"toTime":"2015-07-13T22:00:00Z"
}
But in response, I get the below error:
{
"errorId": "26a9b9a8-3a92-45b0-acdd-7ac3c3f485ac",
"requestId": null,
"timeStamp": 1587960550357,
"reason": "invalid.data",
"errorCode": "invalid.data",
**"description": "Required DateTime parameter 'fromTime' is not present",**
"incident": "5801952841989547523",
"details": null
}
The API reference guide does not specify any request structure, just mentions what is needed to be sent, and I have built my logic on the same. Yet I am unable to get a proper response.
Can anybody help me in understanding what the expected request should be?
Since this is a GET HTTP call you can not add these parameters to the Body. I mean you can but it won't be sent along with the call (only with POST/PUT). So you should add the two fields you provided to the Query Parameters instead.

OData get individual property: ~/entityset/key/navigation/property

I need to get an entity's individual property from OData(V4) endpoint.
It is a simple project. Models, controllers and configurations files are here
The $select is working, but it is a little different than we want. We need to get just one property(not an entity with one property) to show in a report on somewhere.
Now I'm able to get individual navigation and normal properties:
http://localhost:64659/People(Guid)/Address,
http://localhost:64659/People(Guid)/Name,
http://localhost:64659/Address(Guid)/Name
But, the following URL is not working, because we trying to get navigation property's property:
http://localhost:64659/People(Guid)/Address/Name
And the error is:
{
"error": {
"code": "",
"message": "No HTTP resource was found that matches the request URI 'http://localhost:64659/People(c6ef0e71-2107-4d58-bf0d-12d38f25045a)/Address/Name'.",
"innererror": {
"message": "No routing convention was found to select an action for the OData path with template '~/entityset/key/navigation/property'.",
"type": "",
"stacktrace": ""
}
}
}
I couldn't find anything to get this to work, any help appreciated.
Came across the same issue and used $select
http://localhost:64659/Address(Guid)?$select=Name

PAGE_ID/insights/page_fans/lifetime?until=DATE gives OAuthException for some dates

For some of my fanpages, it gives OAuth error , once you try to get data using /PAGE_ID/insights/page_fans/lifetime Facebook API.
What excatly happened was, I used PAGE_ID/insights/page_fans/lifetime?until=2013-05-04. It pulling through data. But if I use PAGE_ID/insights/page_fans/lifetime?until=2013-05-03 , that means same query a day before the first query, it gives
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
Does any have proper explanation for this?
you cannot use date range in /insights/page_fans/lifetime
query it without any parameters
you can combine
/insights/page_fans/lifetime
/insights/page_fan_removes
/insights/page_fan_adds
to get a daily reading