Remove user from profile group in collaborators using API

Last updated Nov 11 2019

In this video we will show you how to remove user from profile group in collaborators using API.

Please find script below:

global with sharing class RemoveProfileUserDemo {
@InvocableMethod
globalstaticvoidremoveUser(List<GenerateDocActionRequest> rm_user_req){
if (!rm_user_req.isEmpty()) {
for (GenerateDocActionRequestrmu : rm_user_req) {
makeCall(rmu.ftApiKey,rmu.userId);
}
}
 
}
@future(callout=true)
publicstaticvoidmakeCall(stringftAPIKey,stringuserId){
HttpRequestreq = newHttpRequest();
req.setMethod('DELETE');
req.setHeader('ftAPIKey', ftAPIKey);
Httphttp = newHttp();
HTTPResponseres = http.send(req);
System.debug( 'ft res>>>> ' + res.getBody());
// return res;
}

 

globalclassGenerateDocActionRequest{
@InvocableVariable(required=true)
globalStringuserId;
@InvocableVariable(required=true)
globalStringftApiKey;

 

}
}

CommentsLogin Required
Didn’t find what you were looking for?
Try the following for assistance or Use the Search box.