API
  • Yumpu documentations
  • JS
    • Introduction
    • Quick setup
    • Magazine example's
    • Bookshelf example's
    • FAQs
  • API
    • Introduction
    • Getting started
      • API token
      • Document API
      • User API
      • Search API
      • Install SDK's
    • Limits
    • Flowchart of basic processes
    • Documents
      • Get
    • Document
      • Get
      • Post file
      • Post url
      • Put
      • Delete
    • Document hotspots
      • Get
    • Document hotspot
      • Get
      • Post
      • Put
      • Delete
    • Document progress
      • Get
    • Document categories
      • Get
    • Document languages
      • Get
    • Countries
      • Get
    • Collections
      • Get
    • Collection
      • Get
      • Post
      • Put
      • Delete
    • Section
      • Get
      • Post
      • Put
      • Delete
    • Section document
      • Post
      • Delete
    • Search
      • Get
    • User
      • Get
      • Post
      • Put
    • Embeds
      • Get
    • Embed
      • Get
      • Post
      • Put
      • Delete
    • Members
      • Get
    • Member
      • Get
      • Post
      • Put
      • Delete
    • Access tags
      • Get
    • Access tag
      • Get
      • Post
      • Put
      • Delete
    • Subscriptions
      • Get
    • Subscription
      • Get
      • Post
      • Put
      • Delete
Powered by GitBook
On this page
  • Create a new document - file
  • Parameters

Was this helpful?

  1. API
  2. Document

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

File

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

0 = None

language

optional

String

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

rendering_type

optional

String

Rendering method used for the document in our engine. It can be instant or html.

instant

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

File

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

page_teaser_closeable

optional

String

Allow users to close teaser. y or n

n

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

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" "https://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
}
PreviousGetNextPost url

Last updated 3 months ago

Was this helpful?

1, 2 or ... (A list of valid category ids: )

en, de or ... (A list of valid languages: )

Document categories
Document languages