Create a new document - file

Parameters

Note: Requests must be multipart/form-data encoded.

Name Optional / Required Data type Description Default
file required String File data. Max. file size is 600 MB.
title required String A title for your document. Min. length 5 characters, max. length 255 characters
description optional String A description for your document. Min. length 5 characters, max. length 2500 characters
category optional Integer 1, 2 or ... (A list of valid category ids: Document categories) 0 = None
language optional String en, de or ... (A list of valid languages: Document languages) en
tags optional String A list of words seperated by comma (house,garden,balcony). Min. length 3 characters, max. length 30 characters. Allowed characters a-z and a space. Autogenerated by tag service
visibility optional String public, private, rprotected, pprotected, dprotected, webkiosk, appkiosk or webappkiosk (rprotected = protected by referrer, pprotected = protected by password, dprotected = protected by domain(s)) public
domains optional String A list of domains seperated by a comma (Note: Visibility must be set to dprotected) Examples: yumpu.com, blog.yumpu.com, developers.yumpu.com yumpu.com
validity optional String Valid from and / or valid until Examples: 2013-10-01T00:00:00-2013-10-30T23:59:59 (valid from 2013-10-01 00:00:00, valid until 2013-10-30 23:59:59) 2013-10-01T00:00:00- (valid from 2013-10-01 00:00:00-) -2013-10-30T23:59:59 (valid until -2013-10-30 23:59:59)
blurred optional String Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
page_teaser_image optional String Image data The image must be less than 2 MB in size. Allowed mime types are image/gif, image/jpeg, image/pjpeg, image/png and image/x-png. The image will be resized to fit in the page dimensions (of your magazine). Note: If you use page_teaser_image, the parameters page_teaser_page_range and page_teaser_url are required.
page_teaser_page_range optional String Page numbers seperated by comma. Examples: 1-2, 5-9, 11-
page_teaser_url optional String A valid URL. Examples: http://www.yumpu.com/en
downloadable optional String Allow users to download your source pdf file. y or n n
detect_elements optional String Detect elements automatically? y or n y
recommended_magazines optional String Show recommended magazines on Yumpu? y or n y
social_sharing optional String Show social sharing buttons on Yumpu. y or n y
player_social_sharing optional String Show social sharing buttons in Yumpu Player. y or n y
player_download_pdf optional String Show button "download pdf" in Yumpu Player. y or n n
player_print_page optional String Show button "print page" in Yumpu Player. y or n n
player_branding optional String Show Yumpu branding in Yumpu Player. y or n y
player_sidebar optional String Show a list of recommended documents in Yumpu Player. y or n n
player_html5_c2r optional String Activate HTML5 full screen on Yumpu. y or n y
player_outer_shadow optional String Drop shadow in Yumpu player. y or n y
player_inner_shadow optional String Shadow effects on pages. y or n y
player_ga optional String Activate Google Analytics tracking. A valid UA code from Google Analytics.
access_tags optional String One or multiple access_tag ids (myid1 or myid1,myid2)
subscriptions optional String One or multiple subscription ids (myid1 or myid1,myid2)
iap optional String Enable In-App Purchase (y or n) n
itc_product_id optional String iTunes Product ID

Example:

curl -X POST -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -H "Content-Type: multipart/form-data" -F "file=@filename.pdf" -F "title=My document title" "http://api.yumpu.com/2.0/document/file.json"

Example:

require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'title' => 'My document title',
    'file' =>  dirname(__FILE__).'/media/'.'yumpu.pdf',
);
$newDocument = $yumpu->postDocumentFile($data);
print_r($newDocument);

Example:

var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
   title: 'My document title',
   file: './example/media/yumpu.pdf'
};
yumpu.postDocumentFile(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});

Example:

Yumpu y = new Yumpu("your access token");
String[] params = {
                "file=src\\at\\fes\\examples\\media\\yumpu.pdf",
                "title=My document title"};
System.out.println(y.postDocumentFile(params));

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

{
  "file": {
    "client_name": "yumpu.pdf",
    "server_name": "0aa377bfbe89a1e19803f7b597209ebe57d7a6a19db0b8.05986686.pdf",
    "size": "16.8 MB",
    "mime_type": "application/pdf",
    "sha1_checksum": "45330f1f1bae0c0344046c487105a2a0efa2c194",
    "md5_checksum": "d525a6db5cd8eb5a20200a78c5655dc8"
  },
  "document": {
    "title": "My document title"
  },
  "progress_id": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
  "state": "success",
  "completed_in": 0.4008
}

results matching ""

    No results matching ""