updateRentalOffer

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

📘

You can try that method by clicking here

🚧

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

Name

Type

Description

publisherToken*

string

You can find your publisher token at api-keys page.

offerId*

string

Set identifier of the offer you want to update.

offerData

object

No description

-price

float

Offer price (in publisher's currency)

-title

string

Title of the offer. Up to 70 chars.

-period

integer

Amount of time after which purchase will expire (in hours)

-url

string

Url to content

-description

string

Additional offer description. Up to 110 chars.

-videoId

string

Link offer with unique video asset id

-contentExternalId

string

This parameter is for your own usage. You can put here id of article or video, anything what can make your offer clearer for you.

-contentExternalData

string

If you want to store a few extra elements related to the sale you can use this string to store additional data.

-tags

array

Tags attached to offer

-geoRestrictionEnabled

bool

Set "true" to enable geo-restriction on this offer

-geoRestrictionType

string

Choose type of geo-restriction: whitelist / blacklist

-geoRestrictionCountries

array

Based 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);

?>