Files
domo-iot/docs/api/test-rest-api.md
NADAL Jean-Baptiste 8e7e94568f
All checks were successful
continuous-integration/drone/push Build is passing
Test outlet is now functional
2020-02-24 16:39:30 +01:00

1.3 KiB

Test all the REST API of domo.

Outlets

list

curl -v http://localhost:34000/v1/outlets
{
    "id": "",
    "outlets": [
        {
            "id": 1,
            "name": "Bureau JB",
            "sender": 12797322,
            "speech_name": "bureau",
            "state": true,
            "switch": 0
        },
        {
            "id": 2,
            "name": "Salon",
            "sender": 12797322,
            "speech_name": "salon",
            "state": false,
            "switch": 1
        },
        {
            "id": 3,
            "name": "Sapin",
            "sender": 12797322,
            "speech_name": "sapin",
            "state": false,
            "switch": 2
        }
    ],
    "response_code": 200,
    "status": "passed"
}

read

curl -v http://localhost:34000/v1/outlets/2
{
    "id": 2,
    "name": "Salon",
    "sender": 12797322,
    "speech_name": "salon",
    "state": false,
    "switch": 1
}

create

curl -X POST -v http://localhost:34000/v1/outlets -d "{\"name\":\"test\", \"sender\": 12797322, \"switch\": 4}"

update

curl -X PUT -v http://localhost:34000/v1/outlets/4 -d "{\"name\":\"test1\", \"sender\": 1, \"switch\": 2}"

delete

curl -v http://localhost:34000/v1/outlets/2