Working solution to come.
@scsh4
Maybe you have done it as well, there are only a few threads here about the this API.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Interactive-Chart-Integrated-with-Microsoft-Teams/td-p/496056
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Exchange-server-connector/td-p/57199
Primary issue for me is that MS graph can only pull 999 records at a time. JSON metadata returns a "odata.nextLevel" entry for the link to get the next 999.Putting this into an Iterative Macro seems the solution. HOWEVER, during the iterations, the Download tool will fail (http returns invalid url) randomly.I'm trying to pull 800,000 records, so this is a must have. And it's driving me nuts.
Hey, I'm a little over my head potentially here but have you managed to get Alteryx to gain a token to then use in the API? I've manually inputted a token using graph explorer to generate it and it works a treat but I'm really struggling to config the flow to self-generate the token?
This should help. The Text Input has spots for TenantID, ClientID, and ClientSecret. (Don't include the < > symbols). The output is your authorization token.From here, you would pass this into a Download or an Iterative Macro with Download. In the Download tool, Headers section, "Include" the Authorization field by checking its box.
An example input URL to feed the URL field of Download tool might be something like https://api-eu.securitycenter.windows.com/api/machines (Although for that you'd need an iterative macro due to exceeding the return count of a single call.) You can even include Filters, like "https://graph.microsoft.com/v1.0/devices?$count=true&$top=999&$filter=(startswith(operatingSystem,'Windows') or startswith(operatingSystem,'Mac')) and (approximateLastSignInDateTime ge 2023-05-30T12:00:00Z)" - but beware - Download does good URL encoding, but the data.NextToken output will already be url encoded, making the Iterative Macro even more difficult. Do NOT try to use the formula UrlEncode or Decode, as they are straight ASCII and won't do it right.
For large volume Iterative type data pulls from MS Graph, I ended up making a C#-created exe. C# can do the iteration without burping bad url's after a few dozen iterations.
Any fresh information on the failure of Iterative Macros on large iteration count https requests to an API?
I am working on a generalised Graph API macro suite for Alteryx. I have a token getter, and I can make API calls, and can handle iteration, paging and adaptive throttling that the Graph API uses. The Graph API applies to all MS products, so this could be a very powerful utility, allowing automation within and across Microsoft 365 apps. Also, it will work with Scheduler and Alteryx Server.
We are investigating use cases, and it looks like you have a use case right here. Continuum Jersey might be able to make a solution for you if you are interested.
@jrobiso2 I don't use Microsoft Graph APIs (or most Microsoft services) at all so I'm curious - how does the burping occur? Is there a test product and endpoint from Microsoft that you can recommend to experience this?
@scsh4 I swear if you solve this, I will be forever in your debt!
@apathetichell you'd need to be using AzureAD or InTune or even MDX (MS Defender for Enterprise) to try it. There are other cloud sources avalable for testing. I think OData.org may have some.
What eventually occurs is the the URL you "grab" from the 1st response (which is used in an iterative macro as the next input to the Download tool) will, at some point, fail at the Download Tool with any number of funky "Bad Header" or "Bad URL" error messages. Halts the whole thing in it's tracks.
This particular macro is currently set to require an initial URL, an Authenticated Token input (A input), and has one Master output (m) (macro-unioned output) and an Iterative output (i output), which will contain the next URL to get. Like all Iterative macros, if there is nothing going out the Iterative output, it ends and finally outputs all the data held by all the iterations out of the master (m) output.
[Even if it worked every time, usage like this should be avoided due to the high memory use from holding all that data until the final iteration]
Hello,
Thanks for this solution, it almost worked for me. The issue I am facing is that the Access Token I am getting is not the same as the one I see in the Microsoft Graph Explorer. For example, the length of the first one is ~1400 characters while the one I see on the Explorer is ~3000 characters long. I am not sure which input to tweak in order to get the right Access Token.
Would really appreciate any help on this. Thank you!