Table of Contents
In today's digital landscape, maintaining originality is crucial for educators and content creators. Integrating Copyleaks with Salesforce offers a seamless way to detect plagiarism and ensure content integrity. This guide walks you through the step-by-step process to set up Copyleaks within Salesforce effortlessly.
Prerequisites for Copyleaks and Salesforce Integration
- An active Salesforce account with administrative privileges.
- A Copyleaks API key. You can obtain this by registering on the Copyleaks website.
- Basic knowledge of Salesforce setup and configuration.
Step 1: Obtain Your Copyleaks API Key
Visit the Copyleaks website and sign up for an account if you haven't already. Once logged in, navigate to the API section in your dashboard. Here, you will find your unique API key, which is essential for connecting Copyleaks with Salesforce.
Step 2: Create a Connected App in Salesforce
To enable communication between Salesforce and Copyleaks, you need to create a connected app.
Steps to create a connected app
- Log in to your Salesforce account as an administrator.
- Navigate to Setup > Apps > App Manager.
- Click on "New Connected App".
- Enter a name for your app, such as "Copyleaks Integration".
- Enable OAuth Settings and specify a callback URL (you can use a placeholder like https://localhost).
- Select OAuth scopes such as "Full access" or "Access and manage your data".
- Save the app and note the Consumer Key and Consumer Secret displayed.
Step 3: Configure OAuth and Obtain Access Token
Using the Consumer Key and Secret, obtain an OAuth access token to authenticate API requests.
Generate Access Token
- Use a tool like Postman or a custom script to send a POST request to Salesforce's OAuth token endpoint:
- Endpoint:
https://login.salesforce.com/services/oauth2/token - Include parameters:
grant_type=password, your Salesforce username, password, Consumer Key, and Consumer Secret.
Upon successful authentication, you'll receive an access token. Store this securely for API interactions.
Step 4: Create a Custom Object for Plagiarism Checks
To manage plagiarism reports, create a custom object in Salesforce.
Steps to create the object
- Navigate to Setup > Object Manager > Create > Custom Object.
- Name it "Plagiarism Report" and define necessary fields like "Content ID", "Status", "Report Link", and "Similarity Score".
- Save the object and set appropriate permissions.
Step 5: Integrate Copyleaks API with Salesforce
Create an Apex class or use Salesforce Flow to send content to Copyleaks for analysis.
Sample Apex Code
Below is a simplified example of how to call the Copyleaks API from Salesforce:
public class CopyleaksIntegration {
public static void submitContent(String content, String reportId) {
HttpRequest req = new HttpRequest();
req.setEndpoint('https://api.copyleaks.com/v3/scans');
req.setMethod('POST');
req.setHeader('Content-Type', 'application/json');
req.setHeader('Authorization', 'Bearer YOUR_ACCESS_TOKEN');
String body = JSON.serialize(new Map<String, Object>{
'content' => content,
'properties' => new Map<String, String>{'reportId' => reportId}
});
req.setBody(body);
Http http = new Http();
HttpResponse res = http.send(req);
// Handle response and update Salesforce records accordingly
}
}
Step 6: Automate and Monitor Plagiarism Checks
Set up Salesforce workflows or Lightning flows to automate content submission and report retrieval. Regularly monitor the custom object records for updates on plagiarism status and scores.
Conclusion
Integrating Copyleaks with Salesforce enhances your ability to detect plagiarism efficiently. By following these steps, educators and content managers can automate content verification, ensuring originality and maintaining academic integrity.