Meride API - Google DART - Update

This page explains how to update Google Dart elements.

Entity name: addart.

PUT http://API_DOMAIN/rest/v2/addart/{resource-id}.{format}

{resource-id}: the object ID

Attributes

Parameter Value Mandatory
title A non-empty string NO
type linear or non-linear NO
source_url URL of the DART tag. If the Ad WaterFall feature is active, pass the various separate URLs of the three characters *** NO
description A string NO
replace_rules An array describing the replace rules to be associated with DART. subject identifies the string to replace in source_url. value the type of value to be attributed to the replacement.
Below is an example in json format
[
	{
		"subject": "[random-number]",
		"value": "random-number"
	},
	{
		"subject": "[url]",
		"value": "url-video"
	}
]
			        	
Values accepted per field value: random-number,url-video,url-page,url-primary,url-secondary,url-tertiary
NO

Note Each replace rule will replace the specified string (subject) in the advertising URL with the chosen value (value)

Example replace rule.
source_url: http://adserver/tag.xml?rnd=[random-number]
replace_rules: [{"subject": "[random-number]","value": "random-number"}]

the ad tag that will be called will be similar to the following:
http://adserver/tag.xml?rnd=23471990

Response

Field Value Description
adv_type string Ad type
id string Object ID
type string DART type.linear or non-linear
title string Object title
source_url string URL associated with the object
replace_rules json array Set of specified replace rules
description string The associated description
created_at string The create date that follows the format Y-m-d H:i:s
Y(year) m(month) d(day) H(hours) i(minutes) s(seconds)

Example of a request

curl -i -H "Accept: application/json" -H "Content-Type:application/json" -H "access-token: [your-access-token]" -H "X-HTTP-Method-Override: PUT" -X POST http://API_DOMAIN/rest/v2/addart/2.json -d '
{
    "title": "New title"
}'
            

Example of a JSON response

{
    "adv_type": "dart",
    "id": "2",
    "type": "linear",
    "title": "New title",
    "source_url": "http://tag_dart.com",
    "replace_rules": [
        {
            "subject": "[random-number]",
            "value": "random-number"
        },
        {
            "subject": "[url]",
            "value": "url-video"
        }
    ],
    "description": "description",
    "created_at": "2018-06-11 15:51:54"
}            

Note The updated object will be returned as a response

Note The PUT method is not supported by all systems. In case of problems, add the parameter to the Header of the callX-HTTP-Method-Override: PUT and use the method POST as default

PHP SDK documentation
$merideApi = new Meride\Api('[your-auth-code]', 'http://API_DOMAIN/', 'v2');
$response = $merideApi->update('addart', '2', array (
  'title' => 'New title',
));