Service management

Index

List of all services

You can get info by user ID or by currently logged user if you use the string "self" ex.: https://rest.websupport.sk/v1/user/self/service

Curl

curl "https://rest.websupport.sk/v1/user/:id/service" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/service HTTP/1.1

Accept: application/json

Response 200

{
    "items":
    [
        {
            "id": 1111,
            "serviceName": ".sk doména",
            "status": "active",
            "name": "mydomain.sk",
            "createTime": 1374357600,
            "expireTime": 1405914526,
            "price": 12.3,
            "autoExtend": false
        },
        {
            "id": 2222,
            "serviceName": "The Hosting",
            "status": "active",
            "name": "myname_1",
            "createTime": 1400145443,
            "expireTime": 1431702371,
            "price": 55.2,
            "autoExtend": false
        },
    ],
    "pager":
    {
        "page": 1,
        "pagesize": null,
        "items": 2
    }
}

Get a service detail

Curl

curl "https://rest.websupport.sk/v1/user/:id/service/:serviceId" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/service/:serviceId HTTP/1.1

Accept: application/json

Response 200

{
    "id": 1111,
    "serviceName": ".sk doména",
    "status": "active",
    "name": "mydomain.sk",
    "createTime": 1374357600,
    "expireTime": 1405914526,
    "price": 12.3,
    "autoExtend": false
}

Update service

Parameters:

Name Type Required Comment
autoExtend bool no automaticaly pay service from credits before expiration

Curl

curl "https://rest.websupport.sk/v1/user/:id/service/:serviceId" -H "Content-Type: application/json" -H "Date: request_date_time" -X PUT \ 
 -d '{"autoExtend": true}' -u key:signature

Request

PUT https://rest.websupport.sk/v1/user/:id/service/:serviceId HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "autoExtend": true
}

Response 201 (success)

{
    "status": "success",
    "item":
    {
        "id": 1111,
        "serviceName": ".sk doména",
        "status": "active",
        "name": "mydomain.sk",
        "createTime": 1374357600,
        "expireTime": 1405914526,
        "price": 12.3,
        "autoExtend": true
    },
    "errors": {}
}

Response 200 (validation error)

{
    "status": "error",
    "item":
    {
        "id": 1111,
        "serviceName": ".sk doména",
        "status": "active",
        "name": "mydomain.sk",
        "createTime": 1374357600,
        "expireTime": 1405914526,
        "price": 12.3,
        "autoExtend": true
    },
    "errors":
    {
        "autoExtend":
        [
            "not boolean"
        ]
    }
}
raw