Newer Version Available

This content describes an older version of this product. View Latest

SignupRequest

Represents a request for a new Trialforce signup. This object is available in API version 27.0 and later.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete()

Fields

Field Name Details
AuthCode
Type
string
Properties
Create, Filter, Group, Sort
Description
A one-time authorization code that can be exchanged for an OAuth access token and refresh token using standard Salesforce APIs. It’s used in conjunction with ConnectedAppCallbackUrl and ConnectedAppConsumerKey, when the specified connected app hasn't been configured with an X.509 certificate. This is a read-only field provided by the system once the signup request has been processed. This field is available in API version 29.0 and later.
Company
Type
string
Properties
Create, Filter, Group, Sort
Description
The name of the company requesting the trial signup.
ConnectedAppCallbackUrl
Type
string
Properties
Create, Filter, Group, Sort
Description
When used in conjunction with ConnectedAppConsumerKey, specifies a connected app that should be approved automatically during the signup creation. This field is available in API version 28.0 and later.
ConnectedAppConsumerKey
Type
string
Properties
Create, Filter, Group, Sort
Description
When used in conjunction with ConnectedAppCallbackUrl, specifies a connected app that should be approved automatically during the signup creation. This field is available in API version 28.0 and later.
Country
Type
string
Properties
Create, Filter, Group, Sort
Description
The two-character, upper-case ISO-3166 country code. You can find a full list of these codes at a number of sites, such as: www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html. The language of the trial organization is auto-determined based on the value of this field.
CreatedOrgId
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The 15–character organization ID of the trial organization created. This is a read-only field provided by the system once the signup request has been processed.
CreatedOrgInstance
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The server instance of the new trial organization, for example, “na8.” This field is available in API version 29.0 and later.
ErrorCode
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The error code if the signup request isn’t successful. This is a read-only field provided by the system to be used for support purposes.
FirstName
Type
string
Properties
Create, Filter, Nillable, Sort
Description
The first name of the admin user for the trial signup.
LastName
Type
string
Properties
Create, Filter, Group, Sort
Description
The last name of the admin user for the trial signup.
SignupEmail
Type
email
Properties
Create, Filter, Group, Sort
Description
The email address of the admin user for the trial signup.
Status
Type
picklist
Properties
Filter, Group, Sort, Update
Description
The status of the request. Possible values are New, In Progress, Error, or Success. The default value is New.
Subdomain
Type
string
Properties
Create, Filter, Group, Sort
Description
The subdomain for the new trial organization when it uses a custom My Domain. The maximum length is 33 characters for Developer Edition (DE) and 40 characters for all other editions (because a suffix is appended to all DE organizations).
SuppressSignupEmails
Type
boolean
Properties
Filter, Group, Nillable, Sort
Description
When set to true, no signup emails are sent when the trial organization is created. This field is used for the Proxy Signup feature, and is available in API version 29.0 and later.
TemplateId
Type
string
Properties
Create, Filter, Group, Sort
Description
The 15–character ID of the approved Trialforce template that is the basis for the trial signup. The template is required and must be approved by salesforce.com.
TrialDays
Type
anyType
Properties
Create, Defaulted on create, Filter, Group, Sort
Description
The duration of the trial signup in days. Must be equal to or less than the trial days for the approved Trialforce template. If not provided, it defaults to the trial duration specified for the Trialforce template.
TrialSourceOrgId
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The 15–character organization ID of the Trialforce Source Organization from which the Trialforce template was created.
Username
Type
string
Properties
Create, Filter, Group, Sort
Description
The username of the admin user for the trial signup. It must follow the address convention specified in RFC822: www.w3.org/Protocols/rfc822/#z10

Usage

The Java class below uses the REST API to create a SignupRequest object. It authenticates to the Trialforce Management Organization and then posts a request to the SignupRequest object.

Here are the variables you need to specify in this example.
  • SERVER — The name of the host server for the Trialforce Management Organization (TMO), for example, “na1.salesforce.com.”
  • USERNAME — The admin username for the TMO.
  • PASSWORD — The concatenation of the admin password and the security token for the TMO. To get an email with the security token, from your personal settings in Salesforce select Reset My Security Token and click Reset Security Token.  
  • CLIENT_ID — From Setup in Salesforce, click Create | Apps and click New under Connected Apps. Enter values for the required fields (the Callback URL is required but can initially be set to any valid URL as it's not used), grant full access for the OAuth scopes in the "Selected OAuth Scopes" selector, and click Save. Then copy the value of “Consumer Key” and use it for this variable.
  • CLIENT_SECRET — On the same page, click Click to reveal. Then copy the value of "Consumer Secret" and use it for this variable.
1public class IsvSignupDriver {
2    private static final String SERVER = server_name:port;
3    private static final String USERNAME = tmo_username;
4    private static final String PASSWORD = tmo_passwordsecurity_token;
5    private static final String CLIENT_ID = consumer_key;
6    private static final String CLIENT_SECRET = consumer_secret;
7
8    private static SignupRequestInfo signupRequest = null;
9    
10    public static String createSignupRequest (SignupRequestInfo sr)
11      throws JSONException, IOException {
12    	  JSONObject createResponse = null;
13    	  signupRequest = sr;
14    	  JSONObject loginResponse = login(SERVER, USERNAME, PASSWORD);
15    	  String instanceUrl = loginResponse.getString("instance_url");
16    	  String accessToken = loginResponse.getString("access_token");
17    	  createResponse = create(instanceUrl, accessToken);
18    	  System.out.println("Created SignupRequest object: " + createResponse + "\n"); 
19    	  return createResponse.toString();
20    }
21
22    /* Authenticates to the TMO using the required credentials */
23
24    private static JSONObject login(String server, String username, String password)
25      throws ClientProtocolException, IOException, JSONException {
26        String authEndPoint = server + "/services/oauth2/token";
27        HttpClient httpclient = new DefaultHttpClient();
28        try {
29            HttpPost post = new HttpPost(authEndPoint);
30
31            List<NameValuePair> params = new ArrayList<NameValuePair>();
32            params.add(new BasicNameValuePair("grant_type", "password"));
33            params.add(new BasicNameValuePair("client_id", CLIENT_ID));
34            params.add(new BasicNameValuePair("client_secret", CLIENT_SECRET));
35            params.add(new BasicNameValuePair("username", username));
36            params.add(new BasicNameValuePair("password", password));
37            post.setEntity(new UrlEncodedFormEntity(params, Consts.UTF_8));
38
39            BasicResponseHandler handler = new BasicResponseHandler();
40            String response = httpclient.execute(post, handler);
41            return new JSONObject(response);
42        } finally {
43            httpclient.getConnectionManager().shutdown();
44        }
45    }
46    /* Posts a request to the SignupRequest object */
47
48    private static JSONObject create(String instanceUrl, String accessToken)
49      throws ClientProtocolException, IOException, JSONException {
50        HttpClient httpClient = new DefaultHttpClient();
51        try {
52            HttpPost post = new HttpPost(instanceUrl +
53              "/services/data/v27.0/sobjects/SignupRequest/");
54                post.setHeader("Authorization", "Bearer " + accessToken);
55                post.setHeader("Content-Type", "application/json");
56            
57                JSONObject requestBody = new JSONObject();
58                requestBody.put("TemplateId", signupRequest.getTemplateID());
59                requestBody.put("SignupEmail", signupRequest.getEmail());
60                requestBody.put("username", signupRequest.getUsername());
61                requestBody.put("Country", "US");
62                requestBody.put("Company", signupRequest.getCompanyName());
63                requestBody.put("lastName", signupRequest.getLastName());        
64
65                StringEntity entity = new StringEntity(requestBody.toString());
66                post.setEntity(entity);
67                BasicResponseHandler handler = new BasicResponseHandler();
68                String response = httpClient.execute(post, handler);
69                return new JSONObject(response);
70        } finally {
71            httpClient.getConnectionManager().shutdown();
72        }
73    }
74}

Error Codes

If the signup fails, the system generates an error code that can help you identify the cause. This table shows the most important error codes.

Error Code Description
C-1007 Duplicate username.
C-1015 Error while establishing the new organization's My Domain settings. Contact salesforce.com support for assistance.
C-1016 Error while configuring the OAuth connected app for Proxy Signup. Verify that your connected app has a valid consumer key, callback URL, and unexpired certificate (if applicable).
C-1018 Invalid subdomain value provided during signup.
C-1019 Subdomain in use. Please choose a new subdomain value.
C-9999 Generic “fatal error.” Contact salesforce.com support for assistance.
S-1006 Invalild email address (not in a proper email address format).
S-2006 Invalid country code.
T-0001 Template ID not valid (not in the format 0TTxxxxxxxxxxxx).
T-0002

Template not found. Either the template doesn't exist (it may have been deleted), or it doesn't exist at the appropriate version.

T-0003 Template not approved for use by salesforce.com.