updateSingleOffer

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.

📘

You can try that method by clicking here

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. You have to be owner.

offerData*

object

No description

-price*

float

Offer price (in publisher's currency), value between 0.14 and 99.99

-title*

string

Title of the offer, up to 70 chars.

-url*

string

Url to your 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":"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);

?>