how to update State code in constant contact..

satishsms
Regular 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
Anonymous
Not applicable

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.

satishsms
Regular Participant

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

 


 

Anonymous
Not applicable

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?

satishsms
Regular Participant

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