Login
Login to the Copyleaks API using your email and API key.
Once logged in, you will get back a login token that will be used to authenticate yourself when calling the other API methods.
After generating the login-token, you should attach the token for your next calls. Attaching the endpoint is done by adding this header to your calls:
Authorization: Bearer TOKEN
A generated token is valid for 48 hours. Within this period of time, you can use it multiple times. Before attaching the Authorization
header for your next endpoint calls, make sure that the token has not expired. If it expired, generate a new one.
Request
Section titled “Request”Headers
Section titled “Headers”Content-Type: application/jsonAccept: application/json
Your Copyleaks account email address
Your Copyleaks account API key (UUID format)
Responses
Section titled “Responses”Success
Section titled “Success”The command was executed successfully.
Response Schema
The response contains the following fields:
Example Response
A typical response from this endpoint:
{ "access_token": "ACLNSKNSDAACCAJANCOIUiausoo_saidjaskldjoa...", ".issued": "2018-11-24T16:15:38.2431255+02:00", ".expires": "2018-11-26T16:15:38.2431255+02:00"}
Bad Request - Invalid request format or missing required fields
Example Response
A typical response from this endpoint:
{ "Key": [ "The key field is required." ]}
Unauthorized - Invalid email or API key
Example Response
A typical response from this endpoint:
{ "message": "Invalid login credentials."}
Too Many Requests - Rate limit exceeded (blocked for 5 minutes)
Example Response
A typical response from this endpoint:
{ "error": "Rate limit exceeded",}
Examples
Section titled “Examples”POST https://id.copyleaks.com/v3/account/login/api
HeadersContent-Type: application/json
Body{ "key": "00000000-0000-0000-0000-000000000000"}
export COPYLEAKS_API_KEY="your-api-key-here"
curl --request POST \ --url https://id.copyleaks.com/v3/account/login/api \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data "{ \"email\": \"${COPYLEAKS_EMAIL}\", \"key\": \"${COPYLEAKS_API_KEY}\" }"
from copyleaks.copyleaks import Copyleaks
API_KEY = "your-api-key-here"
# Login to Copyleaksauth_token = Copyleaks.login(EMAIL_ADDRESS, API_KEY)print("Logged successfully!\nToken:", auth_token)
const { Copyleaks } = require('plagiarism-checker');
const API_KEY = "your-api-key-here";
async function login() { const copyleaks = new Copyleaks(); const loginResult = await copyleaks.loginAsync(EMAIL_ADDRESS, API_KEY); console.log('Logged successfully!\nToken:', loginResult); return loginResult;}
import com.copyleaks.sdk.api.Copyleaks;
String API_KEY = "00000000-0000-0000-0000-000000000000";
// Login to Copyleakstry { String authToken = Copyleaks.login(EMAIL_ADDRESS, API_KEY); System.out.println("Logged successfully!\nToken: " + authToken);} catch (CommandException e) { System.out.println("Failed to login: " + e.getMessage()); System.exit(1);}