Expand my Community achievements bar.

SOLVED

DMP Trait via API

Avatar

Level 2

Hey Guys,

It's Raza from Bank of Montreal Canada, I am a part of Personalization team here. We are working on something and we need some help. Do anybody have idea about creating a DMP Trait using API. What are prerequisites and other things ?

As of current scenario I have created a tool to generate DMP ruleset and then we copy that ruleset and manually apply that to Adobe Audience Manager(AAM). And In a future iteration of this tool, i'd like to use the AAM APIs within tool to automatically create that rule in AAM once someone clicks the "generate button".  But first we need to investigate how to use the API

1 Accepted Solution

Avatar

Correct answer by
Employee

$base64_code = base64_encode($client_id.":".$client_secret);

$ch = curl_init();

$request_headers = array();

$request_headers[] = 'Content-Type: application/x-www-form-urlencoded';

$request_headers[] = 'Accept: application/json';

$request_headers[] = 'Authorization: Basic '.$base64_code;

$data_to_post = "grant_type=password&username=$username&password=$password";

curl_setopt($ch, CURLOPT_URL, "https://api.demdex.com/oauth/token");

curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data_to_post);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$result = curl_exec($ch);

$res = json_decode($result,true);

$access_token = $res['access_token'];

View solution in original post

21 Replies

Avatar

Level 4

Hi - Curious what Client you are using in the screenshots?