Get Forms per Program | Community
Skip to main content
Thorsten
Level 3
March 5, 2025
Solved

Get Forms per Program

  • March 5, 2025
  • 1 reply
  • 979 views

Hey everyone,

what's the most efficient way to get all forms for a specific program via the API nowadays?

Rgds,

Thorsten

 

Best answer by SanfordWhiteman

Browse forms is filterable by folder/program.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
March 5, 2025

Browse forms is filterable by folder/program.

Thorsten
ThorstenAuthor
Level 3
March 6, 2025

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 statusmaxReturn, 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

 

Thorsten
ThorstenAuthor
Level 3
March 21, 2025

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"... 😔