Openmeetings use of country, state and country codes

I’ve been developing using openmeetings SOAP API for a little bit (on which I hope to post soon) and I spent a bit of time getting REALLY confused on where the user’s Country field comes from, what “states_id” is for the addNewUser service, what sort of input it expects, and where it’s stored.

Here it is:

States_id, from the SOAP API, defines the country and stores it in the table address. (I suppose that makes sense.) You can find it under the column state_id. This is how the user’s “Country” is defined in the user management gui (see below)

But here’s where it gets weird. You may have figured out that states_id expects a numerical input; however, this is NOT the standard E.164 three-digit country code that all of us can easily Google for. Instead, the code is an index number corresponding to the country’s alphabetically organized row number in the Openmeetings table: state. I think this is most likely a mistake, as the database contains all the Country Codes right there next to the id field, for seemingly, no reason at all.

So what to do?

For the time being, it’s pretty simple to get this working with this piece of information. Simply enter the corresponding id number from the openmeetings table for states_id. I’ve included the relevant columns below for reference: