The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

how to update State code in constant contact..

Highlighted
Participant

how to update State code in constant contact..

Update process not taking place...


while i use <StateCode><StateCode> tag in XML , Update process is not taking place, Can anyone tell me the exact tag for state code..


 


Note : If i remove state code update is taking place.. pleae help me...here is  my XML code.


 


$entry = '<entry xmlns="http://www.w3.org/2005/Atom">

  <id>http://api.constantcontact.com/ws/customers/'.$UN.'/contacts/'.$SubID.'</id>

  <title type="text">Contact: '.$txt_email.'</title>

  <updated>'.$update_date.'</updated>

  <author><name>CU</name></author>

  <content type="application/vnd.ctct+xml">

  <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/'.$UN.'/contacts/'.$SubID.'">

      <EmailAddress>'.$txt_email.'</EmailAddress>

      <FirstName>'.$fname.'</FirstName>

      <LastName>'.$lname.'</LastName>

      <HomePhone>'.$ldaytimephone.'</HomePhone>

      <Addr1>'.$street_name.'</Addr1>

      <City>'.$city.'</City>

      <StateCode>'.$state.'</StateCode>

      <PostalCode>'.$zip.'</PostalCode>

      <CustomField4>'.$dob.'</CustomField4>

      <OptInSource>ACTION_BY_CUSTOMER</OptInSource>

      <ContactLists>

        <ContactList id="http://api.constantcontact.com/ws/customers/'.$UN.'/lists/'.$cc_listid.'">

        </ContactList>

      </ContactLists>

    </Contact>

  </content>

</entry>';


 


 


thanks,


satish


 

4 REPLIES 4
Highlighted
Anonymous
Not applicable

I think you may want to try

I think you may want to try specifying <CountryCode> as well that matches your state code.  For example, if your state code is ma, then you want to specify us as your CountryCode.  You also want to make sure that the state code you are passing is correct as well.  Incorrect state/country codes or non-matching state and country codes (such as using a Unisted States state code with Canada as your country) will result in an error as well.

Highlighted
Participant

Can you Please check this ????

hi,


sir can you check is it correct ????....


      <StateCode>NY</StateCode>

      <CountryCode>US</CountryCode>


 


if so, then also am not getting updated sir, please help me..


thanks,


satish

 


 

Highlighted
Anonymous
Not applicable

Hi, Our contacts

Hi,


Our contacts API documentation describes what the requirements are for state and country codes.  At the bottom of the page, there is a section that describes each XML element, and links to documents that list valid state and country codes.


Could you please try using lower cases for country code and see if it works?

Highlighted
Participant

Cool Thanks.....

Hi,


 


Thanks for your kind reply...Since i got it from also using <statename> tag along with <statecode> so it was pretty easy to retrive.. though i tired country code it was an added advantage but it's not a must tag to be used..


 


thanks


satish

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured