Generate a Data Set from a Template

Apex REST Example:

curl --location --request POST 'https://acme.my.salesforce.com/services/apexrest/PDRI/templates/dataset' \
--header 'Authorization: OAuth ***************************' \
--header 'Content-Type: application/json' \
--data-raw '{"templateId": "a0f0H00000IfEmm"}'
curl --location --request POST 'https://acme.my.salesforce.com/services/apexrest/PDRI/templates/plan' \
--header 'Authorization: OAuth ***************************' \
--header 'Content-Type: application/json' \
--data-raw '{"templateId": "a0f0H00000IfEmm"}'

Returns a JSON object. Any errors caught will have a message in the “error” property and the ID will be “dataSetId” or “deploymentPlanId” depending on which API was used.

{
    "error": null,
    "dataSetId": "a006S000016gp2sQAA"
}

Global Apex Example:

String dataSetId = PDRI.AppTemplateService.loadDataSetTemplateId('a0f0H00000IfEmm')

String deploymentPlanId = PDRI.AppTemplateService.loadDeploymentPlanTemplateId('a0f0H00000IfEmm')