API.publishFromText
This action allows you to publish a document from raw text.
Request
The API key must have the publish access right.
Note: Endpoint must be http://upload.calameo.com/1.0
| Name | Type | Description |
|---|---|---|
| apikey[required] | string | API public key |
| signature[required] | string | Signature of the request. See how to sign your requests. |
| expires[required] | timestamp | UNIX timestamp for request expiration. |
| output | string | Format of the response. Either XML (default), JSON or PHP. |
| text[required] | string | Text to use as the document content. |
| subscription_id[required] | integer | ID of the subscription. |
| category[required] | string | Category reference. |
| format[required] | string | Format reference. |
| dialect[required] | string | Language reference. |
| 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. |
| is_published | boolean | Activation status. Either 0 (disabled) or 1 (enabled). |
| publishing_mode | integer | Access to the publication. Either 1 (public) or 2 (private). |
| private_url | boolean | Use a private URL. Either 0 (disabled) or 1 (enabled). |
| view | integer | Default view ing mode. Either book, slide, bookindex or slideindex. |
| subscribe | integer | Allow subscribers' access. Either 0 (disabled) or 1 (enabled). |
| comment | integer | Comments behaviour. Either 0 (disabled), 1 (moderate all), 2 (moderate all except contacts), 3 (accept only contacts) or 4 (accept all). |
| download | integer | Download behaviour. Either 0 (disabled), 1 (only contacts) or 2 (everyone). |
| integer | Print behaviour. Either 0 (disabled), 1 (only contacts) or 2 (everyone). | |
| annotation_view | integer | Annotation viewing behaviour. Either 0 (disabled), 1 (only contacts) or 2 (everyone). |
| annotation_add | integer | Annotation adding behaviour. Either 0 (disabled), 1 (only contacts) or 2 (everyone). |
| extract | integer | not yet implemented. |
| mini | integer | Allow MiniCalaméo. Either 0 (disabled) or 1 (enabled). |
| 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 "manga mode"). |
| license | string | License. Either <empty> (traditionnal 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. (see CSML documentation) |
| 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
Returns a publication.
Example responses
<response>
<requestid>...</requestid>
<requests>...</requests>
<status>ok</status>
<content>
<ID>...</ID>
<AccountID>...</AccountID>
<SubscriptionID>...</SubscriptionID>
<Name>...</Name>
<Description>...</Description>
<Status>...</Status>
<IsPublished>...</IsPublished>
<IsPrivate>...</IsPrivate>
<AuthID>...</AuthID>
<AllowMini>...</AllowMini>
<Date>...</Date>
<Creation>...</Creation>
<Modification>...</Modification>
</content>
</response>
{
"response": {
"requestid": ...,
"requests": ...,
"status": "ok",
"content": {
"ID": ...,
"AccountID": ...,
"SubscriptionID": ...,
"Name": ...,
"Description": ...,
"Status": ...,
"IsPublished": ...,
"IsPrivate": ...,
"AuthID": ...,
"AllowMini": ...,
"Date": ...,
"Creation": ...,
"Modification": ...
}
}
}
[
"response" => [
"requestid" => ...,
"requests" => ...,
"status" => "ok",
"content" => [
"ID" => ...,
"AccountID" => ...,
"SubscriptionID" => ...,
"Name" => ...,
"Description" => ...,
"Status" => ...,
"IsPublished" => ...,
"IsPrivate" => ...,
"AuthID" => ...,
"AllowMini" => ...,
"Date" => ...,
"Creation" => ...,
"Modification" => ...
]
]
]
Error codes
See the error code section.
