A
A
API
Search…
Post

Create a new collection

Parameters:

Name
Optional / Required
Data type
Description
Default
name
required
String
A name for your collection

Demo

URL Find your token on - yumpu.com Token
name
Run request
1
Copied!
curl
PHP
JavaScript
Java
Example:
1
curl -X POST -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "name=Holidays" "http://api.yumpu.com/2.0/collection.json"
Copied!
Example:
1
require_once('../yumpu.php');
2
$yumpu = new Yumpu();
3
$data = array(
4
'name' => 'Holidays',
5
);
6
$newCollection = $yumpu->postCollection($data);
7
print_r($newCollection);
Copied!
Example:
1
var yumpu = require('yumpu');
2
yumpu.setToken('yourToken');
3
var parameters = {
4
name: 'Holidays'
5
};
6
yumpu.postCollection(parameters, function(statusCode, document){
7
console.log('Status: ' + statusCode);
8
console.log(document);
9
});
Copied!
Example:
1
Yumpu y = new Yumpu("your access token");
2
String[] params = { "name=Holidays" };
3
System.out.println(y.postCollection(params));
Copied!
Whatever language you are using, the result will be the same.
1
{
2
"collection": [
3
{
4
"id": "omkYGduXowlyx9WF",
5
"create_date": "2013-09-23 09:05:47",
6
"update_date": "0000-00-00 00:00:00",
7
"name": "Holidays",
8
"order": 0,
9
"sections": [
10
{
11
"id": "omkYGduXowlyx9WF_stVFPUYW3kHX07B6",
12
"name": "",
13
"description": "",
14
"sorting": "manually",
15
"order": 0
16
}
17
]
18
}
19
],
20
"state": "success"
21
}
Copied!
Last modified 1yr ago