Recently I approved friend request of a spammer by mistake ,after one hour I checked facebook again , i noticed that he posted spam all the groups where I am present. My question is is there any API to get friends groups and send join requests automatically , or am I hacked ?
Facebook API gives information about the public groups you are in. This method does it -
It returns the data in following format -
So, he can just use the API to get info about the groups you are in.
Although, it's not possible to send Join requests using the API.