Trying use my own listID when adding a new list

SOLVED
Go to solution
Regular Participant

Trying use my own listID when adding a new list

I'm using the code below to add a new list to my account using the Java API.  It appears the api ignores my listID and makes it's own unique ID.

 

Is there anyway to overide this functionality?

 

_contactListService = _factory.createContactListService();
ContactList newList = new ContactList();

newList.setId("9998" );
newList.setName("ListName");
newList.setStatus("ACTIVE");
_contactListService.addList( newList );

1 ACCEPTED SOLUTION
Member

Hello,

 

Unfortunately it is not possible to create your own list ID. Our system will always assign a unique ID automatically to any new lists.

 

One easy way to get the ID which is assigned to the newly created list, would be to do the following:

_contactListService = _factory.createContactListService();
ContactList newList = new ContactList();
String listID;

newList.setId("9998" );
newList.setName("ListName");
newList.setStatus("ACTIVE");
newList = _contactListService.addList( newList );
listID = newList.getId();

Hopefully this help!

 

Sincerely,

Elijah G.
API Support Engineer

View solution in original post

1 REPLY 1
Member

Hello,

 

Unfortunately it is not possible to create your own list ID. Our system will always assign a unique ID automatically to any new lists.

 

One easy way to get the ID which is assigned to the newly created list, would be to do the following:

_contactListService = _factory.createContactListService();
ContactList newList = new ContactList();
String listID;

newList.setId("9998" );
newList.setName("ListName");
newList.setStatus("ACTIVE");
newList = _contactListService.addList( newList );
listID = newList.getId();

Hopefully this help!

 

Sincerely,

Elijah G.
API Support Engineer

View solution in original post

Developer Portal

View API documentation, code samples, get your API key.

Visit Page