# Put

## Update a document hotspot

### Parameters:

| Name                                         | Optional / Required | Data type | Description                                                                               | Default |
| -------------------------------------------- | ------------------- | --------- | ----------------------------------------------------------------------------------------- | ------- |
| id                                           | required            | String    | One of your document hotspot ids                                                          |         |
| type                                         | required            | String    | Type can be link, video, audio or slideshow                                               |         |
| settings\[x]                                 | required            | Integer   | x position of the document hotspot                                                        |         |
| settings\[y]                                 | required            | Integer   | y position of the document hotspot                                                        |         |
| settings\[w]                                 | required            | Integer   | width of the document hotspot                                                             |         |
| settings\[h]                                 | required            | Integer   | height of the document hotspot                                                            |         |
| settings\[name]                              | required            | String    | a name for the document hotspot (min. length 5, max. length 50)                           |         |
| settings\[tooltip]                           | required            | String    | a tooltip for the document hotspot (min. length 5, max. length 50)                        |         |
| settings\[link]                              | optional            | String    | a url (valid URL)                                                                         |         |
| settings\[source]                            | optional            | String    | youtube, vimeo, flickr, soundcloud                                                        |         |
| settings\[source\_id]                        | optional            | String    | youtube: a valid youtube video id vimeo: a valid vimeo video id flickr: a valid flickr id |         |
| settings\[source\_url]                       | optional            | String    | soundcloud: a valid soundcloud url                                                        |         |
| settings\[autoplay]                          | optional            | String    | y or n                                                                                    |         |
| settings\[show\_arrows]                      | optional            | String    | y or n                                                                                    |         |
| settings\[show\_headline]                    | optional            | String    | y or n                                                                                    |         |
| settings\[object\_fit]                       | optional            | String    | "cover" or "contain"                                                                      |         |
| settings\[background\_opacity]               | optional            | Float     | 0.0 to 1                                                                                  |         |
| settings\[background\_color]                 | optional            | String    | <p>Hexadecimal value, 6 characters.<br>#000000 - #FFFFFF</p>                              |         |
| settings\[background\_color\_hover]          | optional            | String    | <p>Hexadecimal value, 6 characters.<br>#000000 - #FFFFFF</p>                              |         |
| settings\[background\_color\_hover\_opacity] | optional            | Float     | 0.0 to 1                                                                                  |         |
| settings\[hideborder]                        | optional            | String    | y or n                                                                                    |         |
| settings\[asarea]                            | optional            | String    | y or n                                                                                    |         |
| settings\[icon\_color]                       | optional            | String    | <p>Hexadecimal value, 6 characters.<br>#000000 - #FFFFFF</p>                              |         |
| settings\[icon\_opacity]                     | optional            | Float     | 0.0 to 1                                                                                  |         |
| settings\[icon\_color\_hover]                | optional            | String    | <p>Hexadecimal value, 6 characters.<br>#000000 - #FFFFFF</p>                              |         |
| settings\[icon\_color\_hover\_opacity]       | optional            | Float     | 0.0 to 1                                                                                  |         |
| settings\[icon\_size]                        | optional            | Integer   | (min 14) - (max 64)                                                                       |         |
| settings\[icon\_url]                         | optional            | String    | See below for available icons                                                             |         |

<details>

<summary>Icons (currently only available for the Link and Audio elements)</summary>

* `fa-link`
* `fa-link-simple`
* `fa-link-horizontal`
* `fa-arrow-up-right-from-square`
* `fa-square-arrow-up-right`
* `fa-dollar-sign`
* `fa-euro-sign`
* `fa-sterling-sign`
* `fa-money-bill-wave`
* `fa-credit-card`
* `fa-cart-shopping`
* `fa-bag-shopping`
* `fa-basket-shopping`
* `fa-cart-plus`
* `fa-shop`
* `fa-store`
* `fa-globe`
* `fa-envelope`
* `fa-comments`
* `fa-info`
* `fa-user`
* `fa-book`
* `fa-map-location-dot`
* `fa-play`
* `fa-music`
* `fa-volume`
* `fa-volume-low`
* `fa-volume-high`
* `fa-headphones`
* `fa-play-pause`
* `fa-podcast`
* `fa-repeat`
* `fa-microphone`
* `fa-microphone-lines`
* `fa-speaker`

</details>

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

```
curl -X PUT -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "id=02608658TXrk4GRB" -d "type=link" -d "settings[x]=0" -d "settings[y]=0" -d "settings[w]=400" -d "settings[h]=100" -d "settings[name]=Google.com" -d "settings[tooltip]=Google.com" -d "settings[link]=https://www.google.com" "https://api.yumpu.com/2.0/document/hotspot.json"
```

{% endtab %}

{% tab title="PHP" %}
Example:

```php
require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'id' => '02784dc6chuNtFd2',
    'type' => 'link',
    'settings' => array(
        'x' => 200,
        'y' => 200,
        'w' => 20,
        'h' => 20,
        'name' => 'google.com',
        'tooltip' => 'google.com',
        'link' => 'https://www.yumpu.com'
    )
);
$hotspot = $yumpu->putDocumentHotspot($data);
print_r($hotspot);
```

{% endtab %}

{% tab title="JavaScript" %}
Example:

```javascript
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
   id: '02608658TXrk4GRB',
   page: 1,
   type: 'link',
   settings: {
       x: 100,
       y: 100,
       w: 50,
       h: 50,
       name: 'google.com',
       tooltip: 'google.com',
       link: 'https://www.yumpu.com'
   }
};
yumpu.putDocumentHotspot(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});
```

{% endtab %}

{% tab title="Java" %}
Example:

```java
Yumpu y = new Yumpu("your access token");
String[] params = {"document_id=27109085", "type=link", "page=1"};
String[] settings = {"x=0", "y=0", "w=400", "h=400", "name=google.com", "tooltip=google.com", "link=https://www.yumpu.com"};
System.out.println(y.putDocumentHotspot(params, settings));
```

{% endtab %}
{% endtabs %}

Whatever language you are using, the result will be the same.

```bash
{
  "hotspot": [
    {
      "id": "02608658TXrk4GRB",
      "document_id": "27219350",
      "page": "1",
      "type": "link",
      "settings": {
        "x": "0",
        "y": "0",
        "w": "400",
        "h": "100",
        "name": "google.com",
        "tooltip": "google.com",
        "link": "https://www.yumpu.com"
      },
      "create_date": "2014-10-01 08:53:57",
      "update_date": "2014-10-01 09:09:00"
    }
  ],
  "state": "success",
  "completed_in": "0.1644"
}
```
