I have been in contact with Google about this, they have not been helpful. For your reference see the exchange below. I'm not a programmer, so I wasn't able to follow the instructions he gave (I can't get powershell to authenticate with google's API without using GAM). Maybe someone with more experience can try what he suggests:
Case: #03459140
Subject: Error 400: Bad Request - badRequest
When using GAM to manage members of a group, if I attempt to delete a
non-google mail email address I get the above error (Error 400: Bad
Request - badRequest).
The same issue is reported here
https://groups.google.com/forum/#!topic/google-apps-manager/XNQnsurAUk4
And at stackoverflow here
stackoverflow.com/questions/18492861/directory-api-delete-member-api-operation-fails-for-non-google-accounts---------------------------------
Hello Mike,
Thanks for your message.
As you are reporting that this issue is still persisting for you, I went
and tried it myself. I was not able to reproduce your results. Here are
the steps which I took:
1. Created a group called
groupa...@testdomain.com and added my own admin account and a personal Gmail account.
2. Authenticated with OAuth Playground 2.0 using API Console project with Admin SDK.
3. Used the scope -
https://www.googleapis.com/auth/admin.directory.group - associated with Admin SDK > Directory API.
4. Exchanged for token. HTTP 1/1 200 Successful.
5. GET
https://www.googleapis.com/admin/directory/v1/groups/groupa...@testdomain.com/members/x...@gmail.com
6. HTTP 1/1 200 Successful.
7. DELETE
https://www.googleapis.com/admin/directory/v1/groups/groupa...@testdomain.com/members/x...@gmail.com
8. HTTP 1/1 204 No content.
One thing which I noticed from your last message is that your request is suffixed by the following: ''?quotaUser=
fc608ed99d7b5c79b3cf35ec87ea8c36b2451995&prettyPrint=true''
, For reference, I believe that your request should look like this:
DELETE /admin/directory/v1/groups/
testgro...@cictr.com/members/x...@mail.com HTTP/1.1.
In conclusion, the Directory API is functioning correctly and is able to
remove non Google Apps email addresses from groups. You can confirm
this for your self by following the steps which I outlined above. It
seems that these extra line is being added by the GAM tool. In this
instance in order to receive support on the GAM tool, I recommend
getting in touch with GAM's developers directly through their product
forum available to you here:
http://goo.gl/LocpH.
I hope that you found the above information useful. Please do not
hesitate to contact the Enterprise Support team in the future should you
need to do so. Thanks for using Google Apps.
Have a great day.
Sincerely,
John
Google Enterprise Support
-------------------------
Hi John,
It appears from what you sent me that
you tried this using a personal Gmail account, not a non-gmail account. I
have no problems removing any email that is hosted at gmail, either on a
google business domain or a personal @
gmail.com account. What I can't do is remove a user who is on a different email system (ie, not hosted at google).
When I try to remove an account at
mail.com (not Gmail.com, just Mail.com) I get the bad request error.
--------------------------
Hi Mike,
Thanks for the update.
I have now tested this using an external address and can confirm that I
was able to replicate the behaviour as you have reported. I have gotten
in touch with the relevant team and will get back to you
on Monday with their response
Thank you for your continued patience and understanding.
Have a great weekend.
Sincerely,
John,
Google Enterprise Support.
-----------------------------
Hello Mike,
My apologies but it seems that my last message was sent a little too hastily.
I followed the steps which I provided you with recently once more, this time using a @
hotmail.com
account, and I was able to successfully remove the hotmail address from
my test group. Please try and duplicate this behaviour using the steps I
provided and an API project at
https://code.google.com/apis/console/