I've created a mailing list and uploaded contacts to it using the API. However, I haven't been able to figure out how to share it with a specific Group using the API. This is possible through the UI either by using "Create Shared List" or by dragging an existing list into the Group folder.
If you have a Group folder, you should be able to reference that folder at the time of the list creation, per this link here: https://api.qualtrics.com/v3/reference/create-mailing-lists
I think there is a bit of disconnect between the word "folder" and "library" in the API and in the browser UI. A support rep should confirm, but I believe a Group folder in the browser UI is actually a Group Library ID in the API. And the folder name in the browser UI is the Category in the API.
This shows you where to find the library ids, including your group libraries.
https://api.qualtrics.com/docs/finding-your-qualtrics-ids#library-id
Well, I actually kept researching and it looks like "category" is not the same as "folder" since when you use the API to list Mailing lists, they show up separately.
For example:
"libraryId": "UR_1234567890AbCd2",
"id": "ML_1234567890AbCd2",
"name": "Empire Manifest",
"category": null,
"folder": "Sample Folder"
However, the link that I provided doesn't designate "folder" as a parameter during Mailing List creation. It may be worth trying to set the "folder" parameter during the ML creation anyway.
I'm using v3...I've successfully created a list, uploaded contacts to it, removed opt-outs, and created samples. So all I have left to figure out is how to share that list with the relevant group.
All I did was change this:
```python
data = {
"name": mailing_list_name
}
```
to this:
```python
data = {
"libraryId": my_library_id,
"name": mailing_list_name
}
```
Am I missing anything obvious?
I tried it here: https://api.qualtrics.com/v3/reference/create-mailing-lists and it worked for me. I created a test group and test group library, and it was successful. Also, I created a category label and created a folder.!