Failed Response

The fail command is used to test an error condition.

An error of this type occurs, for example, when you attempt to register a domain that already exists.

JSON

HTTP request...

    POST /masterapi/server.php HTTP/1.0
    Host: reseller.forpsi.hu
    Content-Type: text/plain; charset=UTF-8
    Content-Length: 30
    Authorization: Basic R1I6VE9NRUs6dG90b19hc2lfbmVuaV9oZXNsbw==

    {"command":"fail","params":[]}

...and the response:

    HTTP/1.0 200 OK
    Date: Tue, 24 Sep 2013 11:54:47 GMT
    Server: Apache
    Content-Length: 99
    Connection: close
    Content-Type: text/json; charset=UTF-8

    {"status":"fail","message":"oops, something went wrong... in fact this is just a testing response"}

YAML

HTTP request...

    POST /masterapi/server.php HTTP/1.0
    Host: reseller.forpsi.hu
    Content-Type: text/plain; charset=UTF-8
    Content-Length: 30
    Authorization: Basic R1I6VE9NRUs6dG90b19hc2lfbmVuaV9oZXNsbw==

    ---
    command: fail
    params: []

...and the response:

    HTTP/1.0 200 OK
    Date: Tue, 24 Sep 2013 11:55:35 GMT
    Server: Apache
    Content-Length: 96
    Connection: close
    Content-Type: text/plain; charset=UTF-8

    ---
    status: fail
    message: oops, something went wrong... in fact this is just a testing response

PHP Client

    <?php
    $result = $client->sendCommand("fail");
    $result->isSuccess(); // false
    $result->isTemporaryError(); // false
    echo $result->getMessage(); // "oops, something went wrong... in fact this is just a testing response"
    print_r($result->getData()); // null