Notes
public with sharing class RestGo {
public static Void DeleteUser(){
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://gorest.co.in/public/v2/users/9336?access-token=3b54f23b326ea971563fab3d2873fdec0909ecb83cddc7091189283e25676b01');
request.setMethod('DELETE');
HttpResponse response = http.send(request);
if(response.getStatusCode() != 204) {
System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus());
} else {
System.debug(response.getBody());
}
}
}
Delete User by Id:
public with sharing class RestGo {
public static Void DeleteUserbyId(String userId){
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://gorest.co.in/public/v2/users/'+userId+'?access-token=3b54f23b326ea971563fab3d2873fdec0909ecb83cddc7091189283e25676b01');
request.setMethod('DELETE');
HttpResponse response = http.send(request);
if(response.getStatusCode() != 201) {
System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus());
} else {
System.debug(response.getBody());
}
}
Video
Video does not exists.