How to set up your CreativeHub account to use our REST API

Environments:

In parallel to our production environment, we also provide a sandbox environment to safely test the API. Below are the relevant urls for the different environments.

Production
CreativeHub: https://app.creativehub.io
REST API: https://api.creativehub.io
Documentation: https://api.creativehub.io/swagger
Sandbox
CreativeHub: https://app.sandbox.tps-test.io
REST API: https://api.sandbox.tps-test.io
Documentation: https://api.sandbox.tps-test.io/swagger

Prerequisites:

You need to have a CreativeHub account on the environment you want to use.

If you don’t have one, open your browser by clicking on the CreativeHub link above for the environment and follow the sign-up steps.

Step 1: Upload your high resolution images

Click on the Files item on the left menu. From here, upload your files using either and drag & drop or use the upload button.

Step 2: Set up your print options

Select the images you want to sell using the tick box in the top left of each file thumbnail. Next, click on Sell as print from the action panel on the right.

Next apply your print sales settings. To do this first click the + Add print button. Then price your artwork as follows:

Step 3: Set up your art store

In creativehub, your Art store is where your account settings which specifically focus on online art sales live. It is here you add your branding, billing details and the payment method for print production.

To access your art store, click on your account icon on the top right corner and select Art store settings.

Payment card for order fulfilment

We debit you for the print production costs through your creativehub account. In order to take this payment, a payment card must be present, which you can add via the ‘Payment settings’ page. Also add your VAT number if applicable.

Branding and store details

Our service is white label, meaning we ship your orders to your customers in unbranded packaging. On the shipping label you can also have your own store details and a logo included. To do this, complete the fields for ‘Branding & store details’

Limited edition certificates

Through creativehub you can sell your art as limited editions. Limited edition sales will include a certificate of authenticity which is shipped to the buyer along with the order. Add your artist name, digital signature and branding for the certificate here.

Step 4: Create the API key to use in your integration

To use our REST API you need to create an API key to identify your application.

To generate one, go to your Account settings and click on the API Keys on the left menu.
Insert a name to identify your application and click on the New Key button.
You’ll see the newly generated key by clicking on the eye symbol in the table close to the name you wrote. Use that key in the header of your api requests.

When you don’t need that key anymore you can revoke it by pressing on the Revoke button, and the key will not be valid anymore.

To use your key, add an Authorization header to your HTTP requests, with value ApiKey <yourkey>

Webhooks integration

You can add your webhook client endpoint to an API Key and events will be pushed to that endpoint
There is an example client endpoint in the swagger documentation
The body of each request will be an object derived from WebhookBase
Each request will have a HMAC code in the X-Creativehub-Signature HTTP header
This is calculated from the request body, so that you can verify the request came from creativehub
The key parameter is your API key and the url parameter is your webhook endpoint url

    public class WebhookBase
    {
        public string GetSignature(string key, string url)
        {
            var text = $"{url}:{Version}:{ApiWebhookKind}:{EventUtc:yyyy-MM-dd'T'HH:mm:ss'Z'}:{Salt}";
            var hmac = new HMACSHA1(Encoding.ASCII.GetBytes(key));
            var hash = hmac.ComputeHash(Encoding.ASCII.GetBytes(text));
            return Convert.ToBase64String(hash);
        }
    }