cancel
Showing results for 
Search instead for 
Did you mean: 
Some customers are unable to login to their accounts. We are aware of this issue and working to resolve it as quickly as possible. Thank you for your patience.

add_contact API not working... state and country function error

Highlighted
Occasional Contributor

add_contact API not working... state and country function error

HI,

 

My add_contact.php api from CC works fine except the state and country function

below is the error message;

 Notice: Undefined index: state in C:\wamp\www\add_contact.php on line 251

 

 Notice: Undefined index: country in C:\wamp\www\add_contact.php on line 294

3 REPLIES 3
CTCT Employee

Re: add_contact API not working... state and country function error

Hi Ron,

 

Could you tell us what values you are trying to pass in for the state and country values?  If you could copy and paste the XML you are trying to pass in below (redacting or removing your username/password information), that would be most helpful.

 

Thanks,

Shannon W.

Support Engineer, Constant Contact

All Star

Re: add_contact API not working... state and country function error

Was there a solution to this? What are the correct field name to use?

Moderator

Re: add_contact API not working... state and country function error

Hi Oscar,

 

While we did not hear back from this specific person, there are no known problems with submitting this data. Here is an example of submitting address data with the correct fields.

 

"addresses": [
            {
                "id":"1",
                "line1": "541 Brighton Ave.",
                "line2": "Unit 785",
                "line3": "",
                "city": "Cambridge",
                "address_type": "PERSONAL",
                "state":"Massachusetts",
                "state_code": "MA",
                "country_code": "us",
                "postal_code": "01555",
                "sub_postal_code": ""
            }]

Regards,
Jimmy D.
Tier II API Support Engineer