I have created a SharePoint 2013 Workflow. This workflow first checks whether a user exists in a sharepoint group for example My_SP_GROUP or not by using HTTP GET request. If user does not exists then it adds that user in My_SP_GROUP using HTTP POST request.
The problem I am facing is that for POST request I am getting unauthorized error message, but for GET request it works fine.
{"odata.error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}
From SPO UI, I am able to add user in MY_SP_Group. I have followed this very nice article.