Meride API - Google DART - Create

This page explains how to create Google Dart elements.

Entity name: addart.

POST http://API_DOMAIN/rest/v2/addart.{format}

Attributes

Attribute Value Mandatory
title A non-empty string YES
type linear or non-linear YES
source_url URL of the DART tag. If the Ad WaterFall feature is active, pass the various separate URLs of the three characters *** YES
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]" -X POST http://API_DOMAIN/rest/v2/addart.json -d '
{
    "title": "DART title",
    "type": "linear",
    "source_url": "http:\/\/tag_dart.com",
    "replace_rules": [
        {
            "subject": "[random-number]",
            "value": "random-number"
        },
        {
            "subject": "[url]",
            "value": "url-video"
        }
    ],
    "description": "description"
}'
            

Example of a JSON response

{
    "adv_type": "dart",
    "id": "2",
    "type": "linear",
    "title": "DART 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 object created will be returned as a response

PHP SDK documentation
$merideApi = new Meride\Api('[your-auth-code]', 'http://API_DOMAIN/', 'v2');
$response = $merideApi->create('addart', array (
  'title' => 'DART title',
  'type' => 'linear',
  'source_url' => 'http://tag_dart.com',
  'replace_rules' => 
  array (
    0 => 
    array (
      'subject' => '[random-number]',
      'value' => 'random-number',
    ),
    1 => 
    array (
      'subject' => '[url]',
      'value' => 'url-video',
    ),
  ),
  'description' => 'description',
));