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_

Example:

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"

Example:

require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'id' => 'B7OxpT5ji53wLuR2',
    'itc_product_id' => 'subscription6',
    'name' => 'subscription6',
    'duration' => 365,
    'description' => 'subscription6',
    'kiosks' => 'webkiosk_25,webkiosk_1572'
);
$putSubscription = $yumpu->putSubscription($data);
print_r($putSubscription);

Example:

var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
  id: 'B7OxpT5ji53wLuR2',
  itc_product_id: 'subscription6',
  name: 'subscription6',
  description: 'subscription6'.
  duration: 365,
  kiosks: 'webkiosk_25,webkiosk_1572'
};
yumpu.putSubscription(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});

Example:

Yumpu y = new Yumpu("your access token");
String[] params = {"id=B7OxpT5ji53wLuR2", "itc_product_id=subscription6", "name=subscription6", "duration=365", "description=subscription6", "kiosks=webkiosk_25,webkiosk_1572"};
System.out.println(y.putSubscription(params));

Whatever language you are using, the result will be the same.

{
  "subscription": {
    "id": "B7OxpT5ji53wLuR2",
    "create_date": "2015-02-03 12:34:18",
    "update_date": "2015-02-03 12:40:54",
    "itc_product_id": "subscription6",
    "name": "subscription6",
    "description": "subscription6",
    "duration": "365",
    "kiosks": [
      {
        "id": "25",
        "type": "webkiosk"
      },
      {
        "id": "1572",
        "type": "webkiosk"
      }
    ]
  },
  "state": "success",
  "completed_in": "0.0687"
}

results matching ""

    No results matching ""