Hey everyone,
what's the most efficient way to get all forms for a specific program via the API nowadays?
Rgds,
Thorsten
Solved! Go to Solution.
Browse forms is filterable by folder/program.
Also note to self:
If your forms are within a sub-folder of the program, the call against the program ID
{"id": 71228,"type": "Program"}
will not return "all forms within the program" as - at least for me - it might be intuitively how it works.
No, you need to traverse the whole folder structure WITHIN the program first and check for each sub-folder individually to get all forms in x-number of API calls.
Now I remember why I initially asked for "efficient"... 😔
Got it. Thanks Sanford!
My confusion came from the fact that this option was not mentioned explicitly on (one part of) the documentation,
Get Forms forms works like other Asset API browse endpoints, and allows optional filtering on status, maxReturn, and offset. Status can be: approved, approved with draft, or draft.
but rather probably implied by the "works like other Asset API browse endpoints". Plus, I see now that it's mentioned in the API Reference docs. Well, lesson learned - always have to check both sources.
Note to my future self: works fine with:
{{baseUrl}}/rest/asset/v1/forms.json?folder={"id": 71228,"type": "Program"}
Again, thanks for the quick feedback!
Kind regards,
Thorsten
Also note to self:
If your forms are within a sub-folder of the program, the call against the program ID
{"id": 71228,"type": "Program"}
will not return "all forms within the program" as - at least for me - it might be intuitively how it works.
No, you need to traverse the whole folder structure WITHIN the program first and check for each sub-folder individually to get all forms in x-number of API calls.
Now I remember why I initially asked for "efficient"... 😔
Oh yeah, that. 🙂