Returns one level of a DMP's segment tree: the top level, or the children of parentId.
Reference
GET https://YOUR-NETWORK-DOMAIN/rest-api/targeting/dmp/{dmp}/segments.do
Returns one level of a DMP's segment tree: the top level, or the children of parentId. Each entry has id (the dmpSegmentId to send to the DMP create endpoints), title, and segment, which is false for a folder whose children are fetched with its id as parentId. Requires MANAGE_DEMAND_TARGETING or MANAGE_SUPPLY_PRE_TARGETING, TARGETING_DMP or PRETARGETING_DMP, and the DMP's own permission.
Path Params
dmpstringrequired
DMP — enum name or numeric ID
FIRST_PARTY
Query Params
parentIdinteger
Optional parent segment ID; omit for the top level
477
Responses
200
Success; empty when parentId is not a segment of this DMP
using var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://YOUR-NETWORK-DOMAIN/rest-api/targeting/dmp/FIRST_PARTY/segments.do?parentId=477");
request.Headers.Add("X-Api-Key", "YOUR_API_KEY");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());