Graph API filter - linq

how to recreate this LINQ:
applications.Where(x => x.Owners.Any(y=>y.Id == "user_object_id"));
to Graph API filter string, something like
graphServiceClient.Applications.Request().Filter("Owners/any(x:x/Id eq 'user_object_id'")).GetAsync();

If you haven't used the Graph Explorer I highly recommend it to test queries. You can use it on your own data.
For your query I would start here with GET /applications
From there you can filter with something like displayName or in your case, userID:
GET https://graph.microsoft.com/v1.0/applications?$filter=startswith(displayName, 'a')&$count=true&$top=1&$orderby=displayName
ConsistencyLevel: eventual
Please let me know if you have any questions or are stuck and I can help you further!
Best,
James

Related

Using Pinterest Marketing api to fetch all entities?

Is there an edge that would allow fetching all the campaigns, adgroups, etc., of a given advertiser? In researching this I see these:
GET /ads/v3/campaigns/{campaign}/
GET /ads/v3/adgroups/{adgroup}/
...
which return only single entities. I also found that there is an async report that returns entities in batch:
advertisers/<advertiser ID>/entities/batch/
Is this the best way to accomplish this? If so, the doc says it only supports campaigns right now, is that still the case?
Thanks
Sorry to waste your time folks, I've since found more and better doc and discovered that there is this:
/ads/v3/advertisers/{advertiser}/campaigns/
Here is a link to the doc for your own reference:
https://developers.pinterest.com/docs/redoc/#operation/ads_v3_get_advertiser_campaigns_handler_GET

Power Automate get data from Project Online and Filter

I am using "Send an HTTP Request to Sharepoint" action, and I want to filter the output to only include the project with ID = [user input filed in "Manually trigger a flow"]
My Uri seems to not be working and can't find errors; I have used this action before with no problems, can't figure what syntax (?) problem I may have?
Here is the Uri:
_api/ProjectData/Projects()?$Filter=ProjectUID eq '#{variables('proj id')}'&?Select=ProjectName,ProjectWorkspaceInternalUrl,ProjectUID,ProjectIdentifier
Can anyone spot the problem?!
Thanks so much in advance :)
For the URI try the following instead:
/_api/ProjectData/Projects()?$filter=ProjectId eq guid'xxxxx' &$Select=ProjectName,ProjectWorkspaceInternalUrl,ProjectId,ProjectIdentifier
where xxxx is your project id or in this case #{variables('proj id')}
It makes it easier to deal with the data as it doesn't return an array.

Google Knowledge Graph API Usage

I'd like to clarify how to use the Google knowledge graph API to obtain more specific information about an entity, such as the height or birthday of a person.
For instance, the documentation provides the following search for Taylor Swift:
https://kgsearch.googleapis.com/v1/entities:search?query=taylor+swift&key=API_KEY&limit=1&indent=True
This request returns some basic information, such as description, name, type, and id. However, the documentation sadly does not explain how to query specific properties for that person (even though the Person schema certainly contains that information).
I've tried changing the "query" value to "taylor+swift+birthday" but that returns something completely unrelated. I've also tried searching by the returned "id" (/m/0dl567 for the above example) but that doesn't give any extra information.
Some guidance on how to use the API in this way would be much appreciated! If however it's not possible to do this, what would be the best alternative?
Thanks!
According to the Knowledge Graph Search API reference, information such as height or DOB is not included in the response.
The most reliable source of such information currently is Wikidata. Using the Wikidata Query Service, you can query the data you need for the entity with the given Freebase ID or Google Knowledge Graph ID:
SELECT ?item ?itemLabel ?birthdate
WHERE
{
?item wdt:P646 "/m/0dl567".
?item wdt:P569 ?birthdate .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Is it possible to get Google Analytic goal value by date?

Google Analytics Management API goals endpoint. this is the link showing the goal endpoint I will be using to get a value. Is it possible for me to get the goal value broken up by date? I want to know the goal value for each day so I can create a line graph with accurate data. This endpoint is apart of the management API, but I know the core reporting API is more flexible with sorting by date. I would like to know if it is possible. If it is, please enlighten me!
Any reason you can't use the reporting API? You can use dimension=ga:date and metrics=ga:goalXXCompletions (ga:goal1Completions).
See the link to the query explorer report below:
https://ga-dev-tools.appspot.com/query-explorer/?start-date=2016-01-01&end-date=2016-03-27&metrics=ga%3Agoal1Completions&dimensions=ga%3Adate&samplingLevel=HIGHER_PRECISION&max-results=10000
You can query them together.
# get report data
query.list <- Init(start.date = "XXXXXX",
end.date = "XXXXXX",
dimensions = "ga:date",
metrics = "ga:goalXXValue",
table.id = "ga:XXXXX")

iOS Mapkit, identifying "type of business"

I've looked through numerous answers (most were slightly outdated), and I was wondering if Apple had some sort of way to identify the type of business it queried?
From the reference guide, MKMapItem has 5 variables, none of which tell me a place is a "Thai Restaurant" or something like that.
placemark
isCurrentLocation
name
phoneNumber
url
I think its interesting how when you do a MKMapkit query on "thai", it'll give you a list of thai restaurants but thats a one way street and no where later can I take a result from the query on "thai" to verify that it is indeed a "thai" restaurant. More importantly, what I am particularly interested in is if a business is a "Thai" restaurant and a "Bar" as well, I want to be able to do a MKMapKit query on "Bar" OR "Thai" and be able to get both of those tags
I can see a solution of getting the coordinates of a business then using Google Maps API or even Yelp API and doing a search on there to get the "type of business" but that seems extremely cumbersome and inefficient.
Thanks for any advice! One of my first questions so please so easy on me =)
First, take a look with this link : http://www.raywenderlich.com/13160/using-the-google-places-api-with-mapkit
The google API will send back the name, type, location of business location near you.
It's also send icons(via image link) of business location, so you can display it on the map, which can help you which is market, which is coffeeshop...
But the "Thai Restaurant" maybe too detail so google doesn't want to show it.
Sorry about my bad english.
Hope it help.
For that you should use google near by place search or place search api. you can pass thailand as place name and restaurant to type and it will return you all the restaurant in thailand.

Resources