Ploi API
Ploi API

Create script

Create a script

POST api/scripts

Parameters

Parameter Type Status Description
label string required The label to recognize the script
user string required The user to run the script as (must be either 'ploi' or 'root'
content string required The content of the script to run

Example request:

curl -X POST "https://ploi.io/api/scripts" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{"label":"Echo Script", "user":"ploi", "content": "echo 123"}'

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "data": {
        "id": 1,
        "user": "ploi",
        "label": "Echo Script",
        "content": "echo 123",
        "created_at": "2019-08-07 11:21:02"
    }
}