The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Trying use my own listID when adding a new list

SOLVED
Go to solution
Highlighted
Occasional Contributor

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

Accepted Solutions
Highlighted
Honored Contributor

Re: Trying use my own listID when adding a new list

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
Highlighted
Honored Contributor

Re: Trying use my own listID when adding a new list

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

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured