Salesforce DMP API for Platform Segments

Introduction

Salesforce DMP is technology agnostic and continues to support customers who use different forms of analysis, both offline and online.

The following guide is for users that perform their own offline analysis and wish to create new segments via the API. These platform segments can be comprised of a) Krux User IDs (KUIDs), b) mobile IDs c) first party ID, that has been matched with KUIDs.

Setup

Client to provide Salesforce DMP to provide
Name & Location of user-data file transfer Client’s API key
Timing
When transfer will take place (and frequency)
 
Naming Convention
Please suffix file name with date
 
File format
Recommend <tab> delimited, but can support ^
 

First, platform segments are created via the API as described below.

Next, the user-data file must be uploaded so Salesforce DMP can process and associate the users with the appropriate platform segments.

After the first user-segment file upload, please allow two weeks for Salesforce DMP to automate the file processing and make the information available in the UI.

Create Platform Segments

Platform segments are not rule-based and therefore no rules will be shown in the UI. Users for these platform segments can either by loaded from external systems or determined via external means.

A platform segment can be created by sending the following parameters as part of the API call. Use the same username/password as for Konsole.

  1. "name" : Name of platform segment – this must be unique and is mandatory.
  2. "type", "category", "sub_category", "description" : Optional organisational descriptions.

Example API

curl --user <username>:<passwd> --dump-header - -H "Content-Type: application/json" --data '{"name": "segment_a"}' https://console.krux.com/api/v1/audience/create_platform_segment/?api_key=<API_KEY>

HTTP/1.1 200 OK
...
{"message": "Segment has been created", "segment": {"category": "", "description": "", "id": 16681, "name": "segment_a", "segment_uuid": "I1p1W5QN", "segment_uuid_long": "n21l7tjtr", "sub_category": "" , "type": "" }}

Create Segments Using Other Segments

A new segment can be created using existing segments. To create a segment, a POST request needs to be sent. In the request, the following is required:

  1. "name" : Specifies the segment name
  2. "operator" : OR|AND. Specifies the operator that connects the segments.
  3. "rules" : Specifies the rules.
  4. "segments" : List of segment IDs that must be combined to create a new segment.

Example API for creating a new segment based on segments 234 and 235 which must already exist:

curl --user <username>:<passwd> --dump-header - -H "Content-Type: application/json" --data '{"name": "segment_b", "operator": "OR", "rules" : {"segment" : [234, 235]} }' https://console.krux.com/api/v1/audience/create_segment/?api_key= <API_KEY>

HTTP/1.1 200 OK
...
{"message": "Segment has been created" "segment": {"category": "", "description": "", "id": 16681, "name": "segment_b", "segment_uuid": "I1p1W5QN", "segment_uuid_long": "n21l7tjtr", "sub_category": "" , "type": "" }}

Remove Platform Segments

Platform segments can be removed using APIs as well. A platform segment can be deleted by sending a DELETE request with the following parameter as part of the API call:

  1. "segment_uuid" : UUID of the segment that needs to be removed. This is mandatory and is the same as the "segment_uuid" parameter which is returned when a platform segment is created.

Example API

curl --user <username>:<passwd> -H "Content-Type: application/json" -X DELETE https://console.krux.com/api/v1/audience/remove_platform_segment/?api_key=<API_KEY>&segment_uuid=JUd4YrAR

HTTP/1.1 200 OK
...
{"message": "Segment JUd4YrAR has been deleted"}

Upload User-data File for Platform Segments

A Salesforce DMP Amazon S3 bucket can be supplied to upload files daily.  For example  s3://krux-partners/client-NAME/uploads/platform_seg/YYYY-MM-DD/

The user data file can be gzipped or uncompressed if the size is manageable.  Files equal to or greater than 1GB should be compressed with gzip.

Please notify Salesforce DMP on the location, names, timing, and format of the user data file.  

The standard file format is:

kuid<tab>segment_uuid_long

Note: While we do prefer <tab>, we also support ^. The segment_uuid_long field is the one returned in the previous API key for the segment you wish to load.

If the user membership per segment does NOT change from day to day, do not upload the segment again.  The segment's population will not change.  

If the user membership per segment DOES change, upload the segment again with ALL users.  For example

  • Day 1 - segment A size = 100 - upload 100 ids to segment A
  • Day 2 - segment A size = 100 - do not upload any users for segment A
  • Day 3 - segment A size = 200 - upload all 200 ids to segment A

 

 

Need Help?

If you need help with Salesforce DMP API Platform Segments, don't hesitate to contact the Salesforce DMP Support team at kruxhelp@krux.com.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk