How to Share a Mailing List with the API? | XM Community
Solved

How to Share a Mailing List with the API?

  • 3 January 2019
  • 8 replies
  • 36 views

Badge
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.

Is there also a way to do it with the API?
icon

Best answer by rsuter 3 January 2019, 22:19

View original

8 replies

Badge +5
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
Badge
The Library ID was exactly what I needed -- thank you! Better naming consistency between the UI and the API would have been helpful here 😃
Badge +5
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.
Badge
Yeah so actually the Library ID thing is not working as expected 😞 I'm getting an error: "Unexpected json key provided: libraryId"

I think the Library ID is definitely what I need...just need to figure out how to actually use it 🙂
Badge +5
Do you know what version of the API are you using?
Badge
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?
Badge +5
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.!
Badge
Mystery solved 😎

I had been using this one, which doesn't accept libraryId. Didn't realize that was slightly different from the link you shared!

Thanks so much for looking into this.

Leave a Reply