A
A
API
Search…
Put

Update an existing section

Parameters:

Name
Optional / Required
Data type
Description
Default
id
required
String
One of your section ids
name
required
String
A name for your new section
description
optional
String
A description for your new section
sorting
optional
String
Sort documents in section manually or automatically (manually, create_date_desc, create_date_asc, title_desc, title_asc)
manually
curl
PHP
JavaScript
Java
Example:
1
curl -X PUT -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "id=iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK" -d "name=Sports 2016" "http://api.yumpu.com/2.0/collection/section.json"
Copied!
Example:
1
require_once('../yumpu.php');
2
$yumpu = new Yumpu();
3
$data = array(
4
'id'=>'iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK',
5
'name' => 'Sports 2016'
6
);
7
$putSection = $yumpu->putSection($data);
8
print_r($putSection);
Copied!
Example:
1
var yumpu = require('yumpu');
2
yumpu.setToken('yourToken');
3
var parameters = {
4
id: 'iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK',
5
name: 'Sports 2016'
6
};
7
yumpu.putSection(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 = { "id=iMWWKoMS76pjqMoO_F54wo1ijuIzhbSfK",
3
"name=Sports 2016" };
4
System.out.println(y.putSection(params));
Copied!
Whatever language you are using, the result will be the same.
1
{
2
"section": [
3
{
4
"id": "e6WHgwLimYExykjX",
5
"create_date": "2016-09-06 15:58:35",
6
"update_date": "2016-09-13 10:01:31",
7
"name": "Sports 2016",
8
"description": "Sports",
9
"sorting": "manually",
10
"order": 1,
11
"documents": {
12
"55910932": {
13
"id": 55910932,
14
"user_id": 106836286,
15
"title": "new title",
16
"description": "",
17
"cover": "http://img.yumpu.com/55910932/1/115x163/new-title.jpg",
18
"create_date": "2016-09-06 12:46:48",
19
"update_date": "2016-09-06 12:48:03",
20
"cover_size": "115x163",
21
"pages": 3,
22
"language": "de",
23
"settings": {
24
"privacy_mode": "public"
25
},
26
"sha1_checksum": "4cf2c13c2692e0054d3837e3c7848ec8319111dd"
27
},
28
"55914449": {
29
"id": 55914449,
30
"user_id": 106836286,
31
"title": "Audi Modelle",
32
"description": "",
33
"cover": "http://img.yumpu.com/55914449/1/109x163/audi-modelle.jpg",
34
"create_date": "2016-09-07 10:11:48",
35
"update_date": "2016-09-07 10:13:03",
36
"cover_size": "109x163",
37
"pages": 69,
38
"language": "de",
39
"settings": {
40
"privacy_mode": "public"
41
},
42
"sha1_checksum": "45330f1f1bae0c0344046c487105a2a0efa2c194"
43
}
44
}
45
}
46
],
47
"state": "success",
48
"status_code": 200,
49
"completed_in": 0.1772
50
}
Copied!
Last modified 1yr ago