Migrating Ads call from Legacy REST API to Graph API - facebook

In the past, I was using the legacy REST ads.getAdsGroup call which allowed filtering on an accountId, campaignIds, and adGroupIds all in a single call.
I've been staring at the Graph API documentation for the Ad group object and don't see an equivalent call to achieve all of the filtering in a single call.
Am I missing something obvious or do I need to figure out how to make multiple calls to the Graph API to achieve the same goal?

In short no, but here are the calls you'd use for each type of filtering (not sure if you already have discovered this or not, but here goes anyway.)
You can get multiple adgroups by id using the syntax:
graph.facebook.com?ids=<adgroup_id1, adgroup_id2, ...>
You can get adgroups by campaign by using the syntax:
graph.facebook.com/<campaign_id>/adgroups
You can get adgroups by ad account by using the syntax:
graph.facebook.com/act_<ad_account_id>/adgroups

Related

Azure Devops API - Can't find a way to get permission groups/membership using API

I am looking for a way to use the Azure DevOps API to get membership of permission groups. The data I am looking for is in the following location on the front end:
I had the same requirement to get team membership within Azure DevOps and was able to do so using the following URI:
https://dev.azure.com/{organization}/_apis/projects/hrs/teams/{teamname}/members?api-version=6.0
I could not find a similar URI to get permission groups and need a way to pull this information using the API.
I've tried many of the API endpoints on the official api documentation (below) focusing on any that seem like they may pull security group related information. In all cases I came up short either because the endpoint did not provide me with what I was looking for, or the documentation for an endpoint wasn't clear on how parameters need to be structured for more advanced use cases.
https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/groups/get?view=azure-devops-rest-7.0&tabs=HTTP
I also tried asking this question to ChatGPT however the endpoints the chatbot provided me with did not work either.
I found a way to get what I am looking for, but I am not a big fan of the approach.
You can use the graph API to list all permission groups
once you have the permission groups, you can write a script to filter for the group object within the API response you want to get the members of.
The group object has the appropriate API endpoint to hit to get the member objects within the _links.memberships property.
Call the API with the memberships link from above. It will return an array of descriptors which can be used in further API calls.
For each descriptor, hit the appropriate API endpoint to resolve the object for that descriptor. If the descriptor starts with aad then it is a user and you can use the user get api. If the descriptor starts with aadgp then it is a group and you use the group get api.
This strategy is rather complicated and requires an API call for each member of the group. I'd hope there is a better solution.

How to pull ad insights in bulk using Facebook Graph API?

I am trying to do what I thought would be a very simple task which is to use the Facebook API to retrieve insights about ads, but I'm having so much trouble. I know how to use multiple API calls to retrieve the list of ads, and then retrieve the insights for each ads using an API call for each one.
However, I'm limited at 200 API calls per hour, so this is no good if I wanted to pull all ads from all-time. There is a way to batch call the ad insights using an endpoint like:
act_XXXXXXXXXXXXXXX/ads?fields=insights{cpc, impressions}
But then I am unable to specify the timeframe so it only grabs stats from the past month. Usually I would specify the timeframe with a field of
date_preset=maximum
(or whatever I want the date_preset to be), but in this case if I add it as another field it does not affect the the insights (I presume since they are using those brackets as a special way to pull the bulk insights).
I swear to god if I figure this out I'm releasing it publicly and loudly for free because I think it's ridiculous that this is so roundabout.
Do this: act_XXXXXXXXXXXXXXX/ads?fields=insights.date_preset(maximum){cpc, impressions} This is called a nested query.

How to grab all the issues inside a jira structureboard using REST api

I have been researching Jira REST api in order to grab all the test cases inside my structures but I haven't had any luck. The closes I have been to getting inside a structure is using the URL $baseUrl/rest/structure/2.0/structure. From there I tried to manipulate the url into giving me all the information about a specific structure.
For example, I used $baseUrl/rest/structure/2.0/structure/$id but I only got back
{"id":135,"name":"TEST PLAN 1","description":""}
There is hardly any information in this REST api call. IS there a way to have it list out all the issue keys(test cases) in the structure i pick?
Information Regarding JIRA Structure REST API is posted here https://wiki.almworks.com/display/structure/Forest+Resource

Find users with a particular license in Azure Graph REST

Has anyone queried the Azure Graph REST API by licenses? I can't find any examples using REST online. We use REST for our operations and a need has come up to generate license reports and I'd like to be able to execute queries based on license codes.
Any help would be appreciate. Thanks for your time.
According to your description, it seems that you’d like to filter users by assignedLicenses that is a multi-valued complex type. From this documentation, we could find that currently the API seems not support querying of (filtering) a multi-valued complex type (assignedLicenses).
As a workaround, you could try to get users from API and leave the filtering on the client side.

Searching for more than one user

I would like to use Graph API to search for users whose names are "John" or "Mark".
https://graph.facebook.com/search?q=john&type=user
https://graph.facebook.com/search?q=mark&type=user
Is it possible to receive those informations using only one request? Something like "q1=mark&q2=john" ?
You could use the batch API to group both requests in a single API call.
http://developers.facebook.com/docs/reference/api/batch/