Acquia Cloud Site Factory includes a REST API that you can use to create and manage your hosted websites and to obtain the status of your Site Factory interface's jobs.
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 interface using an account with the platform admin role.
- In the admin menu, click the Hello, [username] link, where [username] is your account name.
- Click the API key tab.
Acquia Cloud Site Factory displays your API key. Because the key is required for use by the different Site Factory API calls, save the key to a text file or some other secure location.
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. You can view the list of available Site Factory API calls on your instance of Acquia Cloud Site Factory, along with specific parameters and examples of their use, at the following URL (where
[site_URL] is the URL of your Site Factory interface):
You can also review complete documentation for all of the available Site Factory API methods by visiting the Site Factory API Reference.
Sample Site Factory 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 for a website|
||Start the staging process|
||Obtain or modify the status of the Site Factory|
||Send or process theme modifications|
||Create, modify, list, or delete user accounts in the Site 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 interface.
- Open a command prompt, and then enter the following command:
curl 'https://[site_URL]/api/v1/ping' -u [user_name]:[api_key]
[site URL]is the URL of your Site Factory interface
[user_name]is your Site Factory interface user account name
[api_key]is your user account's API key from the Site Factory interface
- Verify that the API call returns results similar to the following:
Using the REST API with staging environments
Because staging environments do not have access to the SSL certificates that are made available to production environments, 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