{ errors:
[ { domain: 'global',
reason: 'required',
message: 'Missing required field: member' } ],
code: 400,
message: 'Missing required field: member' }
I get this error when I run the following:
var request = client.admin.members.insert({
groupKey: "[email protected]"
, email: "[email protected]"
});
I was authenticated successfully (I received the access token and so on) but when I execute the request above it callbacks that error.
What member field am I supposed to add?
It works fine in API Explorer using groupKey and email fields.
email is part of the form data. The form data must be passed as object in the second argument:
// create the group insert request
var request = client.admin.members.insert({
groupKey: "[email protected]"
}, {
email: "[email protected]"
});
@rakyll Can you confirm this?
Yes, the latter snippet looks correct. Anything goes into the body on the API Explorer should be on the second argument.
Thanks! :smiley:
Anything goes into the body on the API Explorer should be on the second argument.
This needs to be documented better.
I struggled with the same issue. Had to do this to get it working
client.members.insert({
auth: jwtClient,
groupKey: '[email protected]',
resource: {
email: '[email protected]'
}
}, function(err, res) { });
Seems like the syntax changed since the thread above?
Update, use like this now*
const response = await directory.groups.insert(
{
auth: jwtClient,
resource: {
name: "Foo Foo",
email: '[email protected]'
}
}
);
Most helpful comment
I struggled with the same issue. Had to do this to get it working
Seems like the syntax changed since the thread above?