NAV Navbar
shell csharp

Introduction

Welcome to the WIFIPLUG API!

We have built a client library for this API in C# - we plan to build libraries for Java, Python and NodeJS shortly. To find the official client libraries check out our GitHub.

Overview

Base URI: https://api.wifiplug.co.uk/v1.0

You must use HTTPS to interact with this API.

This API currently only accepts and returns JSON. In the future we plan to support XML.

Versioning

Version control in this API is established through the URI.

Members of our development program will recieve emails when new versions of this API are released. Each previous version for non-enterprise customers, unless otherwise specified, will then be deprecated after six months.

Authentication

curl "https://api.wifiplug.co.uk/v1.0"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"

Make sure to replace key with your API key, secret with your API secret.

The WIFIPLUG API uses headers to establish access. To make any request to the API you must provide these headers every time: X-Api-Key: key and X-Api-Secret: secret

Personal API Keys

If you have API keys that are issued just for your account (personal API keys) then you do not need to perform any further authentication.

OAuth2

curl "https://api.wifiplug.co.uk/v1.0"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Authentication: Bearer {token}"
ApiClient client = new ApiClient("key", "secret")
client.Authentication = new BearerAuthentication("token");

If you have API keys issued for a third party application then you must used OAuth2 to authenticate with our services. You must provide an OAuth2 Bearer token in the header: Authorization: Bearer {token}

Devices

Get Devices

curl "https://api.wifiplug.co.uk/v1.0/device"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var devices = await client.Devices.ListDevicesAsync();

foreach(var device in devices) {
  Console.WriteLine($"Device: {device.Name} IsOnline: {device.IsOnline}");
}

This command returns JSON structured like this:

{
    "devices": [
        {
            "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
            "name": "WIFIPLUG-HOME-D2F2",
            "mac_address": "7C7A5303D2F2",
            "model": "WPHOME17L",
            "type": "HOME",
            "user_count": 1,
            "firmware_version": "1.1.5",
            "services": [
                {
                    "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
                    "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                    "caption": "",
                    "characteristics": [
                        {
                            "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
                            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                            "value": true
                        }
                    ]
                },
                {
                    "uuid": "be71efb8-3917-4e0c-904f-067f1b93dda5",
                    "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
                    "caption": "",
                    "characteristics": [
                        {
                            "uuid": "1da8074e-b301-49b2-a322-7dc2ddad63bb",
                            "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
                            "value": 0
                        },
                        {
                            "uuid": "ae484d8a-0026-42b5-bdf7-8df87baa922b",
                            "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
                            "value": 246.484375
                        },
                        {
                            "uuid": "5c72223f-8b5e-430d-81a0-946927d36615",
                            "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
                            "value": 0.01953125
                        }
                    ]
                }
            ],
            "is_online": true
        },
        {
            "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
            "name": "Air Conditioner",
            "mac_address": "7C7A5303D318",
            "model": "WPHOME17L",
            "type": "HOME",
            "user_count": 3,
            "firmware_version": "1.1.5",
            "services": [
                {
                    "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                    "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                    "caption": "",
                    "characteristics": [
                        {
                            "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                            "value": true
                        }
                    ]
                },
                {
                    "uuid": "966c8732-57d1-47f1-bb19-2cbccbfcaf3d",
                    "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
                    "caption": "",
                    "characteristics": [
                        {
                            "uuid": "3978e125-7aa2-4c42-818e-383b1427b5ba",
                            "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
                            "value": 0
                        },
                        {
                            "uuid": "a6ba543e-07f9-4125-970f-b45dc42dfe5b",
                            "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
                            "value": 246.453125
                        },
                        {
                            "uuid": "84c539cc-b80f-49d5-903c-dcd3cb7e8bc4",
                            "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
                            "value": 0
                        }
                    ]
                }
            ],
            "is_online": true
        }
    ],
    "cursor": null,
    "total_device_count": 2
}

This endpoint retrieves the devices your user has access to.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device

Query Parameters

Parameter Required Description Default Misc
limit False The maximum number of items you will get back. 50 Minimum: 1, Maximum 100
cursor False The cursor to the next set of results if there are more results than the limit.

Responses

200 OK - List of device objects.

Get a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/96dfe374-c732-4e45-af08-63b289704e49"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var device = await client.Devices.GetDeviceAsync(new Guid("96dfe374-c732-4e45-af08-63b289704e49"));

This command returns JSON structured like this:

{
    "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
    "name": "WIFIPLUG-HOME-D2F2",
    "mac_address": "7C7A5303D2F2",
    "model": "WPHOME17L",
    "type": "HOME",
    "user_count": 1,
    "firmware_version": "1.1.5",
    "services": [
        {
            "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
            "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
            "caption": "",
            "characteristics": [
                {
                    "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
                    "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                    "value": true
                }
            ]
        },
        {
            "uuid": "be71efb8-3917-4e0c-904f-067f1b93dda5",
            "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
            "caption": "",
            "characteristics": [
                {
                    "uuid": "1da8074e-b301-49b2-a322-7dc2ddad63bb",
                    "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
                    "value": 0
                },
                {
                    "uuid": "ae484d8a-0026-42b5-bdf7-8df87baa922b",
                    "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
                    "value": 246.484375
                },
                {
                    "uuid": "5c72223f-8b5e-430d-81a0-946927d36615",
                    "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
                    "value": 0.01953125
                }
            ]
        }
    ],
    "is_online": true
}

This endpoint will return a device that matches the UUID you provide.

HTTP Requst

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.

Responses

200 OK - Device object.

404 Not Found - That device could not be found.

Edit a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/96dfe374-c732-4e45-af08-63b289704e49"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"name" : "Test"}'
var client = new ApiClient("key", "secret");

var device = await client.Devices.EditDeviceAsync(new Guid("96dfe374-c732-4e45-af08-63b289704e49"), new DeviceEditEntity() {
  Name = "Test"
});

This command returns JSON structured like this:

{
    "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
    "name": "Test",
    "mac_address": "7C7A5303D2F2",
    "model": "WPHOME17L",
    "type": "HOME",
    "user_count": 1,
    "firmware_version": "1.1.5",
    "services": [
        {
            "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
            "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
            "caption": "",
            "characteristics": [
                {
                    "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
                    "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                    "value": true
                }
            ]
        },
        {
            "uuid": "be71efb8-3917-4e0c-904f-067f1b93dda5",
            "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
            "caption": "",
            "characteristics": [
                {
                    "uuid": "1da8074e-b301-49b2-a322-7dc2ddad63bb",
                    "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
                    "value": 0
                },
                {
                    "uuid": "ae484d8a-0026-42b5-bdf7-8df87baa922b",
                    "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
                    "value": 246.484375
                },
                {
                    "uuid": "5c72223f-8b5e-430d-81a0-946927d36615",
                    "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
                    "value": 0.01953125
                }
            ]
        }
    ],
    "is_online": true
}

This endpoint will allow you to change the name of a device.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.

Body Contents

Parameter Required Type Description
name True string The device's new name.

Responses

200 OK - Device object.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - You do not have permission to perform that action.

404 Not Found - That device could not be found.

Delete a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl -X DELETE "https://api.wifiplug.co.uk/v1.0/device/96dfe374-c732-4e45-af08-63b289704e49"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

await client.Devices.DeleteDeviceAsync(new Guid("96dfe374-c732-4e45-af08-63b289704e49"));

This endpoint will allow you to delete a device from your account.

HTTP Request

DELETE https://api.wifiplug.co.uk/v1.0/device/{device_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.

Responses

204 No Content - Device has been deleted.

403 Forbidden - You do not have permission to perform that action.

404 Not Found - That device could not be found.

Get Users on a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/96dfe374-c732-4e45-af08-63b289704e49/user"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var users = await client.Devices.ListDeviceUsersAsync(new Guid("96dfe374-c732-4e45-af08-63b289704e49"));

foreach (var user in users) {
  Console.WriteLine($"User: {user.User.EmailAddress} IsOwner: {user.IsOwner}");
}

This command returns JSON structured like this:

{
    "users": [
        {
            "user": {
                "uuid": "6a760125-9b87-4da4-874b-5886e2af7589",
                "username": "wifiplug_developer",
                "email_address": "developer@wifiplug.co.uk",
                "given_name": "WIFIPLUG",
                "family_name": "DEVELOPER"
            },
            "owner": true
        }
    ],
    "cursor": null,
    "total_user_count": 1
}

This endpoint will return the users on a device.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/user

URL Parameters

Parameter Description
device_uuid A Device UUID.

Query Parameters

Parameter Required Description Default Misc
limit False The maximum number of items you will get back. 25 Minimum: 1, Maximum 50
cursor False The cursor to the next set of results if there are more results than the limit.

Responses

200 OK - List of device objects.

404 Not Found - That device could not be found.

Add a User to a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/96dfe374-c732-4e45-af08-63b289704e49/user/add"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"username": "sales@wifiplug.co.uk"}'
var client = new ApiClient("key", "secret");

var user = await client.Devices.AddDeviceUserAsync(new Guid("96dfe374-c732-4e45-af08-63b289704e49"), new DeviceUserAddEntity() {
  Username = "sales@wifiplug.co.uk"
});

This command returns JSON structured like this:

{
    "user": {
        "uuid": "092edcf1-c897-4849-91fc-df13c5ef8430",
        "username": "sales@wifiplug.co.uk",
        "email_address": "sales@wifiplug.co.uk",
        "given_name": "",
        "family_name": ""
    },
    "owner": true
}

This endpoint allows you to add a user to a device.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/user/add

URL Parameters

Parameter Description
device_uuid A Device UUID.

Body Contents

Parameter Required Type Description
username True string The username of the user you want to add to the device. It must be a valid WIFIPLUG user.

Responses

200 OK - Object containing a user object and owner status.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - That user does not have permission to add users to this device.

404 Not Found - That device could not be found.

Remove a User from a Device

Don't forget to replace the Device UUID and User UUID with one on your account, otherwise you will get a 404.

curl -X DELETE "https://api.wifiplug.co.uk/v1.0/device/96dfe374-c732-4e45-af08-63b289704e49/user/092edcf1-c897-4849-91fc-df13c5ef8430"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

await client.Devices.DeleteDeviceUserAsync(new Guid("96dfe374-c732-4e45-af08-63b289704e49"), new Guid("092edcf1-c897-4849-91fc-df13c5ef8430"));

This endpoint allows you to remove a user from a device.

HTTP Request

DELETE https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/user/{user_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
user_uuid The Users UUID.

Responses

204 No Content - User has been removed from the device.

403 Forbidden - You do not have permission to remove this user.

404 Not Found - That device could not be found.

Get Services in a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var services = await client.Devices.ListDeviceServicesAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"));

foreach(var service in services) {
  Console.WriteLine($"Service: {service.UUID} Characteristics: {service.Characteristics.Length}");
}

This command returns JSON structured like this:

[
    {
        "uuid": "38946955-846f-4e4d-85b1-6cf40b5d2714",
        "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
        "caption": "Gang 1",
        "characteristics": [
            {
                "uuid": "1ec26e26-4bbd-4788-8ff6-53a62ae6d9f2",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        ]
    },
    {
        "uuid": "4459dd01-6095-4ee8-a53a-5dda60d36faf",
        "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
        "caption": "Gang 2",
        "characteristics": [
            {
                "uuid": "35708977-b92d-4558-be2f-31a074485223",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        ]
    },
    {
        "uuid": "6cc73f39-da22-4f8a-ba15-5bb83b097ce3",
        "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
        "caption": "gang 3",
        "characteristics": [
            {
                "uuid": "0b1d7915-e948-4b8c-b4fa-3022a0f2ff2a",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        ]
    }
]

This endpoint will return the services on a device.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service

URL Parameters

Parameter Description
device_uuid A Device UUID.

Responses

200 OK - List of service objects.

404 Not Found - That device could not be found.

Get a Specific Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var service = await client.Devices.GetDeviceServiceAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"));

This command returns JSON structured like this:

{
    "uuid": "38946955-846f-4e4d-85b1-6cf40b5d2714",
    "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
    "caption": "Gang 1",
    "characteristics": [
        {
            "uuid": "1ec26e26-4bbd-4788-8ff6-53a62ae6d9f2",
            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
            "value": false
        }
    ]
}

This endpoint will return a service on a device.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Responses

200 OK - A service object.

404 Not Found - That device could not be found.

Edit a Caption on a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"caption": "Test"}'
var client = new ApiClient("key", "secret");

var service = await client.Devices.EditDeviceServiceAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"), new DeviceServiceEditEntity() {
  Caption = "wow"
});

This command returns JSON structured like this:

{
    "uuid": "38946955-846f-4e4d-85b1-6cf40b5d2714",
    "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
    "caption": "Test",
    "characteristics": [
        {
            "uuid": "1ec26e26-4bbd-4788-8ff6-53a62ae6d9f2",
            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
            "value": false
        }
    ]
}

This endpoint will allow you to change a caption on a service. Not all services can have captions. If there is more than one controllable service inside a device you may use captions - otherwise names are held exclusively on the device level.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.
Parameter Required Type Description
caption True string The new caption for the service.

Responses

200 OK - A service object with the new caption.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - You do not have permission to change service.

404 Not Found - That device could not be found.

Control a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714/control"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"state": true}'
var client = new ApiClient("key", "secret");

var result = await client.Devices.ControlDeviceServiceAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"), new ControlEntity() {
  State = true
});

This command returns JSON structured like this:

{
    "uuid": "38946955-846f-4e4d-85b1-6cf40b5d2714",
    "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
    "caption": "Test",
    "characteristics": [
        {
            "uuid": "1ec26e26-4bbd-4788-8ff6-53a62ae6d9f2",
            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
            "value": true
        }
    ]
}

This endpoint will allow you to change the state of a service. States can be true or false. You must be targeting a controllable service to use this endpoint.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/control

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Body Contents

Parameter Required Type Description
state True boolean The new state for the service.

Responses

200 OK - A service object with the new state.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - You do not have permission to change the service state.

404 Not Found - That device could not be found.

Toggle a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714/toggle"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var result = await client.Devices.ToggleDeviceServiceAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"));

This command returns JSON structured like this:

{
    "uuid": "38946955-846f-4e4d-85b1-6cf40b5d2714",
    "type_uuid": "5d956555-7890-4c07-b55f-a34e230b6f9c",
    "caption": "Test",
    "characteristics": [
        {
            "uuid": "1ec26e26-4bbd-4788-8ff6-53a62ae6d9f2",
            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
            "value": false
        }
    ]
}

This endpoint will allow you to change the state of a service to the opposite of what it is currently. You do not need to provide a new state in the body. You must be targeting a controllable service to use this endpoint.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/toggle

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Responses

200 OK - A service object with the new state.

403 Forbidden - You do not have permission to change the service state.

404 Not Found - That device could not be found.

Boost a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714/boost"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"duration": 120}'
var client = new ApiClient("key", "secret");

var timer = await client.Devices.BoostDeviceServiceAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"), new BoostEntity() {
  Duration = 120
});

This command returns JSON structured like this:

{
    "uuid": "54e0c96f-c468-4086-8a68-9149f8344b81",
    "repeats": {
        "monday": false,
        "tuesday": false,
        "wednesday": false,
        "thursday": false,
        "friday": false,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-13T12:28:44Z",
    "items": [
        {
            "entity": {
                "uuid": "2ee79521-96be-4d52-ae44-63fb7d053e28",
                "name": "WIFIPLUG-HOME-D61C",
                "mac_address": "7C7A5303D61C",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 1,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "type": "device"
        }
    ],
    "action": false
}

This endpoint will allow you to boost a service in a device. Boosting a service will turn it on and schedule a timer to turn it off after a duration of time. You must be targeting a controllable service to use this endpoint.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/boost

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Body Contents

Parameter Required Type Description Misc
duration True integer The new state for the service. Minimum: 1, Maximum: 3600

Responses

200 OK - A timer object.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - You do not have permission to change the service state.

404 Not Found - That device could not be found.

Get the Live Energy Data from a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl "https://api.wifiplug.co.uk/v1.0/device/2ee79521-96be-4d52-ae44-63fb7d053e28/service/81e43935-666a-48d0-9bc5-f4b65ef40ee3/energy"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var energy = await client.Devices.GetDeviceServiceEnergyAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"));

Console.WriteLine($"Voltage: {energy.Voltage}V Current: {energy.Current}A Power: {energy.Power}W");

This command returns JSON structured like this:

{
    "current": "0",
    "power": "0",
    "voltage": "238.8594"
}

This endpoint will return the live energy data from an energy monitoring service if the device is connected to our network and and has energy monitoring.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/energy

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Responses

200 OK - An object containing: current, power and voltage.

403 Forbidden - You do not have permission to access energy data.

404 Not Found - That device could not be found.

Get the Total Energy Consumption Between Two Datetimes

Don't forget to replace the Device UUID and Service UUID.

curl "https://api.wifiplug.co.uk/v1.0/device/2ee79521-96be-4d52-ae44-63fb7d053e28/service/81e43935-666a-48d0-9bc5-f4b65ef40ee3/energy/consumption?date_from=2018-07-06T00:00:00Z&date_to=2018-07-13T00:00:00Z"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var energy = await client.Devices.GetDeviceServiceEnergyConsumptionAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"), DateTime.Parse("2018-07-06T00:00:00Z"), DateTime.Parse("2018-07-13T00:00:00Z"));
var kwhPrice = 0.16d;

Console.WriteLine($"Consumption: {energy.KilowattHours} Cost: {energy.KilowattHours * kwhPrice} GBP");

This command returns JSON structured like this:

{
    "kwh": 0.0015666666666666667
}

This endpoint will return the total consumption of energy, in kWh, between two datetime strings.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/energy/consumption?date_from={date_from}&date_to={date_to}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Query Parameters

Parameter Required Description Type
date_from True The datetime to start from. ISO 8601 Datetime
date_to True The datetime to end at. ISO 8601 Datetime

Responses

200 OK - A list of objects containing: time, power, current and voltage.

400 Bad Request - There is something wrong with the query parameters you have sent.

403 Forbidden - You do not have permission to access energy data.

404 Not Found - That device could not be found.

Get Historical Energy Data for a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl "https://api.wifiplug.co.uk/v1.0/device/2ee79521-96be-4d52-ae44-63fb7d053e28/service/81e43935-666a-48d0-9bc5-f4b65ef40ee3/energy/historic?date_from=2018-07-06T00:00:00Z&date_to=2018-07-13T00:00:00Z&grouping=day"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var readings = await client.Devices.GetDeviceServiceEnergyHistoricalAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"), DateTime.Parse("2018-07-06T00:00:00Z"), DateTime.Parse("2018-07-13T00:00:00Z"));

foreach(var energy in readings) {
    Console.WriteLine($"Time: {energy.Timestamp} Voltage: {energy.Voltage}V Current: {energy.Current}A Power: {energy.Power}W");
}

This command returns JSON structured like this:

[
    {
        "time": "2018-07-06T00:00:00Z",
        "power": 0,
        "current": 0.13541666666666666,
        "voltage": 234.73087000000015
    },
    {
        "time": "2018-07-07T00:00:00Z",
        "power": 0,
        "current": 0.07291666666666667,
        "voltage": 237.4509661111108
    },
    {
        "time": "2018-07-08T00:00:00Z",
        "power": 0,
        "current": 0.3020833333333333,
        "voltage": 232.76724249999955
    },
    {
        "time": "2018-07-09T00:00:00Z",
        "power": 0,
        "current": 0.1459346768589298,
        "voltage": 236.0325209173038
    },
    {
        "time": "2018-07-10T00:00:00Z",
        "power": 0,
        "current": 0.3125,
        "voltage": 232.26869611111098
    },
    {
        "time": "2018-07-11T00:00:00Z",
        "power": 0.04583333333333333,
        "current": 0.16651746961805555,
        "voltage": 233.37315673611144
    },
    {
        "time": "2018-07-12T00:00:00Z",
        "power": 0.020958083832335328,
        "current": 0.3154296875,
        "voltage": 226.26786002993967
    }
]

This endpoint will allow you to get historical energy data for a service inside a device. You must be targeting an energy monitoring service to use this endpoint. Not all devices support energy monitoring. Date from is inclusive and date to is exclusive.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/energy/historic?date_from={datetime}&date_to={datetime}&grouping={grouping}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Query Parameters

Parameter Required Description Type Options
date_from True The datetime to start from. ISO 8601 Datetime
date_to True The datetime to end at. ISO 8601 Datetime
grouping True The grouping for the energy data. string minute, hour, day

Responses

200 OK - A list of objects containing: time, power, current and voltage.

400 Bad Request - There is something wrong with the query parameters you have sent.

403 Forbidden - You do not have permission to access energy data.

404 Not Found - That device could not be found.

Get Historical Consumption Data for a Service in a Device

Don't forget to replace the Device UUID and Service UUID.

curl "https://api.wifiplug.co.uk/v1.0/device/2ee79521-96be-4d52-ae44-63fb7d053e28/service/81e43935-666a-48d0-9bc5-f4b65ef40ee3/energy/consumption/historic?date_from=2018-07-06T00:00:00Z&date_to=2018-07-13T00:00:00Z&grouping=day"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var readings = await client.Devices.GetDeviceServiceEnergyHistoricalConsumptionAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("38946955-846f-4e4d-85b1-6cf40b5d2714"), DateTime.Parse("2018-07-06T00:00:00Z"), DateTime.Parse("2018-07-13T00:00:00Z"), HistoricalGrouping.Day);
var kwhPrice = 0.16d;

foreach (var energy in readings) {
  Console.WriteLine($"Time: {energy.Timestamp} Consumption: {energy.KilowattHours} Cost: {energy.KilowattHours * kwhPrice} GBP");
}

This command returns JSON structured like this:

[
    {
        "time": "2018-07-06T00:00:00Z",
        "kwh": 0
    },
    {
        "time": "2018-07-07T00:00:00Z",
        "kwh": 0
    },
    {
        "time": "2018-07-08T00:00:00Z",
        "kwh": 0
    },
    {
        "time": "2018-07-09T00:00:00Z",
        "kwh": 0
    },
    {
        "time": "2018-07-10T00:00:00Z",
        "kwh": 0
    },
    {
        "time": "2018-07-11T00:00:00Z",
        "kwh": 0.0011
    },
    {
        "time": "2018-07-12T00:00:00Z",
        "kwh": 0.00046666666666666666
    }
]

This endpoint will allow you to get historical consumption, in kWh, for a service inside a device. You must be targeting an energy monitoring service to use this endpoint. Not all devices support energy monitoring. Date from is inclusive and date to is exclusive.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/energy/consumption/historic?date_from={datetime}&date_to={datetime}&grouping={grouping}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Query Parameters

Parameter Required Description Type Options
date_from True The datetime to start from. ISO 8601 Datetime
date_to True The datetime to end at. ISO 8601 Datetime
grouping True The grouping for the energy data. string minute, hour, day

Responses

200 OK - A list of objects containing: time and kwh.

400 Bad Request - There is something wrong with the query parameters you have sent.

403 Forbidden - You do not have permission to access energy data.

404 Not Found - That device could not be found.

Get Characteristics in a Device Service

Don't forget to replace the Device UUID and Service UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714/characteristic"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"

This command returns JSON structured like this:

[
    {
        "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
        "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
        "value": false,
        "is_readable": true,
        "is_writeable": true
    }
]

This endpoint will return the characteristics on a Device Service.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/characteristic

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.

Responses

200 OK - List of characteristic objects.

404 Not Found - That device or service could not be found.

Get a specific Characteristic on a Device Service

Don't forget to replace the Device UUID and Service UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714/characteristic/21dc14f5-f0bd-44f6-9580-0ebecbdb1918"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"

This command returns JSON structured like this:

{
    "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
    "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
    "value": false,
    "is_readable": true,
    "is_writeable": true
}

This endpoint will return a single characteristic object, if it is readable.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/characteristic/{characteristic_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.
characteristic_uuid A Characteristic UUID.

Responses

200 OK - A characteristic object.

404 Not Found - That device, service or characteristic could not be found.

Edit a Characteristic on a Device Service

Don't forget to replace the Device UUID and Service UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/service/38946955-846f-4e4d-85b1-6cf40b5d2714/characteristic/21dc14f5-f0bd-44f6-9580-0ebecbdb1918"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"value": true}'

This command returns JSON structured like this:

{
    "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
    "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
    "value": true,
    "is_readable": true,
    "is_writeable": true
}

This endpoint will edit a characteristic object, if it is writeable. The value type for the input will change depending on the type of characteristic you are targeting, please see the object references to determine which value is required.

Body Contents

Parameter Required Type Description
value True Variety The new value this characteristic should be.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/service/{service_uuid}/characteristic/{characteristic_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
service_uuid A Service UUID.
characteristic_uuid A Characteristic UUID.

Responses

200 OK - A characteristic object.

404 Not Found - That device, service or characteristic could not be found.

Get Timers on a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/timer"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var timers = await client.Devices.ListDeviceTimersAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"));

foreach(var timer in timers) {
  Console.WriteLine($"NextRun: {timer.DateTime} Repeats: {timer.Repeats} Items: {timer.Items}");
}

This command returns JSON structured like this:

{
    "timers": [
        {
            "uuid": "8f0a585a-380b-4a3a-9cf3-f5f222a0821b",
            "repeats": {
                "monday": true,
                "tuesday": false,
                "wednesday": false,
                "thursday": false,
                "friday": true,
                "saturday": false,
                "sunday": false
            },
            "datetime": "2018-07-14T00:01:00Z",
            "items": [
                {
                    "entity": {
                        "uuid": "2ee79521-96be-4d52-ae44-63fb7d053e28",
                        "name": "WIFIPLUG-HOME-D61C",
                        "mac_address": "7C7A5303D61C",
                        "model": "WPHOME17L",
                        "type": "HOME",
                        "user_count": 1,
                        "firmware_version": "1.1.5",
                        "is_online": true
                    },
                    "type": "device"
                }
            ],
            "action": true
        }
    ],
    "cursor": null,
    "total_timer_count": 1
}

This endpoint will return the timers on a device.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/timer

URL Parameters

Parameter Description
device_uuid A Device UUID.

Responses

200 OK - List of timer objects.

404 Not Found - That device could not be found.

Add a New Timer to a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/timer/add"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"datetime": "2018-07-13T00:01:00Z", "service_uuid": "1849a033-1306-4430-b659-994d387c0331", "repeats": {"monday": true, "friday": true}, "action": true}'
var client = new ApiClient("key", "secret");

var timer = await client.Devices.AddDeviceTimerAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new DeviceTimerAddEntity() {
  Action = true,
  Repeats = TimerRepetition.Monday | TimerRepetition.Friday,
  ServiceUUID = new Guid("1849a033-1306-4430-b659-994d387c0331"),
  DateTime = DateTime.Parse("2018-07-13T00:01:00Z")
});

This command returns JSON structured like this:

{
    "uuid": "8f0a585a-380b-4a3a-9cf3-f5f222a0821b",
    "repeats": {
        "monday": true,
        "tuesday": false,
        "wednesday": false,
        "thursday": false,
        "friday": true,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-13T00:01:00Z",
    "items": [
        {
            "entity": {
                "uuid": "2ee79521-96be-4d52-ae44-63fb7d053e28",
                "name": "WIFIPLUG-HOME-D61C",
                "mac_address": "7C7A5303D61C",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 1,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "type": "device"
        }
    ],
    "action": true
}

This endpoint allows you to add a timer to a device. You must target a controllable service with the service_uuid field in the body.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/timer/add

URL Parameters

Parameter Description
device_uuid A Device UUID.

Body Contents

Parameter Required Type Description
datetime True string An ISO 8601 datetime stamp for when the timer should trigger.
service_uuid True string The service_uuid inside this device you want to target with this timer.
repeats False object An object containing: monday, tuesday, wednesday, thursday, friday, saturday and sunday - toggle true the days you would like the timer to repeat on.
action True boolean The action for the timer, either turn on or turn off.

Responses

200 OK - Timer object of the new timer.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - The user does not have permission to add a timer to the device.

404 Not Found - That device could not be found.

Get a Timer on a Device

Don't forget to replace the Device UUID and Timer UUID, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/timer/8f0a585a-380b-4a3a-9cf3-f5f222a0821b"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var timer = await client.Devices.GetDeviceTimerAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("8f0a585a-380b-4a3a-9cf3-f5f222a0821b"));

This command returns JSON structured like this:

{
    "uuid": "8f0a585a-380b-4a3a-9cf3-f5f222a0821b",
    "repeats": {
        "monday": true,
        "tuesday": false,
        "wednesday": false,
        "thursday": false,
        "friday": true,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-14T00:01:00Z",
    "items": [
        {
            "entity": {
                "uuid": "2ee79521-96be-4d52-ae44-63fb7d053e28",
                "name": "WIFIPLUG-HOME-D61C",
                "mac_address": "7C7A5303D61C",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 1,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "type": "device"
        }
    ],
    "action": true
}

This endpoint will return a timer on the device.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/timer/{timer_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
timer_uuid A Timer UUID.

Responses

200 OK - Timer object.

404 Not Found - That device could not be found.

Delete a Timer from a Device

Don't forget to replace the Device UUID and Timer UUID, otherwise you will get a 404.

curl -X DELETE "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/timer/8f0a585a-380b-4a3a-9cf3-f5f222a0821b"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

await client.Devices.DeleteDeviceTimerAsync(new Guid("c61bc9bb-d7fa-478b-9f89-90426ff52ee9"), new Guid("8f0a585a-380b-4a3a-9cf3-f5f222a0821b"));

This endpoint will delete a timer on a device.

HTTP Request

DELETE https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/timer/{timer_uuid}

URL Parameters

Parameter Description
device_uuid A Device UUID.
timer_uuid A Timer UUID.

Responses

204 No Content - Timer was deleted.

403 Forbidden - The user does not have permission to delete the timer from the device.

404 Not Found - That device could not be found.

Get Events for a Device

Don't forget to replace the Device UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/device/c61bc9bb-d7fa-478b-9f89-90426ff52ee9/event"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");


This command returns JSON structured like this:

{
    "events": [
        {
            "uuid": "59e2e678-6a85-4984-b995-bbe9281e2404",
            "resource_type": "device",
            "resource_uuid": "fd1458e1-df4c-4fc7-a7d5-f8fdfa292f06",
            "type": "characteristic_change",
            "data": {
                "UUID": "fd1458e1-df4c-4fc7-a7d5-f8fdfa292f06",
                "ServiceType": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "CharacteristicType": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "ServiceUUID": "6b6e7b00-a6c8-44e7-9760-f6aea3db0e3b",
                "CharacteristicUUID": "5594b51f-84c8-46b0-81dc-756d0a7a13a7",
                "OldValue": "True",
                "NewValue": "False",
                "Activator": "cloud",
                "ActivatorData": null
            },
            "data_format": "json",
            "time_created": "2018-07-19 17:01:37Z"
        }
    ],
    "cursor": null,
    "total_event_count": 1
}

This endpoint will return the events on a device. Events are captured at a device level instead of a service level. These can be changes such as online or offline, or they can be a characteristic changes such as a state characteristic change.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/device/{device_uuid}/event

URL Parameters

Parameter Description
device_uuid A Device UUID.

Query Parameters

Parameter Required Description Default Misc
limit False The maximum number of items you will get back. 50 Minimum: 1, Maximum 100
cursor False The cursor to the next set of results if there are more results than the limit.
filter False If you would like to get status events only add the filter parameter and set to status. You can filter any event using this.

Responses

200 OK - List of event objects with a total count and a cursor if required.

404 Not Found - That device or event could not be found.

Groups

Get Groups

curl "https://api.wifiplug.co.uk/v1.0/group"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var groups = await client.Groups.ListGroupsAsync();

foreach(var group in groups) {
  Console.WriteLine($"Name: {group.Name} Items: {group.ItemCount}");
}

This command returns JSON structured like this:

{
    "groups": [
        {
            "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
            "name": "Office",
            "item_count": 1,
            "items": [
                {
                    "uuid": "a3253379-3a9b-4ab5-bc6d-edb3a3923b35",
                    "device": {
                        "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
                        "name": "Air Conditioner",
                        "mac_address": "7C7A5303D318",
                        "model": "WPHOME17L",
                        "type": "HOME",
                        "user_count": 3,
                        "firmware_version": "1.1.5",
                        "is_online": true
                    },
                    "service": {
                        "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                        "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                        "caption": ""
                    },
                    "characteristic": {
                        "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                        "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                        "value": true
                    }
                }
            ]
        }
    ],
    "cursor": null,
    "total_group_count": 1
}

This endpoint retrieves the groups your user has access to.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/group

Query Parameters

Parameter Required Description Default Misc
limit False The maximum number of items you will get back. 50 Minimum: 1, Maximum 100
cursor False The cursor to the next set of results if there are more results than the limit.

Responses

200 OK - List of group objects.

Add a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/add"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"name": "Test Group", "items": [{"device_uuid": "2ee79521-96be-4d52-ae44-63fb7d053e28", "service_uuid": "1849a033-1306-4430-b659-994d387c0331", "characteristic_uuid": "f865b5f7-3990-4d3a-9b05-bae80e11adb4"}]}'
var client = new ApiClient("key", "secret");

var group = await client.Groups.AddGroupAsync(new GroupAddEntity() {
  Name = "Test Group",
  Items = new GroupAddItemEntity[] {
    new GroupAddItemEntity() {
      CharacteristicUUID = new Guid("f865b5f7-3990-4d3a-9b05-bae80e11adb4"),
      ServiceUUID = new Guid("1849a033-1306-4430-b659-994d387c0331"),
      DeviceUUID = new Guid("2ee79521-96be-4d52-ae44-63fb7d053e28")
    }
  }
});

This command returns JSON structured like this:

{
    "uuid": "aa7e66ef-1d81-4d81-991d-d9e07b2ed91d",
    "name": "Test Group",
    "item_count": 1,
    "items": [
        {
            "uuid": "aaaf63f5-b353-44ac-8bd4-f1d13446c475",
            "device": {
                "uuid": "2ee79521-96be-4d52-ae44-63fb7d053e28",
                "name": "WIFIPLUG-HOME-D61C",
                "mac_address": "7C7A5303D61C",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 1,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "1849a033-1306-4430-b659-994d387c0331",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "f865b5f7-3990-4d3a-9b05-bae80e11adb4",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        }
    ]
}

This endpoint allows you to create a new group. When specifying which items to add to the group you must provide: device_uuid, service_uuid and characteristic_uuid. The service_uuid must be of a controllable service and the characteristic_uuid must target a state characteristic inside of that service.

HTTP Requst

GET https://api.wifiplug.co.uk/v1.0/group/add

Body Contents

Parameter Required Type Description
name True string The name of the new group.
items True list List of objects each containing, device_uuid, service_uuid and characteristic_uuid

Responses

200 OK - Group object of the new group.

400 Bad Request - The JSON data you sent had errors.

403 Forbiddem - The user does not have permission to create a group.

Get a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var group = await client.Groups.GetGroupAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"));

This command returns JSON structured like this:

{
    "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
    "name": "Office",
    "item_count": 1,
    "items": [
        {
            "uuid": "a3253379-3a9b-4ab5-bc6d-edb3a3923b35",
            "device": {
                "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
                "name": "Air Conditioner",
                "mac_address": "7C7A5303D318",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 3,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": true
            }
        }
    ]
}

This endpoint will return a group that matches the UUID you provide.

HTTP Requst

GET https://api.wifiplug.co.uk/v1.0/group/{group_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.

Responses

200 OK - Group object.

404 Not Found - That group could not be found.

Edit a Group Name

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"name": "Test Groupie"}'
var client = new ApiClient("key", "secret");

var group = await client.Groups.EditGroupAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new GroupEditEntity() {
  Name = "Test Groupie"
});

This command returns JSON structured like this:

{
    "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
    "name": "Test Group",
    "item_count": 1,
    "items": [
        {
            "uuid": "a3253379-3a9b-4ab5-bc6d-edb3a3923b35",
            "device": {
                "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
                "name": "Air Conditioner",
                "mac_address": "7C7A5303D318",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 3,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": true
            }
        }
    ]
}

This endpoint will edit the name of a group.

HTTP Requst

POST https://api.wifiplug.co.uk/v1.0/group/{group_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.

Responses

200 OK - Group object with the new name.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - That user does not have permission to rename this group.

404 Not Found - That group could not be found.

Delete a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X DELETE "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

await client.Groups.DeleteGroupAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"));

This endpoint will delete a group.

HTTP Requst

DELETE https://api.wifiplug.co.uk/v1.0/group/{group_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.

Responses

200 OK - Group object with the new name.

403 Forbidden - That user does not have permission to remove an item from this group.

404 Not Found - That group could not be found.

Control a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/control"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"state": "true"}'
var client = new ApiClient("key", "secret");

var state = await client.Groups.ControlGroupAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new ControlEntity() {
  State = true
});

This command returns JSON structured like this:

{
    "state": true
}

This endpoint will control a group state.

HTTP Requst

POST https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/state

URL Parameters

Parameter Description
group_uuid A Group UUID.

Body Contents

Parameter Required Type Description
state True boolean The new state for the group.

Responses

200 OK - Group object with the new name.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - That user does not have permission to control this group.

404 Not Found - That group could not be found.

Toggle a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/toggle"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var state = await client.Groups.ToggleGroupAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"));

This command returns JSON structured like this:

{
    "state": true
}

This endpoint will toggle a group to the opposite state.

HTTP Requst

POST https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/toggle

URL Parameters

Parameter Description
group_uuid A Group UUID.

Responses

200 OK - Group object with the new name.

403 Forbidden - That user does not have permission to control this group.

404 Not Found - That group could not be found.

Boost a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/boost"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"duration" : 120}'
var client = new ApiClient("key", "secret");

var state = await client.Groups.BoostGroupAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new BoostEntity() {
  Duration = 120
});

This command returns JSON structured like this:

{
    "uuid": "fe8b2c66-17cf-40b5-aa43-3dfe93fe1d8d",
    "repeats": {
        "monday": false,
        "tuesday": false,
        "wednesday": false,
        "thursday": false,
        "friday": false,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-13T14:15:00Z",
    "items": [
        {
            "entity": {
                "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
                "name": "1234",
                "item_count": 2
            },
            "type": "group"
        }
    ],
    "action": false
}

This endpoint will boost a group and set a timer to turn it off after the duration has elapsed.

HTTP Requst

POST https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/boost

URL Parameters

Parameter Description
group_uuid A Group UUID.

Body Contents

Parameter Required Type Description Misc
duration True integer The duration the group should be turned on for. Minimum: 1, Maximum: 3600

Responses

200 OK - Timer object of when the group will turn off.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - That user does not have permission to control this group.

404 Not Found - That group could not be found.

Get Items in a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/item"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var groupItems = await client.Groups.ListGroupItemsAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"));

This command returns JSON structured like this:

{
    "items": [
        {
            "uuid": "9c9f89ef-290e-4ed9-b17a-130e13f5652d",
            "device": {
                "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
                "name": "Air Conditioner",
                "mac_address": "7C7A5303D318",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 3,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": true
            }
        },
        {
            "uuid": "266a1ecc-33a7-4e9c-8a70-b1f4685e0694",
            "device": {
                "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
                "name": "WIFIPLUG-HOME-D2F2",
                "mac_address": "7C7A5303D2F2",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 3,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        }
    ],
    "cursor": null,
    "total_group_items": 2
}

This endpoint will return a list of items inside a group.

HTTP Requst

GET https://api.wifiplug.co.uk/v1.0/group/{group_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.

Query Parameters

Parameter Required Description Default Misc
limit False The maximum number of items you will get back. 50 Minimum: 1, Maximum 100
cursor False The cursor to the next set of results if there are more results than the limit.

Responses

200 OK - A list of group items.

404 Not Found - That group could not be found.

Add a New Item to Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/item/add"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"device_uuid": "96dfe374-c732-4e45-af08-63b289704e49", "service_uuid": "0baf69d3-60e3-4789-982f-24526a68a815", "characteristic_uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96"}'
var client = new ApiClient("key", "secret");

var groupItem = await client.Groups.AddGroupItemAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new GroupAddItemEntity() {
  DeviceUUID = new Guid("96dfe374-c732-4e45-af08-63b289704e49"),
  CharacteristicUUID = new Guid("fbc0feed-7b39-4a32-806a-015fc79aba96"),
  ServiceUUID = new Guid("0baf69d3-60e3-4789-982f-24526a68a815")
});

This command returns JSON structured like this:

{
    "uuid": "33e3b25e-1ff4-43b8-acda-6399edbb2265",
    "device": {
        "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
        "name": "WIFIPLUG-HOME-D2F2",
        "mac_address": "7C7A5303D2F2",
        "model": "WPHOME17L",
        "type": "HOME",
        "user_count": 3,
        "firmware_version": "1.1.5",
        "is_online": true
    },
    "service": {
        "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
        "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
        "caption": ""
    },
    "characteristic": {
        "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
        "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
        "value": true
    }
}

This endpoint will add a new item to a group.

HTTP Requst

GET https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/item/add

URL Parameters

Parameter Description
group_uuid A Group UUID.

Body Contents

Parameter Required Type Description
device_uuid True string The Device UUID.
service_uuid True string The Service UUID.
characteristic_uuid True string The Characteristic UUID.

Responses

200 OK - The new group item.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - The user does not have permission to add an item to the group.

404 Not Found - That group could not be found.

Get an Item in a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/item/a3253379-3a9b-4ab5-bc6d-edb3a3923b35"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var groupItem = await client.Groups.GetGroupItemAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new Guid("a3253379-3a9b-4ab5-bc6d-edb3a3923b35"));

This command returns JSON structured like this:

{
    "uuid": "a3253379-3a9b-4ab5-bc6d-edb3a3923b35",
    "device": {
        "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
        "name": "Air Conditioner",
        "mac_address": "7C7A5303D318",
        "model": "WPHOME17L",
        "type": "HOME",
        "user_count": 3,
        "firmware_version": "1.1.5",
        "services": [
            {
                "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": "",
                "characteristics": [
                    {
                        "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                        "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                        "value": true
                    }
                ]
            },
            {
                "uuid": "966c8732-57d1-47f1-bb19-2cbccbfcaf3d",
                "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
                "caption": "",
                "characteristics": [
                    {
                        "uuid": "3978e125-7aa2-4c42-818e-383b1427b5ba",
                        "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
                        "value": 0
                    },
                    {
                        "uuid": "a6ba543e-07f9-4125-970f-b45dc42dfe5b",
                        "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
                        "value": 246.453125
                    },
                    {
                        "uuid": "84c539cc-b80f-49d5-903c-dcd3cb7e8bc4",
                        "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
                        "value": 0
                    }
                ]
            }
        ],
        "is_online": true
    },
    "service": {
        "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
        "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
        "caption": "",
        "characteristics": [
            {
                "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": true
            }
        ]
    }
}

This endpoint will return a group item.

HTTP Requst

GET https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/item/{group_item_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.
group_item_uuid A Group Item UUID.

Responses

200 OK - A list of group items.

404 Not Found - That group or group item could not be found.

Delete an Item from a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X DELETE "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/item/a3253379-3a9b-4ab5-bc6d-edb3a3923b35"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

await client.Groups.DeleteGroupItemAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new Guid("a3253379-3a9b-4ab5-bc6d-edb3a3923b35"));

This endpoint will delete a group item.

HTTP Requst

DELETE https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/item/{group_item_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.
group_item_uuid A Group Item UUID.

Responses

204 No Content - The item has been remove from the group.

403 Forbidden - The user does not have permission to remove this item from the group.

404 Not Found - That group or group item could not be found.

Get Timers on a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/timer"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var timers = await client.Groups.ListGroupTimersAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"));

foreach(var timer in timers) {
  Console.WriteLine($"NextRun: {timer.DateTime} Repeats: {timer.Repeats} Items: {timer.Items}");
}

This command returns JSON structured like this:

{
    "timers": [
        {
            "uuid": "601faa3f-d7d8-4009-9f44-8ae76f1d153f",
            "repeats": {
                "monday": false,
                "tuesday": false,
                "wednesday": true,
                "thursday": true,
                "friday": false,
                "saturday": false,
                "sunday": false
            },
            "datetime": "2018-07-18T00:01:00Z",
            "items": [
                {
                    "entity": {
                        "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
                        "name": "1234",
                        "item_count": 2
                    },
                    "type": "group"
                }
            ],
            "action": true
        },
        {
            "uuid": "be3a9b3f-1489-4e7d-bc63-345fc526237a",
            "repeats": {
                "monday": false,
                "tuesday": false,
                "wednesday": true,
                "thursday": true,
                "friday": false,
                "saturday": false,
                "sunday": false
            },
            "datetime": "2018-07-18T00:01:00Z",
            "items": [
                {
                    "entity": {
                        "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
                        "name": "1234",
                        "item_count": 2
                    },
                    "type": "group"
                }
            ],
            "action": true
        }
    ],
    "cursor": null,
    "total_timer_count": 2
}

This endpoint will return the timers on a group.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/timer

URL Parameters

Parameter Description
group_uuid A Group UUID.

Responses

200 OK - List of timer objects.

404 Not Found - That group could not be found.

Add a New Timer to a Group

Don't forget to replace the Group UUID with one on your account, otherwise you will get a 404.

curl -X POST "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/timer/add"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
  -H "Content-Type: application/json"
  -d '{"datetime": "2018-07-13T00:01:00Z", "repeats": {"wednesday": true, "thursday": true}, "action": true}'
var client = new ApiClient("key", "secret");

var timer = await client.Groups.AddGroupTimerAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new GroupTimerAddEntity() {
  Action = true,
  Repeats = TimerRepetition.Wednesday | TimerRepetition.Thursday,
  DateTime = DateTime.Parse("2018-07-13T00:01:00Z")
});

This command returns JSON structured like this:

{
    "uuid": "601faa3f-d7d8-4009-9f44-8ae76f1d153f",
    "repeats": {
        "monday": false,
        "tuesday": false,
        "wednesday": true,
        "thursday": true,
        "friday": false,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-13T00:01:00Z",
    "items": [
        {
            "entity": {
                "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
                "name": "Office",
                "item_count": 2
            },
            "type": "group"
        }
    ],
    "action": true
}

This endpoint allows you to add a timer to a group.

HTTP Request

POST https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/timer/add

URL Parameters

Parameter Description
group_uuid A Group UUID.

Body Contents

Parameter Required Type Description
datetime True string An ISO 8601 datetime stamp for when the timer should trigger.
repeats False object An object containing: monday, tuesday, wednesday, thursday, friday, saturday and sunday - toggle true the days you would like the timer to repeat on.
action True boolean The action for the timer, either turn on or turn off.

Responses

200 OK - Timer object of the new timer.

400 Bad Request - The JSON data you sent had errors.

403 Forbidden - The user does not have permission to add a timer to the group.

404 Not Found - That group could not be found.

Get a Timer on a Group

Don't forget to replace the Group UUID and Timer UUID, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/timer/601faa3f-d7d8-4009-9f44-8ae76f1d153f"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var timer = await client.Groups.GetGroupTimerAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new Guid("601faa3f-d7d8-4009-9f44-8ae76f1d153f"));

This command returns JSON structured like this:

{
    "uuid": "601faa3f-d7d8-4009-9f44-8ae76f1d153f",
    "repeats": {
        "monday": false,
        "tuesday": false,
        "wednesday": true,
        "thursday": true,
        "friday": false,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-18T00:01:00Z",
    "items": [
        {
            "entity": {
                "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
                "name": "1234",
                "item_count": 2
            },
            "type": "group"
        }
    ],
    "action": true
}

This endpoint will return a timer on the group.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/timer/{timer_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.
timer_uuid A Timer UUID.

Responses

200 OK - Timer object.

404 Not Found - That group could not be found.

Delete a Timer from a Group

Don't forget to replace the Group UUID and Timer UUID, otherwise you will get a 404.

curl -X DELETE "https://api.wifiplug.co.uk/v1.0/group/1458b9f2-0bb6-45a5-954e-143cf7f3a3bc/timer/601faa3f-d7d8-4009-9f44-8ae76f1d153f"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

await client.Groups.DeleteGroupTimerAsync(new Guid("1458b9f2-0bb6-45a5-954e-143cf7f3a3bc"), new Guid("601faa3f-d7d8-4009-9f44-8ae76f1d153f"));

This endpoint will delete a timer on a group.

HTTP Request

DELETE https://api.wifiplug.co.uk/v1.0/group/{group_uuid}/timer/{timer_uuid}

URL Parameters

Parameter Description
group_uuid A Group UUID.
timer_uuid A Timer UUID.

Responses

204 No Content - Timer was deleted.

403 Forbidden - The user does not have permission to delete the timer from the group.

404 Not Found - That group could not be found.

User

Get User

curl "https://api.wifiplug.co.uk/v1.0/user"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");

var user = await client.Users.GetCurrentUserAsync();

This command returns JSON structured like this:

{
    "uuid": "47e4333a-199b-416f-9ba8-49bb34e7615d",
    "username": "wifiplug_developer",
    "email_address": "developer@wifiplug.co.uk",
    "given_name": "wifiplug",
    "family_name": "developer"
}

This endpoint retrieves data about the logged in user.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/user

Responses

200 OK - A user object.

Events

Events are things actions that have been tracked and recorded by the server. You can gather information such as when the plug reconnected to the network and other things such as look at when the device was turned on / off.

Get a Specific Event

Don't forget to replace the Event UUID with one on your account, otherwise you will get a 404.

curl "https://api.wifiplug.co.uk/v1.0/event/59e2e678-6a85-4984-b995-bbe9281e2404"
  -H "X-Api-Key: key"
  -H "X-Api-Secret: secret"
var client = new ApiClient("key", "secret");


This command returns JSON structured like this:

{
    "uuid": "59e2e678-6a85-4984-b995-bbe9281e2404",
    "resource_type": "device",
    "resource_uuid": "fd1458e1-df4c-4fc7-a7d5-f8fdfa292f06",
    "type": "characteristic_change",
    "data": {
        "UUID": "fd1458e1-df4c-4fc7-a7d5-f8fdfa292f06",
        "ServiceType": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
        "CharacteristicType": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
        "ServiceUUID": "6b6e7b00-a6c8-44e7-9760-f6aea3db0e3b",
        "CharacteristicUUID": "5594b51f-84c8-46b0-81dc-756d0a7a13a7",
        "OldValue": "True",
        "NewValue": "False",
        "Activator": "cloud",
        "ActivatorData": null
    },
    "data_format": "json",
    "time_created": "2018-07-19 17:01:37Z"
}

This endpoint will return a specific event.

HTTP Request

GET https://api.wifiplug.co.uk/v1.0/event/{event_uuid}

URL Parameters

Parameter Description
event_uuid An Event UUID.

Responses

200 OK - An event object.

404 Not Found - That device or event could not be found.

Objects

Device Object

{
    "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
    "name": "WIFIPLUG-HOME-D2F2",
    "mac_address": "7C7A5303D2F2",
    "model": "WPHOME17L",
    "type": "HOME",
    "user_count": 1,
    "firmware_version": "1.1.5",
    "services": [
        {
            "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
            "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
            "caption": "",
            "characteristics": [
                {
                    "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
                    "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                    "value": true
                }
            ]
        },
        {
            "uuid": "be71efb8-3917-4e0c-904f-067f1b93dda5",
            "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
            "caption": "",
            "characteristics": [
                {
                    "uuid": "1da8074e-b301-49b2-a322-7dc2ddad63bb",
                    "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
                    "value": 0
                },
                {
                    "uuid": "ae484d8a-0026-42b5-bdf7-8df87baa922b",
                    "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
                    "value": 246.484375
                },
                {
                    "uuid": "5c72223f-8b5e-430d-81a0-946927d36615",
                    "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
                    "value": 0.01953125
                }
            ]
        }
    ],
    "is_online": true
}

A device object represents a users device - this could be a Glass+ or WIFIPLUG HOME etc.

uuid This is the device UUID, how you identify the device using the API.

name The name of the device.

mac_address The device Mac Address.

model The model of the device.

type The device type.

user_count The total number of users who have access to this device.

firmware_version THe firmware the device is running.

services Inside a device object there are service objects. There will always be at least one service object inside a device.

is_online Is online refers to if the device is connected to our network.

Type Models Name Description
HOME WPHOME17L WIFIPLUG HOME The latest product released by wifiplug. This device has an outlet service and a power analytics service.

Service Object

{
    "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
    "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
    "caption": "",
    "characteristics": [
        {
            "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
            "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
            "value": true
        }
    ]
},
{
    "uuid": "be71efb8-3917-4e0c-904f-067f1b93dda5",
    "type_uuid": "e4b8c402-e3f8-4ba3-8593-8565664a18bf",
    "caption": "",
    "characteristics": [
        {
            "uuid": "1da8074e-b301-49b2-a322-7dc2ddad63bb",
            "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
            "value": 0
        },
        {
            "uuid": "ae484d8a-0026-42b5-bdf7-8df87baa922b",
            "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
            "value": 246.484375
        },
        {
            "uuid": "5c72223f-8b5e-430d-81a0-946927d36615",
            "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
            "value": 0.01953125
        }
    ]
}

A service object is inside a device object. A service is anything that has a function that adds to the device.

uuid The UUID is the unique identifier for the service.

type_uuid The type UUID allows you to figure out which service you are targeting.

caption The caption field can only be used on some services. It is a more specific name for the device. The device type determines if a service can have captions.

characteristics An array inside of service, these are pieces of information the service uses to run.

For example, a WIFIPLUG HOME has two services inside. An outlet service and energy montioring, a glass unit with three switches will have three switch services inside of it.

The type of service you're targeting is determined by the type_uuid, you can not change this. Type UUID's for services can be found in the lookup table directly below.

UUID Name Description Controllable Readable Writeable
1ea7e8ab-5981-4d9d-8343-3deae13b4fff Outlet An outlet service is used in our plug devices. Yes Yes Yes
5d956555-7890-4c07-b55f-a34e230b6f9c Switch A switch service is used in our Glass devices. Yes Yes Yes
e4b8c402-e3f8-4ba3-8593-8565664a18bf Power Analytics A power analytics service shows that energy data is recorded. No Yes No

Characteristic Object

{
    "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
    "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
    "value": true
}

{
    "uuid": "1da8074e-b301-49b2-a322-7dc2ddad63bb",
    "type_uuid": "c73c0220-a122-45c4-bc00-c4f88de34dbf",
    "value": 0
}

{
    "uuid": "ae484d8a-0026-42b5-bdf7-8df87baa922b",
    "type_uuid": "b1c83641-18b2-4092-9f0a-ec3c28d8e644",
    "value": 246.484375
}

{
    "uuid": "5c72223f-8b5e-430d-81a0-946927d36615",
    "type_uuid": "9bcaa8ce-efcb-4068-9c8f-4bb0093b6984",
    "value": 0.01953125
}

A characteristic object is found inside of a service. A characteristic is a piece of information that is recorded and used to run that service. The type of information held is determined by the type_uuid.

UUID Parent Service(s) Name Description Readable Writeable Data Type
a9e8093e-38cf-4758-bff9-a4b4ad9f0c81 Outlet, Switch Status The status characteristic is used to show the state of the device, either on or off. Yes Yes boolean
c73c0220-a122-45c4-bc00-c4f88de34dbf Power Analytics Power The power characteristic contains the power reading for the power analytics. Yes No float
b1c83641-18b2-4092-9f0a-ec3c28d8e644 Power Analytics Voltage The voltage characteristic contains the voltage reading for the power analytics. Yes No float
9bcaa8ce-efcb-4068-9c8f-4bb0093b6984 Power Analytics Current The current characteristic contains the current reading for the power analytics. Yes No float

Timer Object

{
    "uuid": "781ed965-ab12-48be-aace-fcb35e1e3a6c",
    "repeats": {
        "monday": true,
        "tuesday": true,
        "wednesday": true,
        "thursday": false,
        "friday": false,
        "saturday": false,
        "sunday": false
    },
    "datetime": "2018-07-14T14:00:00Z",
    "items": [
        {
            "entity": {
                "uuid": "3a2a3ec7-0f38-443e-ad2c-2db6f5a93f5e",
                "name": "Rawtenstall Mac",
                "mac_address": "7C7A53020F8C",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 2,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "type": "device"
        }
    ],
    "action": true
}

A timer object represents a scheduled event on our system. It can either turn a service or group, on or off.

uuid The UUID is the timers unique identifier, used to target the timer.

repeats Repeats is an object that contains the days Monday through Sunday. Each day has a boolean of true or false, this represents if the timer will be repeated on that day of the week.

datetime The datetime field is an ISO 8061 datetime string (2018-07-13T00:00:00Z). This represents when the timer will fire.

items This is a list of entities the timer targets.

action The action is a boolean. It represents if the timer will turn the entity on or off.

Group Object

{
    "uuid": "1458b9f2-0bb6-45a5-954e-143cf7f3a3bc",
    "name": "Office",
    "item_count": 2,
    "items": [
        {
            "uuid": "a3253379-3a9b-4ab5-bc6d-edb3a3923b35",
            "device": {
                "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
                "name": "Air Conditioner",
                "mac_address": "7C7A5303D318",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 3,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        },
        {
            "uuid": "33e3b25e-1ff4-43b8-acda-6399edbb2265",
            "device": {
                "uuid": "96dfe374-c732-4e45-af08-63b289704e49",
                "name": "Desk Fan",
                "mac_address": "7C7A5303D2F2",
                "model": "WPHOME17L",
                "type": "HOME",
                "user_count": 3,
                "firmware_version": "1.1.5",
                "is_online": true
            },
            "service": {
                "uuid": "0baf69d3-60e3-4789-982f-24526a68a815",
                "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
                "caption": ""
            },
            "characteristic": {
                "uuid": "fbc0feed-7b39-4a32-806a-015fc79aba96",
                "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
                "value": false
            }
        }
    ]
}

A group object represents a grouping of devices - they can be toggle and this will toggle all devices inside of it.

uuid The UUID is the Group unique identifier.

name The name if the users name for the group.

item_count Is the number of items inside the group.

items Items is an array of Group Item objects. The items array inside a Group object has a maximum cap of 50 items. If your group has more than 50 items you will have to use the items route and retrieve them using cursors.

Group Item Object

{
  "uuid": "a3253379-3a9b-4ab5-bc6d-edb3a3923b35",
  "device": {
      "uuid": "6b15b51e-7361-4ca2-af59-6583bbf2e9cf",
      "name": "Air Conditioner",
      "mac_address": "7C7A5303D318",
      "model": "WPHOME17L",
      "type": "HOME",
      "user_count": 3,
      "firmware_version": "1.1.5",
      "is_online": true
  },
  "service": {
      "uuid": "de460b88-929a-492a-a7ab-ff59975a297a",
      "type_uuid": "1ea7e8ab-5981-4d9d-8343-3deae13b4fff",
      "caption": ""
  },
  "characteristic": {
      "uuid": "21dc14f5-f0bd-44f6-9580-0ebecbdb1918",
      "type_uuid": "a9e8093e-38cf-4758-bff9-a4b4ad9f0c81",
      "value": false
  }
}

uuid The UUID is the Group Item unique identifier.

device The device the group item is targeting.

service The service the group item is targeting.

characteristic The characteristic inside the service the group item is targeting.

Event Object

{
    "uuid": "59e2e678-6a85-4984-b995-bbe9281e2404",
    "type": "status",
    "data": {
        "UUID": "fd1458e1-df4c-4fc7-a7d5-f8fdfa292f06",
        "NewState": true,
        "OldState": false
    },
    "data_format": "json",
    "time_created": "2018-07-19 11:10:13Z"
}

uuid The UUID is the Event unique identifier.

type The type of event that was triggered.

data The data recorded for that event.

data_format The format of the data.

time_created The time the event occurred.

HTTP Response Codes

The WIFIPLUG API can return the following HTTP response codes.

Code Description
200 OK - Your request has completed succesfully.
204 No Content - Your request has completed succesfully but there is no information to return.
400 Bad Request - The request that you have sent is not valid.
401 Unauthorised - You are either missing your API key, API secret or your bearer token.
403 Forbidden - You do not have access to that resource.
404 Not Found - That resource could not be found.
405 Method Not Allowed - That resource can not be accessed using that method.
420 Too Many Requests - You are sending too many requests, rate limiting has kicked in.
500 Internal Server Error - We experienced an error.
502 Bad Gateway - Our API is not currently accessible.
503 Service Unavailable - Our API is temporarily offline for maintenance. Please try again later.

Error Codes

The API returns error codes back to help you figure out any issues with the request you made.

Error Code Description
ALREADY_EXISTS The resource you're trying to create already exists.
AUTHENTICATION_ERROR The authentication fields you provided are invalid.
DEVICE_CONNECTION_ERROR The device is not connected to our network.
EMPTY_FIELD A required field in that request was not provided.
EMPTY_REQUEST The request you sent was empty.
INSUFFICIENT_PERMISSION The user does not have permision to perform that action.
INVALID_ACTION The action you tried to perform is not valid.
INVALID_FIELD You have provided a field that is not recognised.
INVALID_JSON The body of the request you have sent contains invalid JSON.
INTERNAL_ERROR Our server experienced an error.
METHOD_NOT_ALLOWED The route is valid but you used the wrong request method to access it.
NOT_FOUND That resource could not be found.
NOT_ONLINE That device is not connected to our network.
SERVICE_UNAVAILABLE We're experiencing internal issues. Please try again later.