function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jason Dodds CodeScienceJason Dodds CodeScience 

Using SignupRequest API without Trialforce

We are building some functionality in Apex that utilizes the SignupRequest API to spin up orgs for continuous integration.  I know SignupRequest was conceived as a programmatic feature to create Trialforce orgs, but is your org (where the Apex is being called from) required to be a TSO in order to use the SignupRequest API?  It seems like you should be able to use the SignupRequest without the need for a Trialforce template from an org with Environment Hub enabled, which we do.
Daniel BallingerDaniel Ballinger
Just going off the documentation in SignupRequest (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_signuprequest.htm), but wouldn't you need a Trailforce TemplateId that is defined in the TSO? If you don't have an active session to the TSO then it won't be able to access the Template record.
Jason Dodds CodeScienceJason Dodds CodeScience
Yeah, we have confirmed that the templateid is required, but we don't want to use a template.  In an ideal state, we want to just spin up a new blank org, but that doesn't seem feasible currently.
Christian Dylan CarterChristian Dylan Carter
Good news, as of API v35.0, you can do this! You can pass an english string into the field SignupRequest.Edition with the name of the standard template you want to spin up. "Partner Developer" and "Partner Enterprise" are the two templates I find myself using most, the full set is documented in the SOAP API reference that Daniel posted above.

If you pass in the Consumer Key and Callback URL for a Salesforce Connected App that has the `full` and `refresh_token` scopes, you'll also recieve an AuthCode on completion of the org provisioning that you can exchange for an auth token and make API calls against. If you pass an invalid Connected App, the entire provisioning process will fail.