Run a Block
Run a block using the same URL you visit on the web (username/block_name)
In the example below, the username is alanfriedman and block name is uppercase.
curl -X POST https://api.codeblox.io/alanfriedman/uppercase
-H "x-auth-token: YOUR_TOKEN_HERE"
-H "Content-Type: application/json"
-d '{"input": "String to uppercase"}'
Response
Success response:
{
response: "STRING TO UPPERCASE",
error: false
}
Error response:
{
response: "Some custom error message",
error: true
}
Options
Pass in block options as an object.
curl -X POST https://api.codeblox.io/alanfriedman/weather
-H "x-auth-token: YOUR_TOKEN_HERE"
-H "Content-Type: application/json"
-d '{"input": "New York", "options": { "Units": "F" } }'
More examples
Number input
... -d '{"input": 23}'
Location input
... -d '{"input":[35, -89]}'
Dictionary input
... -d '{"input": { "foo": "bar" } }'
Boolean input
... -d '{"input": true }'