Menu

Calling the Sandscale sandbox API from Python with requests, no SDK
📰

Calling the Sandscale sandbox API from Python with requests, no SDK

DEV Community: api·Sandscale·10 days ago
#bG38HWjm
#devtoapi#devto#dev#self#path
Long article (1557 words) — no AI summary yet.
Reading 0:00
15s threshold

Sometimes you do not want an SDK in the dependency tree: a small script, a locked-down service, or a codebase that already wraps every HTTP call its own way. The sandbox API underneath our SDKs is plain HTTP and JSON, so from Python you can drive it with requests and under 80 lines of code. This post builds that client, explains the choices in it, and lists what to add before you lean on it in production.

Everything here comes from the sandbox API guide and the Sandboxes API reference . If something in this post and the reference disagree, trust the reference.

The five calls

A sandbox's whole life is five requests against https://api.sandscale.dev/api/v1/sandbox :

Step Request Permission

Start POST /instances sandboxes:create

Write a file PUT /instances/{id}/files sandboxes:use

Run a command POST /instances/{id}/exec sandboxes:use

Read a file or list a folder GET /instances/{id}/files?path=...…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.