Save bot to scratch

Saves the specified bot code code to scratch space. This can be done to store a draft copy of the code, or in preparation for saving a versioned copy of the bot code.

Resource URL:

PUT https://api.essential.to/bots/v1/scratch/{bot_sid}

Resource information:

Response formatJSON
Requires authentication?Yes

Parameters:

source
required

Code to save.

Sample code:

curl -X PUT \
 -u '[SID]:[TOKEN]' \
 -H 'Content-Type: application/json' \
 'https://api.essential.to/bots/v1/scratch/M023pJRT9yNmt-5RjTQBwQ' \
 -d '{"source": "var bot = {};"}'

# Sample response
{
  "version_id": 0,
  "source": "var bot = {};",
  "created_at": "2017-02-22T22:18:10.000Z",
  "updated_at": "2017-02-22T22:58:27.955Z",
  "sid": "tcshms-zuQVC039NSULS3A",
  "bot_sid": "M023pJRT9yNmt-5RjTQBwQ"
}
Python coming soon.
Node coming soon.