Generate Individual Link via API | XM Community
Skip to main content

Generate Individual Link via API

  • September 23, 2022
  • 7 replies
  • 974 views

Forum|alt.badge.img+9

Is there a way that we can generate survey link for a single contact? I know there's an API under Create Distribution but this will create links for all contacts in the mailinglist.
My use case is for Live Chat post-transaction, so I need to generate an individual link everytime customer completed their transaction with a live agent.

7 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • September 23, 2022

You can generate a link for a single contact by using contactId instead of mailingListId.


Forum|alt.badge.img+9
  • Author
  • QPN Level 1 ●
  • September 23, 2022

Hi TomG - will this work with create distribution but not send them out? Referring to this one.


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • September 23, 2022

Yes, just replace

"mailingListId": "CG_6F1gRt186CZOVoh"
with
"contactId":"contact id goes here"


Forum|alt.badge.img+9
  • Author
  • QPN Level 1 ●
  • September 23, 2022

Hi TomG - I tried to run it but I got the below error message. Am I missing something?
image.png


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • September 23, 2022

I guess you have to include both mailingListId AND contactId to get an invididual link.


Forum|alt.badge.img+9
  • Author
  • QPN Level 1 ●
  • September 23, 2022

Looks like the feature is not available at the moment.
image.png


Forum|alt.badge.img
  • April 12, 2024

Found this discussion and I believe it is worthy to share how to use the API properly. It took me a while to figure it out.

The contactID value you have to input actually is the contact Lookup ID (which refers to the contact in the mailing list) - you can retrieve that one using the GET contact in list or directory APIs.

 

The prefix for the contact Lookup ID value is CGC_xxxxxxxxxxxxxxxxx. So, the body should look like that: