# Media Interactions

Media Interactions are Part of the Frontend API. They describe the Interaction between an existing Media Item and a User (who can be anonymous in certain Cases). Media Interactions need a valid Session (and most of them also a valid, loggedin User) to be processed.

## Common Interactions

## /addcomment

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addcomment`

#### Query Parameters

| Name        | Type    | Description                                                                               |
| ----------- | ------- | ----------------------------------------------------------------------------------------- |
| item        | integer | the Media ID                                                                              |
| streamtype  | string  | the Media Streamtype                                                                      |
| text        | string  | the Comment itself                                                                        |
| parent      | number  | if the Comment is a Reply to another Comment, the parent Comment ID                       |
| username    | number  | if the User is anonymous, the given Username                                              |
| timestamp   | number  | if related to a nexxPLAY Delivery, the current Media Timestamp                            |
| currentitem | integer | the ID of the currently active Item - if the target Streamtype is a Container Streamtype. |

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

```
```

{% endtab %}
{% endtabs %}

## /addrate

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addrate`

#### Query Parameters

| Name        | Type    | Description                                                                               |
| ----------- | ------- | ----------------------------------------------------------------------------------------- |
| item        | string  | the Media ID                                                                              |
| streamtype  | integer | the Media Streamtype                                                                      |
| rating      | integer | the Rating itself (1-5)                                                                   |
| timestamp   | number  | if related to a nexxPLAY Delivery, the current Media Timestamp                            |
| currentitem | integer | the ID of the currently active Item - if the target Streamtype is a Container Streamtype. |

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

```
```

{% endtab %}
{% endtabs %}

## /addreaction

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addreaction`

#### Query Parameters

| Name        | Type    | Description                                                                               |
| ----------- | ------- | ----------------------------------------------------------------------------------------- |
| item        | string  | the Media ID                                                                              |
| streamtype  | integer | the Media Streamtype                                                                      |
| reaction    | integer | the Reaction itself \[haha, love, shock, sad, angry]                                      |
| timestamp   | number  | if related to a nexxPLAY Delivery, the current Media Timestamp                            |
| currentitem | integer | the ID of the currently active Item - if the target Streamtype is a Container Streamtype. |

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

```
```

{% endtab %}
{% endtabs %}

## /addlike

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addlike`

#### Query Parameters

| Name        | Type    | Description                                                                               |
| ----------- | ------- | ----------------------------------------------------------------------------------------- |
| item        | integer | the Media ID                                                                              |
| streamtype  | string  | the Media Streamtype                                                                      |
| timestamp   | number  | if related to a nexxPLAY Delivery, the current Media Timestamp                            |
| currentitem | integer | the ID of the currently active Item - if the target Streamtype is a Container Streamtype. |

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

```
```

{% endtab %}
{% endtabs %}

## /addtofavourites

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addtofavourites`

#### Query Parameters

| Name        | Type    | Description                                                                               |
| ----------- | ------- | ----------------------------------------------------------------------------------------- |
| item        | integer | the Media ID                                                                              |
| streamtype  | string  | the Media Streamtype                                                                      |
| timestamp   | number  | if related to a nexxPLAY Delivery, the current Media Timestamp                            |
| currentitem | integer | the ID of the currently active Item - if the target Streamtype is a Container Streamtype. |

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

```
```

{% endtab %}
{% endtabs %}

## /addtowatchlist

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addtowatchlist`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /addtocart

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addtocart`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /expressinterest

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/expressinterest`

#### Query Parameters

| Name        | Type    | Description                                                                               |
| ----------- | ------- | ----------------------------------------------------------------------------------------- |
| item        | integer | the Media ID                                                                              |
| streamtype  | string  | the Media Streamtype                                                                      |
| message     | string  | an optional Message, given by the User                                                    |
| timestamp   | number  | if related to a nexxPLAY Delivery, the current Media Timestamp                            |
| currentitem | integer | the ID of the currently active Item - if the target Streamtype is a Container Streamtype. |

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

```
```

{% endtab %}
{% endtabs %}

## /removecomment

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removecomment`

#### Query Parameters

| Name | Type    | Description           |
| ---- | ------- | --------------------- |
| item | integer | the ID of the Comment |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Please notice, that this Method needs the **Comment ID** as item, not as usual the Media ID as item (as every User may leave multiple Comments on a Media Item)
{% endhint %}

## /removerate

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removerate`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /removelike

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removelike`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /removereaction

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removereaction`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /removefromfavourites

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removefromfavourites`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /removefromwatchlist

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removefromwatchlist`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /removefromcart

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removefromcart`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## Advanced Interactions

## /addtowatched

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/addtowatched`

This Methods fills the serverside Watch History of a User. The User must be loggedin for this Method. Besides non-Player Media Types, this Method should only be called by nexxPLAY directly.

#### Query Parameters

| Name            | Type    | Description                                                    |
| --------------- | ------- | -------------------------------------------------------------- |
| item            | string  | the Media ID                                                   |
| streamtype      | string  | the Media Streamtype                                           |
| mediasession    | string  | the Media Session                                              |
| payContext      | string  | the Reason for Playback on a Pay Element                       |
| parentContext   | string  | the parent Streamtype, if available                            |
| parentItem      | number  | the parent Media ID, if available                              |
| isPreview       | boolean | set to 1, if the Playback was a Pay Preview                    |
| isBumper        | boolean | set to 1, if Media is a Bumper                                 |
| isMuted         | boolean | set to 1, if Media started muted                               |
| isLocalPlayback | boolean | set to 1, if the Playback happend on a locally downloaded Item |
| playbackTime    | number  | the Timest                                                     |

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

```
```

{% endtab %}
{% endtabs %}

## /flagcomment

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/flagcomment`

#### Query Parameters

| Name | Type    | Description           |
| ---- | ------- | --------------------- |
| item | integer | the ID of the Comment |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Please notice, that this Method needs the **Comment ID** as item, not as usual the Media ID as item.
{% endhint %}

## /finishcart

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/finishcart`

#### Query Parameters

| Name  | Type    | Description                           |
| ----- | ------- | ------------------------------------- |
| title | integer | an optional Name for the current Cart |

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

```
```

{% endtab %}
{% endtabs %}

## /joinevent

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/joinevent`

#### Query Parameters

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| item | integer | the ID of the Event to join |

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

```
```

{% endtab %}
{% endtabs %}

## /jointeam

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/jointeam`

#### Query Parameters

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| item | integer | the ID of the Team to join |

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

```
```

{% endtab %}
{% endtabs %}

## /unjoinevent

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/unjoinevent`

#### Query Parameters

| Name | Type    | Description                  |
| ---- | ------- | ---------------------------- |
| item | integer | the ID of the Event to leave |

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

```
```

{% endtab %}
{% endtabs %}

## /unjointeam

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/unjointeam`

#### Query Parameters

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| item | integer | the ID of the Team to leave |

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

```
```

{% endtab %}
{% endtabs %}

## /removefromhistory

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removefromhistory`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /registerclickedlink

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/registerclickedlink`

#### Query Parameters

| Name | Type   | Description     |
| ---- | ------ | --------------- |
| url  | string | the clicked URL |

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

```
```

{% endtab %}
{% endtabs %}

## /createclip

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/createclip`

#### Query Parameters

| Name       | Type   | Description                        |
| ---------- | ------ | ---------------------------------- |
| item       | string | the Media ID                       |
| streamtype | string | the Media Streamtype               |
| from       | number | the desired Start of the new Scene |
| to         | number | the desired End of the new Scene   |
| title      | string | the desired Scene Title            |

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

```
```

{% endtab %}
{% endtabs %}

## /preparedownload

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/preparedownload`

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## /prepareofflinedownload

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/prepareofflinedownload`

This Method needs a valid Session, that has been created in an App Context.

#### Query Parameters

| Name        | Type    | Description                                    |
| ----------- | ------- | ---------------------------------------------- |
| item        | number  | the Media ID                                   |
| streamtype  | string  | the Media Streamtype                           |
| protection  | integer | the desired Protection \[drm, plain]           |
| triggeredBy | string  | the Way the Download was started \[sdk, media] |

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

```
```

{% endtab %}
{% endtabs %}

## /finishofflinedownload

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/finishofflinedownload`

This Method needs a valid Session, that has been created in an App Context.

#### Query Parameters

| Name        | Type    | Description                                             |
| ----------- | ------- | ------------------------------------------------------- |
| item        | string  | the Media ID                                            |
| streamtype  | string  | the Media Streamtype                                    |
| operationid | number  | the Operation ID from the prepareofflinedownload Method |
| bytes       | integer | the received Size of the File                           |
| result      | string  | \[ok, error]                                            |

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

```
```

{% endtab %}
{% endtabs %}

## /removeofflinedownload

<mark style="color:red;">`DELETE`</mark> `https://api.nexx.cloud/v3.1/interactions/removeofflinedownload`

This Method needs a valid Session, that has been created in an App Context.

#### Query Parameters

| Name       | Type    | Description          |
| ---------- | ------- | -------------------- |
| item       | integer | the Media ID         |
| streamtype | string  | the Media Streamtype |

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

```
```

{% endtab %}
{% endtabs %}

## Template Interactions

## /sendform

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/sendform`

All Form Elements, that are marked as mandatory must be sent via POST Parameters, as filled out by the User.

#### Query Parameters

| Name           | Type    | Description                          |
| -------------- | ------- | ------------------------------------ |
| item           | integer | the Form ID                          |
| currentHistory | string  | the current Referrer URL             |
| attachedFile   | integer | the ID of an existing nexxOMNIA File |

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

```
```

{% endtab %}
{% endtabs %}

## /sendpoll

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/sendpoll`

As the Poll can be canceled anytime, the Result here is a Key/Value Object with the Question ID as Key and the User Input as value. JSON encode this Object and send it via the "**result**" Parameter.

#### Query Parameters

| Name   | Type    | Description                        |
| ------ | ------- | ---------------------------------- |
| item   | integer | the Poll ID                        |
| result | string  | JSON encoded Set of current Result |

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

```
```

{% endtab %}
{% endtabs %}

## /sendvoting

<mark style="color:green;">`POST`</mark> `https://api.nexx.cloud/v3.1/interactions/sendvoting`

#### Query Parameters

| Name   | Type    | Description        |
| ------ | ------- | ------------------ |
| item   | integer | the Voting ID      |
| voting | string  | the selected Value |

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

```
```

{% endtab %}
{% endtabs %}
