
To match our newly improved main website, we’ve launched a new home for our developer documentation. It sits alongside our main docs, and it’s faster, easier to search and simpler to navigate.
What’s new:
- New Developer Documentation space
- New
http.patchPlayground function - New
http.respondWebhookPlayground function
New http.patch action
Playground scripts can now send HTTP PATCH requests, alongside the existing GET and POST methods.
await http.patch(url, queryData, "json", requestOptions);
Full details available here: http.patch
New http.respondWebhook action
Until now, a webhook call into your script was one-way. With http.respondWebhook, your script can answer the caller directly, and the caller gets your reply in its own HTTP response.
await http.respondWebhook(correlationId, payload);
The correlationId comes from the playground_webhook event you’re answering. The caller needs to include "waitResponse": true in its JSON body, and your script has 30 seconds to reply.
This makes it possible to use your bot as a live data source: a website or in-world object can ask your script a question over HTTP and get the answer back in the same request!
Full details available here: http.respondWebhook
A reminder: back up your scripts
In case you missed it, Playground can back up your scripts automatically to a private GitHub repository. Connect your GitHub account once, and every script is backed up 5 minutes after you save a change.
If you haven’t set it up yet, it takes just a minute: Backing up scripts
If you have any questions about the new functions or the new docs, you can always chat in our dedicated #dev-support Discord channel.
Happy scripting!
Discussion
0No comments yet. Start the conversation.
Login to your SmartBots account to post a comment