Setting OG with Services module I am trying to POST a node to my site and make it group member. 

POST body looks like this:

{
   "title":"Update",
   "type":"mesurement",
   "uid":"4",
    "og_group_ref": {
        "und": [{
            "target_id": "20"
        }]
    },
    "field_records": {
        "und": [{
            "value": "22"
        }, {
            "value": "25"
        }, {
            "value": "65"
        }, {
            "value": "12"
        }]
    }
}


Yet every time I get an error saying:

{
    "form_errors": {
        "og": "You must select one or more groups for this content."
    }
}


Edit:

Field settings are:

Default widget type: Select list

Administrator widget type: Autocomplete

Number of values: 1

Mode: Organic groups
I was having the same troubles. Seems to me as far as my limited debugging skills go, that when drupal_process_form calls 

$form = form_builder($form_id, $form, $form_state);


the values for $form_state[‘input’][‘og_group_ref’] don’t get passed through into $form. So I suspect I need to understand form_builder better to figure out why the values coming in aren’t getting transferred through. Ultimately when we get to og_form_group_reference_validate, $form_state['values’][‘og_group_ref’] doesn’t exist.

So, what I’m going to try for now (and seems to be working) is let og_form_group_reference_validate look in $form_state[‘input’] in addition to $form_state[‘values’], as og_group_ref still exists there.

Here’s a gist of my patch:

https://gist.github.com/housser/ba03c50f670dc5310520