Skip to content

Latest commit

 

History

History
288 lines (204 loc) · 11.2 KB

SubmissionApi.md

File metadata and controls

288 lines (204 loc) · 11.2 KB

TurnitinCoreApi.SubmissionApi

All URIs are relative to https://app-us.turnitin.com/api/v1

Method HTTP request Description
createSubmission POST /submissions Create a new Submission
deleteSubmission DELETE /submissions/{id} Deletes a submission and associated similarity report.
getSubmiddionDetails GET /submissions/{id} Get Submission Details
recoverSubmission PUT /submissions/{id}/recover Recover a soft deleted submission
uploadSubmittedFile PUT /submissions/{id}/original Upload Submitted File

createSubmission

SimpleSubmissionResponse createSubmission(xTurnitinIntegrationName, xTurnitinIntegrationVersion, data)

Create a new Submission

Example

import TurnitinCoreApi from 'turnitin_core_api';
let defaultClient = TurnitinCoreApi.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new TurnitinCoreApi.SubmissionApi();
let xTurnitinIntegrationName = myintegration; // String | a human readable string representing the type of integration being used
let xTurnitinIntegrationVersion = v1.0.2; // String | the version of the integration platform being used
let data = new TurnitinCoreApi.SubmissionBase(); // SubmissionBase | 
apiInstance.createSubmission(xTurnitinIntegrationName, xTurnitinIntegrationVersion, data, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
xTurnitinIntegrationName String a human readable string representing the type of integration being used
xTurnitinIntegrationVersion String the version of the integration platform being used
data SubmissionBase

Return type

SimpleSubmissionResponse

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteSubmission

SuccessMessage deleteSubmission(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id, opts)

Deletes a submission and associated similarity report.

Example

import TurnitinCoreApi from 'turnitin_core_api';
let defaultClient = TurnitinCoreApi.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new TurnitinCoreApi.SubmissionApi();
let xTurnitinIntegrationName = myintegration; // String | a human readable string representing the type of integration being used
let xTurnitinIntegrationVersion = v1.0.2; // String | the version of the integration platform being used
let id = "id_example"; // String | The Submission ID (returned upon a successful POST to /submissions) 
let opts = {
  'hard': "'false'" // String | Accepts true or false indicating either hard or soft delete. A soft delete removes the associated submission report/index and changes the saved submission state to DELETED. A hard deletion completely removes the submission information from Panda and TCA and removes the associated report/index, which can not be recovered. 
};
apiInstance.deleteSubmission(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
xTurnitinIntegrationName String a human readable string representing the type of integration being used
xTurnitinIntegrationVersion String the version of the integration platform being used
id String The Submission ID (returned upon a successful POST to /submissions)
hard String Accepts true or false indicating either hard or soft delete. A soft delete removes the associated submission report/index and changes the saved submission state to DELETED. A hard deletion completely removes the submission information from Panda and TCA and removes the associated report/index, which can not be recovered. [optional] [default to 'false']

Return type

SuccessMessage

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getSubmiddionDetails

Submission getSubmiddionDetails(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id)

Get Submission Details

Example

import TurnitinCoreApi from 'turnitin_core_api';
let defaultClient = TurnitinCoreApi.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new TurnitinCoreApi.SubmissionApi();
let xTurnitinIntegrationName = myintegration; // String | a human readable string representing the type of integration being used
let xTurnitinIntegrationVersion = v1.0.2; // String | the version of the integration platform being used
let id = "id_example"; // String | The Submission ID (returned upon a successful POST to /submissions) 
apiInstance.getSubmiddionDetails(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
xTurnitinIntegrationName String a human readable string representing the type of integration being used
xTurnitinIntegrationVersion String the version of the integration platform being used
id String The Submission ID (returned upon a successful POST to /submissions)

Return type

Submission

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

recoverSubmission

SimpleSubmissionResponse recoverSubmission(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id)

Recover a soft deleted submission

Example

import TurnitinCoreApi from 'turnitin_core_api';
let defaultClient = TurnitinCoreApi.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new TurnitinCoreApi.SubmissionApi();
let xTurnitinIntegrationName = myintegration; // String | a human readable string representing the type of integration being used
let xTurnitinIntegrationVersion = v1.0.2; // String | the version of the integration platform being used
let id = "id_example"; // String | The Submission ID (returned upon a successful POST to /submissions) 
apiInstance.recoverSubmission(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
xTurnitinIntegrationName String a human readable string representing the type of integration being used
xTurnitinIntegrationVersion String the version of the integration platform being used
id String The Submission ID (returned upon a successful POST to /submissions)

Return type

SimpleSubmissionResponse

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

uploadSubmittedFile

SuccessMessage uploadSubmittedFile(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id, contentType, contentDisposition, file)

Upload Submitted File

Example

import TurnitinCoreApi from 'turnitin_core_api';
let defaultClient = TurnitinCoreApi.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new TurnitinCoreApi.SubmissionApi();
let xTurnitinIntegrationName = myintegration; // String | a human readable string representing the type of integration being used
let xTurnitinIntegrationVersion = v1.0.2; // String | the version of the integration platform being used
let id = "id_example"; // String | The Submission ID (returned upon a successful POST to /submissions) 
let contentType = "contentType_example"; // String | *Must be 'binary/octet-stream' 
let contentDisposition = inline; filename="MyFile.docx"; // String | *must include the \"filename\" parameter, e.g. `inline; filename=\"MyFile.docx\"`. To support UTF-8 filenames, you must URL encode the header 
let file = {key: null}; // Object | the user's submitted file
apiInstance.uploadSubmittedFile(xTurnitinIntegrationName, xTurnitinIntegrationVersion, id, contentType, contentDisposition, file, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
xTurnitinIntegrationName String a human readable string representing the type of integration being used
xTurnitinIntegrationVersion String the version of the integration platform being used
id String The Submission ID (returned upon a successful POST to /submissions)
contentType String *Must be 'binary/octet-stream'
contentDisposition String *must include the "filename" parameter, e.g. `inline; filename="MyFile.docx"`. To support UTF-8 filenames, you must URL encode the header
file Object the user's submitted file

Return type

SuccessMessage

Authorization

api_key

HTTP request headers

  • Content-Type: binary/octet-stream
  • Accept: application/json