Hi @dmbantu,
I got the API request from the Network tab after going to the Maintenance app and then into Programs and clicking the program. In this example I got the API request for the Child Program. You could use a similar request and even add more fields for example I added the attribute ‘name’ to the organisation units.
URL in JSON
2.38.1/api/29/metadata.json?fields=:owner,displayName&programs:filter=id:eq:IpHINAT79UW&programs:fields=:owner,displayName,attributeValues[:all,attribute[id,name,displayName]],organisationUnits[id,name,path],dataEntryForm[:owner],programSections[id,name,displayName,renderType,program,sortOrder,lastUpdated,trackedEntityAttributes[id,name,displayName,sortOrder]],notificationTemplates[:owner],programTrackedEntityAttributes,user[id,name],publicAccess,userGroupAccesses,userAccesses,categoryCombo[id,name],programStages[:owner, publicAccess, userGroupAccesses, userAccesses, user[id,name],displayName,attributeValues[:all,attribute[id,name,displayName]],programStageDataElements[:owner,renderType,dataElement[id,displayName,valueType,optionSet,domainType]],notificationTemplates[:owner,displayName],dataEntryForm[:owner],programStageSections[:owner,displayName,dataElements[id,displayName]]]&dataElements:fields=id,displayName,valueType,optionSet&dataElements:filter=domainType:eq:TRACKER&trackedEntityAttributes:fields=id,displayName,valueType,optionSet,unique]
https://play.dhis2.org/2.38.1/api/29/metadata.json?fields=:owner,displayName&programs:filter=id:eq:IpHINAT79UW&programs:fields=:owner,displayName,attributeValues[:all,attribute[id,name,displayName]],organisationUnits[id,name,path],dataEntryForm[:owner],programSections[id,name,displayName,renderType,program,sortOrder,lastUpdated,trackedEntityAttributes[id,name,displayName,sortOrder]],notificationTemplates[:owner],programTrackedEntityAttributes,user[id,name],publicAccess,userGroupAccesses,userAccesses,categoryCombo[id,name],programStages[:owner, publicAccess, userGroupAccesses, userAccesses, user[id,name],displayName,attributeValues[:all,attribute[id,name,displayName]],programStageDataElements[:owner,renderType,dataElement[id,displayName,valueType,optionSet,domainType]],notificationTemplates[:owner,displayName],dataEntryForm[:owner],programStageSections[:owner,displayName,dataElements[id,displayName]]]&dataElements:fields=id,displayName,valueType,optionSet&dataElements:filter=domainType:eq:TRACKER&trackedEntityAttributes:fields=id,displayName,valueType,optionSet,unique)
However, even though the format is JSON it might not necessarily work as an import in another instance. It’d be very helpful if you could describe the use case.
Thanks! Hope this helps and if it does please mark this post as a solution