A
A
API
Search…
Put

Update an existing subscription

Parameters:

Name
Optional / Required
Data type
Description
Default
id
required
String
One of your subscription ids
itc_product_id
required
String
min. 5 characters, max. 255 characters
name
required
String
min. 5 characters, max. 50 characters
duration
required
Integer
7, 31, 62, 93, 186 or 365 (days)
description
optional
String
min. 5 characters, max. 255 characters
kiosks
optional
String
One or multiple kiosk ids (webkiosk_123 or webkiosk_123,appkiosk_456), values must start with webkiosk_ or appkiosk_
curl
PHP
JavaScript
Java
Example:
1
curl -X PUT -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "id=B7OxpT5ji53wLuR2" -d "itc_product_id=subscription6" -d "name=subscription6" -d "description=subscription6" -d "duration=365" -d "kiosks=webkiosk_25,webkiosk_1572" "http://api.yumpu.com/2.0/account/subscription.json"
Copied!
Example:
1
require_once('../yumpu.php');
2
$yumpu = new Yumpu();
3
$data = array(
4
'id' => 'B7OxpT5ji53wLuR2',
5
'itc_product_id' => 'subscription6',
6
'name' => 'subscription6',
7
'duration' => 365,
8
'description' => 'subscription6',
9
'kiosks' => 'webkiosk_25,webkiosk_1572'
10
);
11
$putSubscription = $yumpu->putSubscription($data);
12
print_r($putSubscription);
Copied!
Example:
1
var yumpu = require('yumpu');
2
yumpu.setToken('yourToken');
3
var parameters = {
4
id: 'B7OxpT5ji53wLuR2',
5
itc_product_id: 'subscription6',
6
name: 'subscription6',
7
description: 'subscription6'.
8
duration: 365,
9
kiosks: 'webkiosk_25,webkiosk_1572'
10
};
11
yumpu.putSubscription(parameters, function(statusCode, document){
12
console.log('Status: ' + statusCode);
13
console.log(document);
14
});
Copied!
Example:
1
Yumpu y = new Yumpu("your access token");
2
String[] params = {"id=B7OxpT5ji53wLuR2", "itc_product_id=subscription6", "name=subscription6", "duration=365", "description=subscription6", "kiosks=webkiosk_25,webkiosk_1572"};
3
System.out.println(y.putSubscription(params));
Copied!
Whatever language you are using, the result will be the same.
1
{
2
"subscription": {
3
"id": "B7OxpT5ji53wLuR2",
4
"create_date": "2015-02-03 12:34:18",
5
"update_date": "2015-02-03 12:40:54",
6
"itc_product_id": "subscription6",
7
"name": "subscription6",
8
"description": "subscription6",
9
"duration": "365",
10
"kiosks": [
11
{
12
"id": "25",
13
"type": "webkiosk"
14
},
15
{
16
"id": "1572",
17
"type": "webkiosk"
18
}
19
]
20
},
21
"state": "success",
22
"completed_in": "0.0687"
23
}
Copied!
Last modified 1yr ago