Service management ================= Index ------------ - [List of all services](#services) - [Get a service detail](#service) - [Update service](#put-service) List of all services {#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 ```sh curl "https://rest.websupport.sk/v1/user/:id/service" -v -u key:signature -H "Date: request_date_time" ``` >Request ```http GET https://rest.websupport.sk/v1/user/:id/service HTTP/1.1 Accept: application/json ``` >Response `200` ```json { "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 {#service} ------------------------------- >Curl ```sh curl "https://rest.websupport.sk/v1/user/:id/service/:serviceId" -v -u key:signature -H "Date: request_date_time" ``` >Request ```http GET https://rest.websupport.sk/v1/user/:id/service/:serviceId HTTP/1.1 Accept: application/json ``` >Response `200` ```json { "id": 1111, "serviceName": ".sk doména", "status": "active", "name": "mydomain.sk", "createTime": 1374357600, "expireTime": 1405914526, "price": 12.3, "autoExtend": false } ``` Update service {#put-service} ----------------------------- #### Parameters: | Name | Type | Required | Comment | |-------------|--------|----------|--------------------------------------| | autoExtend | bool | no | automaticaly pay service from credits before expiration | >Curl ```sh 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 ```http 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) ```json { "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) ```json { "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" ] } } ```