Site Factory includes a REST API that you can use to create and manage your hosted websites, and to obtain the status of jobs in your Site Factory Management Console.
Note
You cannot use the Cloud Platform API to access or interact with Site Factory environments.
Obtaining your API key
Each of the Site Factory API calls requires you to enter your Site Factory username and API key to either complete the action or to return results. To obtain your API key, complete the following steps:
Sign in to your Site Factory Management Console using an account with the platform admin role.
In the admin menu, click your username.
Click the API key tab.
Site Factory displays your API key. Due to the key being required for use by the different Site Factory API calls, save the key to a text file or some other secure location.
Site Factory API documentation access permissions
To view all documentation endpoints in the Site Factory API, you must first sign in to your Site Factory Management Console as a user with either the developer or release engineer role.
Attempting to access the Site Factory API as an anonymous user, or not having the appropriate role when signing in to the Site Factory Management Console, will cause the Site Factory API website to not display all available endpoints.
Using the REST API
Similar to many other APIs, the Site Factory API uses standard HTTP methods to communicate with the service, including GET, PUT, and POST.
After you ensure that you can access all of the
available endpoints in the Site Factory API, you can view the list of
API calls on your instance of Site Factory, along with specific
parameters and examples of their use, at the following URLs (where
[site_URL]
is the URL of your Site Factory interface):
https://[site_URL]/api/v1
https://[site_URL]/api/v2
You can also review complete documentation for all of the available Site Factory API methods by visiting the Site Factory API Reference or view customer Factory API examples.
Sample API methods
Here are some examples of the methods provided in the Site Factory API:
REST API call | Description |
---|---|
| Obtain a group listing, or create a group |
| Determine if the API is responding |
| Create, duplicate, or manage backups and third-party themes for a website |
| Start the staging process |
| Obtain or modify the status of the factory |
| Retrieve the deployment key, required by third-party theme repositories |
| Create, modify, list, or delete user accounts in the factory |
For complete documentation, see the Site Factory API Reference.
Testing your connection
When you first start using the Site Factory API, we encourage
you to use the ping
call to test your connection to the API. To do
this, complete the following steps:
Obtain your user account’s API key from the Site Factory Management Console.
Open a command prompt, and then enter the following command:
curl 'https://[site_URL]/api/v1/ping' -u [user_name]:[api_key]
where:
[site URL]
is the URL of your Site Factory Management Console[user_name]
is your Site Factory Management Console user account name[api_key]
is your user account’s API key from the Site Factory Management Console
Verify that the API call returns results similar to the following:
{"message":"pong","server_time":"2014-11-18T13:44:57+00:00"}
Using the REST API with staging environments
Staging environments do not have access to the SSL certificates
that are made available to production environments, so you must append the
-k
command line switch to your curl
command when you make calls
to a staging environment using the Site Factory API.
For example, using the ping
call on a staging environment would
require a command similar to the following:
curl 'https://[site_URL]/api/v1/ping' -u [user_name]:[api_key] -k
Resetting user API keys
Site Factory administrators can use the Site Factory Management Console or the Site Factory API to reset API keys of an individual user, or all users. Users can also reset their own API key. For more information, see Resetting API keys on Site Factory.