Audience API

From LoopMe Wiki
Jump to: navigation, search


LoopMe Audience API

LoopMe is able to supply advertisers with an endpoint to segment users into different group and then target across their campaigns. There are 4 steps to creating a segment with 2 processes. Creating a segment and updating a segment.

Flow of segment creation:

  1. LoopMe give advertiser Vendor id and client id
  2. Advertiser creates segment with provided ids and name
  3. LoopMe responds to advertiser with a segment id
  4. Advertiser updates segment id with user ids


Creating a segment

Use this base URL to create a segment:

https://dmp.loopme.me/segment/clients/create?vendorId=x&clientId=y&segmentName=z


Parameters

Parameter Type Required Description
vendorId String Yes The Vendor ID is supplied by LoopMe. It will identify all segments within LoopMe as built by the same vendor
clientId String Yes The Client ID is provided by LoopMe. It will whitelist segments for advertisers within the LoopMe tool
segmentName String Yes The name of the segment that you would like to create.


Example

Creating example:

https://dmp.loopme.me/segment/clients/create?vendorId=1&clientId=475&segmentName=thr_party_seg_name

Success Response

 "request_status": "success",
     "segment": {
       "name": " thr_party_seg_name",
       "id": "123456",
 ] 


Adding users to a segment

LoopMe supports 2 ways of updating segments with users, updating via GET, for lower number of device ids, and updating via POST for files.

GET

Parameters

Parameter Type Required Description
vendorId String Yes The Vendor ID is supplied by LoopMe. It will identify all segments within LoopMe as built by the same vendor
clientId String Yes The Client ID is provided by LoopMe. It will whitelist segments for advertisers within the LoopMe tool
segmentId String Yes The ID of the segment that is being updated
deviceIds String Yes These are the device ids or cookie ids that should be in the segment. They can be in any format. LoopMe will serve if there is a match


Example

https://dmp.loopme.me/segment/clients/update?vendorId=1&clientId=475&segmentId=210985725&deviceIds=A-3saxoPSCWMTGKITWYDoQ&deviceIds=A-3saxoPSCWMTGKITWYDoQ&deviceIds=A-3saxoPSCWMTGKITWYDoQ&deviceIds=A-3saxoPSCWMTGKITWYDoQ&deviceIds=A-3saxoPSCWMTGKITWYDoQ&deviceIds=A-3saxoPSCWMTGKITWYDoQ

Successful Response

   "vendor_id": 1,
   "client_id": 475,
   "segment": {
       "id": 210986416,
       "name": "will_test_segment",
       "created_at": "2017-08-02T07:58:59.024Z",
       "updated_at": "2017-08-02T08:17:56.505Z",
       "approximate_number_users": 0
   }


POST

LoopMe also supports the POST of files.

Parameter Type Required Description
vendorId String Yes The Vendor ID is supplied by LoopMe. It will identify all segments within LoopMe as built by the same vendor
clientId String Yes The Client ID is provided by LoopMe. It will whitelist segments for advertisers within the LoopMe tool
segmentId String Yes The ID of the segment that is being updated
uploadFile File Yes This is the file with the ids that you would like to include in the segment. LoopMe can accept any extension. The file should just be a list in a single column of the ids

POST should be made to this address: https://dmp.loopme.me/segment/clients/update

Please ensure no headers are added.

Example

Successful response

   "vendor_id": 1,
   "client_id": 475,
   "segment": {
       "id": 210986419,
       "name": " thr_party_seg_name",
       "created_at": "2017-08-02T09:11:49.98Z",
       "updated_at": "2017-08-02T09:22:09.971Z",
       "approximate_number_users": 0
   }


Failed response

LoopMe will not allow segments to be built or updated if Vendor id or Client id are not valid


   "state": "FAIL",
   "message": "Vendor id is not valid"


   "state": "FAIL",
   "message": "Client id is not valid"