Using the Site Factory API

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 jobs in your Site Factory Management Console.

Note

You cannot use the Acquia Cloud API to access or interact with Acquia Cloud Site Factory environments.

Obtaining your API key

Each of the Acquia Cloud Site Factory API calls requires you to enter your Acquia Cloud Site Factory username and API key to either complete the action or to return results. To obtain your API key, complete the following steps:

  1. Sign in to your Site Factory Management Console using an account with the platform admin role.
  2. In the admin menu, click your username.
  3. Click the API key tab.

Acquia Cloud Site Factory displays your API key. Because the key is required for use by the different Acquia Cloud 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 Acquia Cloud Site Factory API uses standard HTTP methods to communicate with the service, including GET, PUT, and POST. You can view the list of available Acquia Cloud 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 Acquia Cloud Site Factory interface):

https://[site_URL]/api/v1

You can also review complete documentation for all of the available Acquia Cloud Site Factory API methods by visiting the Acquia Cloud Site Factory API Reference or view customer Factory API examples.

Note

Anonymous users do not have permission to view all endpoints in the Site Factory API. To view all endpoints, sign in to your Site Factory Management Console before attempting to view the available endpoints.

Sample API methods

Here are some examples of the methods provided in the Acquia Cloud Site Factory API:

REST API call Description
groups Obtain a group listing, or create a group
ping Determine if the API is responding
sites Create, duplicate, or manage backups for a website
stage Start the staging process
status Obtain or modify the status of the factory
theme Send or process theme modifications
users Create, modify, list, or delete user accounts in the factory

For complete documentation, see the Acquia Cloud Site Factory API Reference.

Testing your connection

When you first start using the Acquia Cloud 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:

  1. Obtain your user account’s API key from the Site Factory Management Console.

  2. 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
  3. 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

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 Acquia Cloud 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

Contact supportStill need assistance? Contact Acquia Support

Acquia: Think Ahead

53 State Street, 10th Floor
Boston, MA 02109
United States
Phone: 888-922-7842

Map: Google Maps
View other locations