A
A
API
Search…
Post file

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
site_pageview
optional
String
Show document in single or double pageview. double or single
double
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
curl
PHP
JavaScript
Java
Example:
1
curl -X POST -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -H "Content-Type: multipart/form-data" -F "[email protected]" -F "title=My document title" "http://api.yumpu.com/2.0/document/file.json"
Copied!
Example:
1
require_once('../yumpu.php');
2
$yumpu = new Yumpu();
3
$data = array(
4
'title' => 'My document title',
5
'file' => dirname(__FILE__).'/media/'.'yumpu.pdf',
6
);
7
$newDocument = $yumpu->postDocumentFile($data);
8
print_r($newDocument);
Copied!
Example:
1
var yumpu = require('yumpu');
2
yumpu.setToken('yourToken');
3
var parameters = {
4
title: 'My document title',
5
file: './example/media/yumpu.pdf'
6
};
7
yumpu.postDocumentFile(parameters, function(statusCode, document){
8
console.log('Status: ' + statusCode);
9
console.log(document);
10
});
Copied!
Example:
1
Yumpu y = new Yumpu("your access token");
2
String[] params = {
3
"file=src\\at\\fes\\examples\\media\\yumpu.pdf",
4
"title=My document title"};
5
System.out.println(y.postDocumentFile(params));
Copied!
Whatever language you are using, the result will be the same.
1
{
2
"file": {
3
"client_name": "yumpu.pdf",
4
"server_name": "0aa377bfbe89a1e19803f7b597209ebe57d7a6a19db0b8.05986686.pdf",
5
"size": "16.8 MB",
6
"mime_type": "application/pdf",
7
"sha1_checksum": "45330f1f1bae0c0344046c487105a2a0efa2c194",
8
"md5_checksum": "d525a6db5cd8eb5a20200a78c5655dc8"
9
},
10
"document": {
11
"title": "My document title"
12
},
13
"progress_id": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
14
"state": "success",
15
"completed_in": 0.4008
16
}
Copied!
Last modified 1yr ago