# Play Control

```
PATCH /setplaycontrol
```

## Parameters

| Parameter   | Data Type         | Value                              |
| ----------- | ----------------- | ---------------------------------- |
| `serial`    | string, required  | the serial number of a vssl device |
| `number`    | integer, required | the zone number.                   |
| `playState` | integer, required | 0-resume, 1-stop, 2-pause.         |

> note: stopping a stream will disconnect the client as will pausing an Airplay stream.
>
> note2: streams (Airplay, Chromecast, Spotify.Connect) have higher priority than analog inputs. Therefore, if both input types are playing to a zone then the higher priority will play. Likewise, if both types of input are playing to a zone and the stream is stopped then the zone will switch to playing the lower priority content.

## Response

Status of the call

## Example Request

Sample HTTP request

{% tabs %}
{% tab title="curl" %}

```bash
$ curl --request PATCH http://192.168.0.15:8000/api/setplaycontrol?'serial=00BD27EF657D&number=1&playstate=2'
```

{% endtab %}

{% tab title="IP Cmd" %}

```bash
IP: 192.168.0.15
Host: 8000
Data: "PATCH /api/setplaycontrol?serial=00BD27EF657D&number=1&playstate=2 HTTP/1.1\r\n\r\n"
```

{% endtab %}

{% tab title="httpie" %}

```bash
$ http PATCH 192.168.0.15:8000/api/setplaycontrol serial==00BD27EF657D number==1 playstate==2
```

{% endtab %}

{% tab title="node" %}

```javascript
const axios = require('axios');

axios.patch('http://192.168.0.15:8000/api/setplaycontrol', {
    params: {
      serial: '00BD27EF657D',
      number: 1,
      playstate: 2
    }
  }).then((response)=>{
    console.log(response);
  }).catch((response)=>{
    console.log('Error making request');
  })
```

{% endtab %}
{% endtabs %}

## Example Response

```javascript
{
  "status": "request sent"
}
```
