How do I add recipients in the list via API? | Community
Skip to main content
February 8, 2023
Solved

How do I add recipients in the list via API?

  • February 8, 2023
  • 2 replies
  • 2082 views

I tried using RegisterGroup function present in the nms:recipient to add a recipient to an existing list. The response is 200 OK but when I look at the adobe campaign console, the list is not updated with the recipient. This is the code that I am using:

<?xml version='1.0' encoding='ISO-8859-1'?> <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='urn:xtk:session'> <soapenv:Header/> <soapenv:Body> <urn:RegisterGroup> <urn:sessiontoken>___e3cf1125-82b4-49f4-9083-04bd1945c6d1</urn:sessiontoken> <entityList><key value="5402862"/> <where> <condition enabledIf="" expr="@id = 5402862"/> </where> </entityList> <choiceList><key value="873730"/> <where> <condition enabledIf="" expr="@id = 873730"/> </where> </choiceList> <bRegister>true</bRegister> </urn:RegisterGroup> </soapenv:Body> </soapenv:Envelope>

 

This is the response I got from API:

<?xml version='1.0'?> <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:nms:recipient' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'> <SOAP-ENV:Body> <RegisterGroupResponse xmlns='urn:nms:recipient' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'></RegisterGroupResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

 

The goal is to add recipients to the list dynamically via API.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by akshaaga

Hi @anmolwassan ,

 

If the IDs are correct and you can query the lists and recipients via the API, the issue may be with the bRegister attribute.

The value of this attribute is set to true, which indicates that you want to add the recipient to the list. If you are still unable to add the recipient to the list, you can try using a different web service method to achieve this. For example, you can use the nms:subscriber web service method Subscribe to add a recipient to a list.

Here is an example of the XML request for the Subscribe method:

<?xml version='1.0' encoding='ISO-8859-1'?>
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='urn:xtk:subscriber'>
<soapenv:Header/>
<soapenv:Body>
<urn:Subscribe>
<urn:sessiontoken>___e3cf1125-82b4-49f4-9083-04bd1945c6d1</urn:sessiontoken>
<urn:subscriberId>873730</urn:subscriberId>
<urn:listId>5402862</urn:listId>
</urn:Subscribe>
</soapenv:Body>
</soapenv:Envelope>

 

In the above example, "subscriberId" is the ID of the recipient you want to add, and listId is the ID of the list to which you want to add the recipient.

2 replies

akshaaga
Adobe Employee
Adobe Employee
February 9, 2023

Hi @anmolwassan -

The code you posted uses SOAP-based web services to add recipients to a list in Adobe Campaign.

Based on the response you received, it seems that the API call to the RegisterGroup function is successful and returns a 200 OK status code. However, when you check the Adobe Campaign console, the list is not updated with the recipient.

To troubleshoot the issue, I would recommend checking the following things:

  1. Verify that the values passed in entityList and choiceList are correct and correspond to the expected list and recipient.

  2. Check if any errors or exceptions are being thrown in the API call.

  3. Make sure that the API call is being made with the correct user credentials.

  4. Check if the updated list has any restrictions that might prevent the recipient from being added.

February 10, 2023

@akshaaga Thanks for your reply. The values in the entityList and choiceList are correct because I am able to query them from the Adobe Campaign console dashboard. I queried the lists via list id (primary key) and recipients via recipient id (primary key). I used both the ids in my code above.

No error is thrown either. It's 200 success response and the API call is made with correct user credentials. The list doesn't have any restrictions as I am able to add the recipient to that list via Adobe Campaign Console.

Is there any other method which I can use to add recipients to the list over API?

akshaaga
Adobe Employee
akshaagaAdobe EmployeeAccepted solution
Adobe Employee
February 10, 2023

Hi @anmolwassan ,

 

If the IDs are correct and you can query the lists and recipients via the API, the issue may be with the bRegister attribute.

The value of this attribute is set to true, which indicates that you want to add the recipient to the list. If you are still unable to add the recipient to the list, you can try using a different web service method to achieve this. For example, you can use the nms:subscriber web service method Subscribe to add a recipient to a list.

Here is an example of the XML request for the Subscribe method:

<?xml version='1.0' encoding='ISO-8859-1'?>
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='urn:xtk:subscriber'>
<soapenv:Header/>
<soapenv:Body>
<urn:Subscribe>
<urn:sessiontoken>___e3cf1125-82b4-49f4-9083-04bd1945c6d1</urn:sessiontoken>
<urn:subscriberId>873730</urn:subscriberId>
<urn:listId>5402862</urn:listId>
</urn:Subscribe>
</soapenv:Body>
</soapenv:Envelope>

 

In the above example, "subscriberId" is the ID of the recipient you want to add, and listId is the ID of the list to which you want to add the recipient.

Sukrity_Wadhwa
Community Manager
Community Manager
March 2, 2023

Hi @anmolwassan,

Were you able to resolve this query with the help of @akshaaga's suggestions or do you still need more help here? Do let us know. In case the given suggestions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!

Sukrity Wadhwa