We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Proper way to create dynamic links in API

jhernandez1
Regular Participant

Proper way to create dynamic links in API

I saw this post but it also mentions that this may be enhanced in the future and the post is from several months ago, so I want to make sure that this is still the accepted way before I implement it. This seems like such a hack.


http://developer.constantcontact.com/node/814


My link is more than 50 characters (and I have two of them in my email)


<a href="http://www.nightingalenurses.net/RapidApp.aspx?email=


a href="http://www.nightingalenurses.net/FullApp.aspx?email=

 


 


So in order to pass the email address to my application in both of these links, I would have to create 5 extra fields for each subscriber? This seems like such a waste.


Also, I tried changing the EmailContentFormat to XHML but then I get an error.



<

12 REPLIES 12
bsoder
Employee

Hello,



I do apologize for the issue that you are having with inserting subscriber properties. At this current time the best way to implement dynamic links within custom XHTML emails is to follow the instructions in the link that you had posted.



Also, you should be able to have the EmailContentFormat XHTML. I noticed in your post you had put XHML, putting it at XHTML should work.



If you are still having any problems please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
jhernandez1
Regular Participant

This is really crazy to me, this means that my lists will take up 6 times the space (I was previously only uploading email) and probably take 6 times as long to upload.


Just as a suggestion, why not at least create organization variables (similiar to orginazation address) where I can put the links instead of uploading the exact same thing for each email address in my list and then having to update every user in the list if I want to change my link.

jhernandez1
Regular Participant

I just tried again to change the EmailContentFormat to XHTML that is the only thing I changed and my code to create a campaign was working and now I am getting bad request.

David_J
Employee

We do have fields for organization address and other common fields that you can use as part of your dynamic link. For example if you wanted to create the link http://www.example.com?email=yourmail@example.com, you could do the following:


Custom field 1:


<a href="http://www.example.com?email=


Custom Field 2: 


">Click Here</a>


and then place these on the same line in your XHTML email like this:


<Property name="Subscriber.CustomText1"/><Property name="Subscriber.Email"/><Property name="Subscriber.CustomText2"/>


For a full list of subscriber details that can be stored, please visit the following FAQ: What are subscriber details or properties?


Regarding your question about HTML vs XHTML emails, I really would need to see the XML that is failing for you in order to assist in this, or at least the error message that you are receiving. You certainly have the ability to create XHTML or HTML emails through the API. If you want to send the XML to our webservices support team I would be happy to take a look.

David J

jhernandez1
Regular Participant

What I am talking about is not a SUBSCRIBER variable but an ORGANIZATION variable. See by associating the URL with the SUBSCRIBER then you need to copy it for each SUBSCRIBER in my case about 200,000 times. If I could just set it on an ORGANIZATION level then I would just have to set it one time.

TrisBrown
Occasional Participant

How do I create an API to allow someone to access a list of registrants without logging into constant contact?


I have been told that this functionality is coming out this week and will have the ability to pass along a hideen user name and password to allow access as access currently requires a log in.


I would love to know how to code this into a webpage so that it is seamless to the end user so that they can have real time registrant access.  thx!

David_J
Employee

If you are referring to registrants of an event, our Event API has not been released yet, but is set to be deployed in the very near future. I will respond to this thread letting you know as soon as that is taken care of.


 


If you are referring to registrants meaning individuals signed up to a contact list, this functionality is already in place. You could perform an http get on Contacts (https://api.constantcontact.com/ws/customers/{user-name}/contacts) which will lists all of the contacts in your account. For more information please view Listing all Contacts. If you are looking to pull contacts out of a specific list, you would need to perform an http get against that list id and append /members to the end. For example (https://api.constantcontact.com/ws/customers/{user-name}/lists/1/members).


 


Again, I will post here as soon as our Event API is released. Please let me know if you have any others questions or concerns. Thanks.

David J

David_J
Employee

We have released our Event Management API documentation to the public. You can now access our documentation at http://developer.constantcontact.com/doc/manageEvents.


 


I hope that this helps. Please let me know if you have any questions or concerns regarding this. Thank you.

David J

TrisBrown
Occasional Participant

Hi David,


thx for the reply.  I am trying to use the following code from your link: https://api.constantcontact.com/ws/customers/{username}/events/{eventid}/registrants


When I put in my user name and event id, it is still asking me for a user name and password.  Since I want outside people to be able to view registrant information only without having to login and without knowing our login, how can I do this?  thx  If I could call you to discuss - I would appreciate it.

atran88
Regular Participant

Hello Tris,


I would be more than happy to discuss this issue with you further over the phone. Please contact me via email by clicking the following link webservices support team with the best contact number and hours to reach you at.

Andrew T

Support Engineer, Constant Contact

TrisBrown
Occasional Participant

The link that you provided does not work?

David_J
Employee

The link should be working now, sorry for any inconvenience that caused.

David J

Developer Portal

View API documentation, code samples, get your API key.

Visit Page