Forum Discussion
Long time to ‘Refresh’ data for a dynamically generated data source
Can you show the example syntax they provide when providing more than 1 ID in the call? I assume it is a comma separated list, but please confirm. How many IDs will you need to search on? If >50, you will have to do it in 50 id chunks (which is trickier but doable).
Please also look at the API documentation to see if there is a way to get all the data (e.g., instead of "?ids=..."). Are there other methods to more efficiently get all the data you want (e.g., ?status=). Can you share a link to the API documentation, so I can take a look directly?
Regards,
Pat
Hi mahoneypat : At the API portal- I haven't found any example to specify multiple ids. To test, I passed 2 ids [comma separated] and it returned the details info.
As mentioned earlier, they say max of 50 ids to pass. Below is spec fo the parameters for 'Id'
"parameters": [
{
"name": "ids",
"in": "query",
"description": "Genscape unique id for each maintenance event. This parameter will allow, at maximum, 50 values.",
"required": true,
"type": "string"
},
The link to the api portal is: https://developer.genscape.com/docs/services/natgas-notices-maintenance/operations/GetMaintenanceEvents/console
Many thanks in advance.
- mahoneypat6 years agoMicrosoft Employee
I wasn't able to look that the API documentation w/o an account to sign in. You can build your string of EventIDs with another query (you won't be using a parameter). Below is some example M code to show you how to go from a column of numbers (event IDs) in a table and turn it into a comma separated text list. You would then just reference that query to concatenate into your API call. Hopefully you have <= 50 event IDs to string together. If you have more, we'll have to break it into chucks of 50 and make multiple calls. It would be much better if you could find out there was a more efficient API method to call instead of by Event ID (is there a support person you could contact to ask?).
To see how it works, just create a blank query, go to Advanced Editor, and replace the text there with the M code below.
let Source = List.Numbers(10, 25,2), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}), Custom1 = Text.Combine(#"Changed Type"[Column1], ",") in Custom1The key part is the Custom1 step where it refers to the a single column in the previous step (which returns a list of those values, which are concatenated with a comma separator).
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years agoNot applicable
Hi mahoneypat : Thanks for your response.
1. Yes, it needs a login account for the API portal.
2, There are more than 50 event IDs to handle
3. There is a separate API to get all the event summary info, which I use first to get all the events (which gives me the event Ids). But I need the 2nd Api (event details) to get some info like location_id that the 1st Api doesn't have. The event Id is the primary key to join them together.
4. These are the 2 Apis available.
Thanks a lot for your help.