Survey Trigger | XM Community
Skip to main content
https://api.qualtrics.com/reference#distribution-create-1

Can anyone tell me about this contactId "CGC_b8aEgSddm6YcVCd" in the example.

Where I can find the contact Id than inspecting html element?

I see contact Id with pattern CID_<id> in the html and not starting with CGC so I am thinking that its something different than I think of.



Thanks

Jophy
I see that exporting contact get the ID but it starts with CID and not CGC as indicated in the API
I get error {"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Invalid request. Missing or invalid parameter RecipientID.","errorCode":"DEC_8"}, when using contactId and the mailing list Id
Finally got the API to get the CGC ID

https://servicenowcx.az1.qualtrics.com/API/v3/directories/<<Directory_ID>>/mailinglists/<<mailing_list>>/contacts/<<CID>

I got the same error as jophyjohn above: {"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Invalid request. Missing or invalid parameter RecipientID.","errorCode":"DEC_8"}
The issue for me was that my contact id was not in the mailing/contact list. Once I changed the contact id to one that was in the mailing list, it sent as expected.


I was also struggling on this for a while because above "Accepeted Answer" is incorrect.
The ID starting with CID_ is the "contactId", while the ID starting with CGC_ is the "contactLookupId". The contactLookupId will be generated, when you add a contact to a MailingList.
The tricky part is the fact, that when you list all contacts in a MailingList via API
https://api.qualtrics.com/api-reference/b3A6NjEwMTA-list-contacts-in-mailing-list
then you will only get the CID_ for each contact in that result list, but not the CGC_ info.
To get that one you are forces to use the API getting the details of a single(!) contact in the MailingList (by adding the CID_ at the end of the API-URL):
https://api.qualtrics.com/api-reference/b3A6NjEwMTQ-get-contact-in-mailing-list
That info includes the CGC_ id for the contact as well.
Get contactLookupId.ps1.txt
Attached is a sample Powershell code that shows the exact steps in detail.


Hi Carsten ,
I've learnt that a CGC_ id is associated to a multiple takes URL. I've come to realise that my distribution through the automation part of the XM directory only allows individual links and not multiple completes. It's only possible to select this link type when doing a manual email distribution it seems. I've compared the different URLs. (i've removed the live codes/references)
individ link:
https://xxxx.eu.qualtrics.com/jfe/form/SV_xxxxxxxx?Q_DL=aaaa_bbbb_CTR_cccc_CHL=email

multiple completes link:
https://warnerhotels.eu.qualtrics.com/jfe/form/SV_xxxxxxxx?RID=CGC_dddd&Q_CHL=email

From your discussion above about acquiring the CGC_ id. Does that mean it's possible to recall the CGC so that you either

1) change the survey link before the initial distribution (but after the contacts have been imported) or
2) upon first response, grab the CGC id so that the responder can then forward the survey onto another person so that they can take the survey using their existing attributes that got imported at the time the contact was imported into the mailing list (which are transaction fields by the way, not embedded fields)?

Can you powershell code work from within the Qualtrics realm / a webservice or codetask for instance?

Perhaps I'm over thinking what I'm trying to do so any help on this would be grateful as I need to allow a responder to forward the survey onto another person BUT with it being a fresh survey AND keeping their attributes / copying the attributes over.

Thanks

Rod Pestell


Leave a Reply