Trying use my own listID when adding a new list

SOLVED
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 Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured