Skip to content
Menu
SilktideDevelopers

Set up a website before its first test

Create a website without testing it, configure it, then start its first test when it is ready.

View as Markdown

Create a website starts testing it straight away. That is right for most websites, but the first test then runs with the default settings. To change settings first, such as its languages, its tags or its metadata, create the website without testing it, configure it, then test it.

1. Create the website without testing it#

Send runNow: false and isReady: false inside website:

curl https://api.eu.silktide.com/v1/websites \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "website": {
      "name": "Fake University",
      "homeUrl": "https://fake-university.example/",
      "maxPages": 100,
      "maxDocuments": 100,
      "runNow": false,
      "isReady": false
    }
  }'

The response is the new website with website.status set to setup. Keep its websiteId. It is not tested until you ask.

You can also send settings in this same request, such as options, schedule, tagIds and website.metaValues. Create it in setup anyway when a later step needs its websiteId, or when someone else configures it before it goes live.

2. Configure it#

Make whatever other requests the website needs. For example:

curl -X PUT https://api.eu.silktide.com/v1/websites/6 \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "options": { "website.languages": ["en-GB"] },
    "tagIds": ["pre-production"]
  }'

The website stays in setup however many times you update it.

3. Test it#

When it is ready, test it:

curl -X POST https://api.eu.silktide.com/v1/websites/6/test \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

A successful request returns 201 with an empty body. The website's status becomes live, its first test starts, and from then on it is retested on its schedule. To wait for the test and read its scores, carry on from step 3 of Add a website and read its scores.