Create a sandbox from a property

Create a sandbox by referencing a property that has already been configured in Property Manager.

Before you begin

To create a sandbox this way, you need to have an existing property configured on the CDN.

To create a sandbox from a property, simply include a hostname in the JSON request body.

How to

  1. Form a JSON body that references a hostname contained in your property configuration and include a meaningful name for your sandbox.
    {  
        "property":{  
            "hostname":"www.example.com"
        },
        "name":"dev1_sandbox"
    } 
  2. Issue a POST request.
    /sandbox-api/v1/sandboxes
    The response body includes important information about your sandbox.
    {
        "sandboxId": "2956207f-854e-11e8-898a-0242ac110002",
        "createdBy": "joe@example.com",
        "createdOn": "2018-10-09T15:20:36.441Z",
        "name": "dev1_sandbox",
        "jwtToken": "eyJ0eXA ... qggqqw",
        "isClonable": true,
        "status": "OK",
        "properties": [
            {
                "sandboxPropertyId": "e7b77afe-271b-4159-bdd1-c312ef560cdb",
                "requestHostnames": [
                    "shop.exampledevops.com",
                    "info.abc1234def.com"
                ],
                "additionalRequestHostnamesInProperty": [
                    "www.abc1234def.com"
                ],
                "_links": {
                    "property": {
                        "href": "/sandbox-api/v1/sandboxes/2956207f-854e-11e8-898a-0242ac110002/properties/e7b77afe-271b-4159-bdd1-c312ef560cdb"
                    },
                    "rules": {
                        "href": "/sandbox-api/v1/sandboxes/2956207f-854e-11e8-898a-0242ac110002/properties/e7b77afe-271b-4159-bdd1-c312ef560cdb/rules"
                    }
                }
            }
        ],
        "_links": {
            "self": {
                "href": "/sandbox-api/v1/sandboxes/2956207f-854e-11e8-898a-0242ac110002"
            },
            "rotateJWT": {
                "href": "/sandbox-api/v1/sandboxes/2956207f-854e-11e8-898a-0242ac110002/rotateJWT"
            },
            "clone": {
                "href": "/sandbox-api/v1/sandboxes/2956207f-854e-11e8-898a-0242ac110002/clone"
            }
        }
    }
    You can use the href links to perform actions on the sandbox.

Next steps

Copy the jwtToken in the response object. You need this to configure Sandbox Client.
Note: The jwtToken is valid for thirty days. To generate a new one, rotate the JSON Web Token (JWT).