Document Embed Update

Change the display options of a document embed. When display options are updated please allow for a few minutes propagation time before widget will pick up the changes.

Action: issuu.document_embed.update

Authentication

This method requires authentication.

Request parameters

| Name                 | Data type | Description                              |
|----------------------|-----------|------------------------------------------|
| apiKey (required)    | string    | Application key for the account          |
| signature (required) | string    | See Signing Requests                     |
| embedId (required)   | integer   | Identifies the embed to update           |
| documentId           | string    | The document this embed should display   |
| readerStartPage      | list      | The page in the document that should     |
|                      |           | initially be displayed                   |
| description          | integer   | Description of the document. Max length: |
|                      |           | 1000 characters                          |
| width                | integer   | Width in pixels of embed widget. If      |
|                      |           | width/height is changed the embed code   |
|                      |           | should be generated again (alternatively |
|                      |           | the HTML style parameter in the embed    |
|                      |           | code can be manually updated)            |
| height               | integer   | Height in pixels of embed widget         |
| format               | enum      | Must be "xml" or "json" - default is     |
|                      |           | "xml". See Getting started for further   |
|                      |           | details                                  |
| jsonCallback         | string    | function wrapper for JSONP requests. See |
|                      |           | Getting started for further details      |

Here is a basic example of an HTML upload form.

<form action="http://api.issuu.com/1_0" method="get">
  <input type="hidden" name="action" value="issuu.document_embed.update"/>
  <input type="hidden" name="apiKey" value="g0ch5rj9ywztlo022w70naymutm2fbbg"/>
  <input type="text" name="documentId"/>
  <input type="text" name="width"/>
  <input type="text" name="height"/>
  <input type="submit" value="Update"/>
</form>

Response parameters

| Name            | Data type | Description                                    |
|-----------------|-----------|------------------------------------------------|
| id              | integer   | Id number of embed                             |
| dataConfigId    | string    | Configuration identifier for HTML code. Tells  |
|                 |           | the embed widget which document embed to       |
|                 |           | display                                        |
| documentId      | string    | Unique identifier of the document shown by the |
|                 |           | embed. If document is deleted or removed after |
|                 |           | embed was created the field will be omitted    |
|                 |           | from response                                  |
| readerStartPage | integer   | The page in the document which will initially  |
|                 |           | be displayed.                                  |
| width           | integer   | Width in pixels of the widget when embedded in |
|                 |           | webpage                                        |
| height          | integer   | Height in pixels of the widget when embedded   |
|                 |           | in webpage                                     |
| created         | datetime  | Timestamp for when embed was created in W3C    |
|                 |           | format.                                        |

Example responses

XML

<rsp stat="ok">
    <documentEmbed
        id="1000085"
        dataConfigId="1001221/1000085"
        documentId="131031162639-5aba6365a6c84fcca627ad4c5fdff4c4"
        readerStartPage="3"
        width="320"
        height="240"
        created="2013-10-31T16:32:03.000Z"
    />
</rsp>

JSON

{
    "rsp": {
        "_content": {
            "documentEmbed": {
                "id": 1000085,
                "dataConfigId": "1001221/1000085",
                "documentId": "131031162639-5aba6365a6c84fcca627ad4c5fdff4c4",
                "readerStartPage": 3,
                "width": 320,
                "height": 240,
                "created": "2013-10-31T16:26:40.000Z"
            }
        },
        "stat": "ok"
    }
}

Error codes

| Code | Message                   |
|------|---------------------------|
| 009  | Authentication required   |
| 010  | Invalid API key           |
| 200  | Required field is missing |
| 201  | Invalid field format      |