cancel
Showing results for 
Search instead for 
Did you mean: 

Set the state/province for non-US

Occasional Participant

Set the state/province for non-US

Hi,

Could somebody tell me how I can set the state name when the contact has an address outside the US?

state_code is mentioned here.

Is this what sub_postal_code is for?

Thanks

Tags (4)
10 REPLIES 10
Moderator

Re: Set the state/province for non-US

At this point, we don't support international states for the Contact object.  I will look into what it would take to support that and give an update once we have more information.

Dave Berard
Senior Product Manager, Constant Contact
Established Member

Re: Set the state/province for non-US

Could we possibly set state_name directly?

Moderator

Re: Set the state/province for non-US

We opened a defect on our side to add the state_name field to the API.  We will take a look at getting that out as soon as we can and updating the documentation to reflect this.  As of now, we don't support that field so it's not possible to send it in.  Will update once we have a timeline on adding that.

Dave Berard
Senior Product Manager, Constant Contact
Occasional Contributor

Re: Set the state/province for non-US

Any progress on this?

 

Moderator

Re: Set the state/province for non-US

This field was added to the API in our Dec. release. You can see the details in our release notes here: http://techblog.constantcontact.com/api/release-updates/api-release-notes-december-2013/

 

Also, this is documented on our Contact documentation here: http://developer.constantcontact.com/docs/contacts-api/contacts-resource.html

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

Re: Set the state/province for non-US

This doesn't appear to be reflected in your SDK (for C#) - is there a timeline for when this will be added?

Moderator

Re: Set the state/province for non-US

We'll add it to our list of things to add to the SDK, no timeline available today for when that will be.  We do try to update them regularly, hopefully you'd see something in the next 2-6 weeks.  Alternatively, you can add this to the SDK directly and feel free to submit a pull request to contribute those changes to the community as a whole.

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

Re: Set the state/province for non-US

I don't know how to do that I'm afraid.

 

To add support for this field, simply add the following few lines to the Address class (Address.cs) - I called the property StateName:

 

/// <summary>
/// Gets or sets the state name.
/// </summary>
[DataMember(Name = "state", EmitDefaultValue = false)]
public string StateName { get; set; }

 

I've tested this and it appears to work well.

 

Thanks,

 

Shane

Occasional Participant

Re: Set the state/province for non-US

I've now submitted a pull request - hope I've done it right!