updateSingleOffer

❗️

Deprecated

JSON-RPC updateSingleOffer method is deprecated.

Use this method and change the existing 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. You have to be owner.
offerData*objectNo description
-price*floatOffer price (in publisher's currency), value between 0.14 and 99.99
-title*stringTitle of the offer, up to 70 chars.
-url*stringUrl to your content.
-description*stringAdditional offer description, up to 110 chars
-videoId*stringLink offer with unique video asset id
-contentExternalId*stringThis 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*stringIf you want to store a few extra elements related to the sale you can use this string to store additional data.
-tags*arrayTags attached to offer
-geoRestrictionEnabled*boolSet "true" to enable geo-restriction on this offer
-geoRestrictionType*stringChoose type of geo-restriction: whitelist / blacklist
-geoRestrictionCountries*arrayBased on geoRestrictionType, set the array of whitelisted/blacklisted countries.

API Request/Response

Request

{
  "method":"updateSingleOffer",
  "params":{
    "publisherToken":"VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP",
    "offerId":"R582647327_NL",
    "offerData":{
      "price":"19",
      "title":"Monetize your content",
      "url":"http:\/\/your-site.url\/page_with_content",
      "description":"Great article how you can monetize your content using Cleeng",
      "videoId":"",
      "contentExternalId":"",
      "contentExternalData":"",
      "tags":[
        "sport",
        "hockey"
      ]
    }
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

{
	"jsonrpc": "2.0",
	"id": "1",
	"error": null,
	"result": {
		"id": "R582647327_NL",
		"url": "http://your-site.com/view-item-here",
		"type": "article",
		"pageTitle": "My Blog",
		"price": 19,
		"publisherId": "123123123",
		"currency": "USD",
		"currencySymbol": "\u00a3",
		"description": "Buy this item for just $0.49. You will love it!",
		"shortUrl": "http://cleeng.it/m0zdx7",
		"publisherName": "John McBlogger",
		"averageRating": 4,
		"createdAt": 1353067309,
		"updatedAt": 1353067309,
		"myId": "",
		"myData": ""
	}
}

PHP Example

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

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

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

?>