publishFromText
This action allows you to publish a document from plain text.
info
The API key must have access rights to publish.
Request
| Name | Type | Default | Description |
|---|---|---|---|
apikeyRequired | string | API public key | |
signatureRequired | string | Signature of the request. See how to sign your requests | |
expires | timestamp | UNIX timestamp for request expiration (GMT) | |
output | string | Format of the response. Either XML (default), JSON or PHP | |
textRequired | string | Text to use as the document content | |
subscription_idRequired | integer | ID of the folder | |
name | string | Title of the publication. If not present, the filename will be used | |
description | string | Description of the publication. If not present, the first page's text will be used | |
date | date | Date of the publication for DRM management (YYYY-MM-DD) | |
is_published | boolean | Activation status. Either 0 (disabled) or 1 (enabled) | |
publishing_mode | integer | Access to the publication. Either 1 (public) or 2 (private) | |
publish_date | datetime | Date and time (UTC) of the publication scheduled publishing (YYYY-MM-DD HH:MM:SS). | |
private_url | boolean | Use a private URL. Either 0 (disabled) or 1 (enabled) | |
view | string | Default viewing mode. Either book, slide, scroll | |
subscribe | integer | Allow subscribers' access. Either 0 (disabled) or 1 (enabled) | |
comment | integer | Comments behavior. Either 0 (disabled), 1 (moderate all) or 4 (accept all) | |
download | integer | Download behavior. Either 0 (disabled) or 2 (everyone) | |
print | integer | Print behavior. Either 0 (disabled) or 2 (everyone) | |
share | integer | Share menu. Either 0 (disabled), 1 (enabled). Enabled by default | |
adult | integer | Restrict access to adults. Either 0 (no) or 1 (yes) | |
direction | integer | Reading direction. Either 0 (left-to-right) or 1 (right-to-left) | |
license | string | License. Either empty (traditional copyright) or pd (public domain), by, by_nc, by_nc_nd, by_nc_sa, by_nd or by_sa (Creative Commons) | |
skin_url | string | Custom skin URL. Must be an absolute URL | |
logo_url | string | Custom logo URL. Must be an absolute URL | |
logo_link_url | string | Custom logo link URL. Must be an absolute URL | |
background_url | string | Custom background URL. Must be an absolute URL | |
music | integer | Background music mode. Either 0 (loop forever), 1 (play only once) | |
music_url | string | Custom background music URL. Must be an absolute URL | |
sfx | integer | Play sound effects like page flipping. Either 0 (disabled) or 1 (enabled) | |
sfx_url | string | Custom page flipping sound URL. Must be an absolute URL |
Response
This method returns a Publication.
| Name | Type | Default | Description |
|---|---|---|---|
| ID | string | ID of the publication | |
| AccountID | integer | Publication's owner account ID (should be your account ID) | |
| SubscriptionID | integer | Publication's owner subscription ID | |
| Description | string | Description of the publication | |
| Status | string | Conversion status of the publication. Either QUEUE (waiting to be converted), PROCESS (processing document), STORE (converting document), ERROR (error during conversion) or DONE (publication ready) | |
| IsPublished | integer | Sends 1 if the publication is published and 0 if not | |
| IsPrivate | integer | Sends 1 if the publication is private and 0 if not | |
| AuthID | string | Authentication parameter for private URLs (authid) | |
| AllowMini | integer | Sends 1 if the publication allows access to the miniCalaméo and 0 if not | |
| Pages | integer | Number of pages of the publication | |
| Width | integer | Width of a page of the publication | |
| Height | integer | Height of a page of the publication | |
| Views | integer | Number of views of the publication | |
| Downloads | integer | Number of downloads of the publication | |
| Comments | integer | Number of comments of the publication | |
| Favorites | integer | Number of favorites from the publication | |
| Date | date | Reference date of the publication | |
| Creation | datetime | Date of creation of the publication | |
| Publication | datetime | Scheduled date of the publication (UTC) | |
| Modification | datetime | Date of the last modification of the publication | |
| PosterUrl | string | Absolute URL for the publication's larger cover | |
| PictureUrl | string | Absolute URL for the publication's cover | |
| ThumbUrl | string | Absolute URL for the publication's thumbnail | |
| PublicUrl | string | Absolute URL for the publication's overview | |
| ViewUrl | string | Absolute URL for the publication's reading page | |
| CommentsUrl | string | Absolute URL for the publication's comments |
Example response
JSON
{
"response": {
"status": "ok",
"version": 2,
"requestid": "X9p0h2",
"requests": 213,
"content": {
"ID": "0045168255f6738ad6193",
"SubscriptionID": 4540112,
"AccountID": 4516825,
"Name": "Book",
"Description": "",
"Category": "MISC",
"Format": "MISC",
"Dialect": "unknown",
"Status": "",
"IsPublished": 1,
"IsPrivate": 1,
"AuthID": "ZuOoYt9jRzPo",
"AllowMini": 1,
"Date": "2015-10-16",
"Pages": 0,
"Width": 0,
"Height": 0,
"Views": 0,
"Downloads": 0,
"Comments": 0,
"Favorites": 0,
"PosterUrl": "",
"PictureUrl": "",
"ThumbUrl": "",
"PublicUrl": "",
"ViewUrl": "",
"Creation": "2015-10-16 11:31:51",
"Modification": "2015-10-16 11:31:51"
}
}
}