API - Assigning Supporters to Groups

The following tables list the endpoints that can be used for viewing and modifying the groups that supporters are assigned.

 

MethodEnd PointDetail
POST /api/integration/ext/v1/segments/members/search

Paginate through all of the supporters assigned to the segment,
or just those matching supporter ids provided in the request

PUT /api/integration/ext/v1/segments/members Assign the provided supporter ids
DELETE /api/integration/ext/v1/segments/members Remove the provided supporter ids

All calls listed above require that the API token be sent in the HTTP header using the parameter name authToken=<your_auth_token> 

 

Assigning supporters to a groups

Assigning supporters to a group is performed via the following endpoint

PUT  /api//integration/ext/v1/segments/members

  • You must include your api token with within an HTTP header parameter named authToken

 

FieldDescriptionDetailRequired
segmentId Unique id of the segment 36 character UUID yes

supporterIds

List of supporter Ids to assign to the segment 36 character UUID yes - supporters must exist within the system
in order for them to be assigned.
supporters List of supporters that were assigned to the segment.

Complex Object with the following attributes

  • supporterId
  • result which will be one of:
    • ADDED
    • UPDATED
      NOT_FOUND 
no - read-only response attribute

Assignment Request Example

{
   "payload":{
           "segmentId":"88eb5a95-d3fa-4edb-a90c-a3599c2c1166",
           "supporterIds":["b86cda64-9a7e-4186-8d9c-efd63e64bad2",
                                   "1e968fe6-a84c-4184-9cb2-42a8945f81f3",
                                   "ca9403cb-c160-4b49-912c-fc31fc22caf7"]
           }
      }

}

 

Assignment Response Example

{
     "payload":{
               "supporters":[
                    {"supporterId":"b86cda64-9a7e-4186-8d9c-efd63e64bad2","result":"ADDED"},
                    {"supporterId":"1e968fe6-a84c-4184-9cb2-42a8945f81f3","result":"UPDATED"},
                    {"supporterId":"ca9403cb-c160-4b49-912c-fc31fc22caf7","result":"NOT_FOUND"}],
                   "count":3
        }
}

 

Deleting  supporters from a group

Removing a supporter from a group is performed via the following endpoint

DELETE  /api//integration/ext/v1/segments

  • You must include your api token with within an HTTP header parameter named authToken


Delete Request Example

{
    "payload":{
           "segmentId":"cc1688b6-56ef-4db2-96d9-5526fdfed632",
           "supporterIds":["9a0ae5f4-8458-4e79-96ae-d911e0428254","326d6fad-1fc6-4e02-bf23-e73b64496aa4",
                                   "7dc73fe1-375f-436b-8a4b-2ede6e5bda75","fd2b7184-0279-4de0-aec8-d25a4bd116f6",
                                   "2fc47803-425f-41b6-99d0-e613c2f4f5df"]
       }
}


Delete Response Example

{

    "payload":{
              "supporters":[{"supporterId":"326d6fad-1fc6-4e02-bf23-e73b64496aa4","result":"DELETED"},
                                   {"supporterId":"7dc73fe1-375f-436b-8a4b-2ede6e5bda75","result":"DELETED"},
                                   {"supporterId":"9a0ae5f4-8458-4e79-96ae-d911e0428254","result":"DELETED"},
                                   {"supporterId":"fd2b7184-0279-4de0-aec8-d25a4bd116f6","result":"NOT_FOUND"},
                                   {"supporterId":"2fc47803-425f-41b6-99d0-e613c2f4f5df","result":"NOT_FOUND"}
              ],
              "count":5
       }
}

Searching for supporters assigned to a group

  • /api//integration/ext/v1/segments/search

Searching for segment assignments can be performed by providing a list of either Salsa Online ids. If no ids are provided, then standard pagination will be performed.

 

Request Body Format

{ 

"payload":{
         "segmentId" : "11454266-a9c8-40af-8fab-4c0bdca44615",
          "supporterIds":["b86cda64-9a7e-4186-8d9c-efd63e64bad2",
                                   "1e968fe6-a84c-4184-9cb2-42a8945f81f3",
                                   "ca9403cb-c160-4b49-912c-fc31fc22caf7"]
    }
}

 

ParameterLocationDescriptionRequired
segmentId payload

Id of the segment to search

no
supporterIds payload

List of supporter Ids to search for

yes
offset payload Starting count at which to retrieve assignments no
count payload Number of assignments to retrieve no - but if not provided, only the counts not the supporters will be returned
total payload Total number of assignments that exist no - read-only attribute
provided in the response

 

Request Examples

DescriptionBody
Get all group assignments
{"payload":{
"segmentId" : "11454266-a9c8-40af-8fab-4c0bdca44615",
"offset":0,
"count":20
}
}
Search for specific supporter assignments
{"payload":{
"segmentId" : "11454266-a9c8-40af-8fab-4c0bdca44615",
"supporterIds":["b86cda64-9a7e-4186-8d9c-efd63e64bad2",
                       "1e968fe6-a84c-4184-9cb2-42a8945f81f3",
                       "ca9403cb-c160-4b49-912c-fc31fc22caf7"]
"offset":0,
"count":20
}
}

 

Response Body Format

{
  "payload":{
          "count":2,
          "offset":0,
          "total':2,
          "supporters":[
                    {"supporterId":"326d6fad-1fc6-4e02-bf23-e73b64496aa4","title":"Mr","firstName":"John","lastName":"Smith","dateOfBirth":"2016-07-26T04:00:00.000Z",
                     "externalSystemId":"65249a1", ....[remaining details] ...., "result":"FOUND" },
                     {"supporterId":"326d6fad-1fc6-4e02-bf23-e73b64496aa4","result":"NOT_FOUND"}
          ]
     }
}
Have more questions? Submit a request
Powered by Zendesk