-
-
Save TheShubhamVsnv/02668dd1a889e7824800f6bf515450fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DELETE: Remove data or resources from Salesforce. | |
@future (callout=true) | |
public static void deleteContacts () { | |
// Creating a new HTTP request | |
HttpRequest req = new HttpRequest(); | |
// Setting the endpoint for the HTTP request | |
// SourceOrgNamedCredential is your SourceORG Named Credential | |
// 003F900001gMifVIAS is the Id of targetORG contact which we are updating | |
req.setEndpoint('callout:SourceOrgNamedCredential/services/apexrest/Contact/003F900001gMifVIAS'); | |
// Setting headers for the HTTP request | |
req.setHeader('content-type','application/json; charset=UTF-8'); | |
req.setHeader('Accept','application/json'); | |
// Setting the HTTP method to DELETE | |
req.setMethod('DELETE'); | |
// Creating a new HTTP object | |
Http http = new Http(); | |
// Sending the HTTP request | |
HttpResponse response = http.send(req); | |
// Debugging the response | |
System.debug('response code : ' + response.getStatusCode()); | |
System.debug('response Body: ' + response.getBody()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment