updateRentalOffer

❗️

Deprecated

JSON-RPC updateRentalOffer method is deprecated.

Change parameters of the offer. Read more about all types of offers here. If the property is omitted, it won't be updated.

🚧

Warning

This API is no longer supported for offers with localized versions. If you would like to create or modify an offer with localizations, you can do so directly in the Cleeng dashboard.

Parameters

NameTypeDescription
publisherToken*stringYou can find your publisher token at api-keys page.
offerId*stringSet identifier of the offer you want to update.
offerDataobjectNo description
-pricefloatOffer price (in publisher's currency)
-titlestringTitle of the offer. Up to 70 chars.
-periodintegerAmount of time after which purchase will expire (in hours)
-urlstringUrl to content
-descriptionstringAdditional offer description. Up to 110 chars.
-videoIdstringLink offer with unique video asset id
-contentExternalIdstringThis parameter is for your own usage. You can put here id of article or video, anything what can make your offer clearer for you.
-contentExternalDatastringIf you want to store a few extra elements related to the sale you can use this string to store additional data.
-tagsarrayTags attached to offer
-geoRestrictionEnabledboolSet "true" to enable geo-restriction on this offer
-geoRestrictionTypestringChoose type of geo-restriction: whitelist / blacklist
-geoRestrictionCountriesarrayBased on geoRestrictionType, set the array of whitelisted/blacklisted countries.

API Request/Response

Request

{
  "method":"updateRentalOffer",
  "params":{
    "publisherToken":"VNUNiFwbWJwJMD6aXbfqsTWouI8wbVKwQPh2ABnyb8dHnPtR",
    "offerId":"A727024001_US",
    "offerData":{
      "price":"12",
      "title":"test",
      "period":"120",
      "url":"http:\/\/test.com\/page_with_content",
      "description":"my first offer with Cleeng",
      "videoId":"",
      "contentExternalId":"",
      "contentExternalData":"",
      "tags":[
        "sport",
        "hockey"
      ]
    }
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

{
  "result":{
    "id":"A727024001_US",
    "publisherEmail":"[email protected]",
    "url":"http:\/\/test.com\/page_with_content",
    "title":"test",
    "description":"my first offer with Cleeng",
    "currency":"EUR",
    "videoId":"",
    "contentExternalId":"",
    "contentExternalData":"",
    "averageRating":4,
    "active":false,
    "createdAt":1353067309,
    "updatedAt":1353067309,
    "price":12,
    "tags":[
      "sport",
      "hockey"
    ]
  },
  "id":"1",
  "error":null,
  "jsonrpc":"2.0"
}

PHP Example

<?php
    $offerId = 'R727024001_PL';
    $offerSetup = array(
    'price' => 0.69,
    'period' => 48,
    'url' => 'http://your-site.com/watch/bipbip_12/',
    'tags' => array('cartoon', 'bip bip and Coyote')
    );

    $cleengApi = new Cleeng_Api();
    $cleengApi->setPublisherToken('Y72a8Cr0KQciwzU7DbOcSXOFL1gT9a6gIYRb6hhOvCdPaxKW');

    $cleengApi->updateRentalOffer($offerId, $offerSetup);

?>