How to prevent twitter api creating lists with same name only numbered

lists

#1

I have noticed that when the API creates a new list with a name then if the name exist the new list has the name with a number added to the end. To delete the list you must know the number which you cannot easily see. Is there anyway to either delete all lists with a name (ie list1 list2 …) or not add the list if another list having the same name already exists.

Cheers

Dave


#2

You can use https://dev.twitter.com/rest/reference/get/lists/ownerships to get all lists (names, ids, descriptions etc) And use that to check if a list already exists - or find lists that need deleting.

But you’re better off relying on list IDs rather than names though: https://dev.twitter.com/rest/reference/post/lists/create after creating a list you get a list object back that has an ID you can store someplace.


#3

Yes, I thought maybe that would be the work around, its a shame there is no option to prevent duplicates

Cheers

Dave