Sending files for processing

To process file, send a POST request to the https://api.groupdocs.cloud/v2.0/rewriter/{task}/document GroupDocs.Rewriter Cloud REST API endpoint, where task means what you want to do: detect, paraphrase, simpllify or summarize. To authorize the request, pass the access token in Authorization header (Bearer authentication).

The link to file and processing parameters are provided in JSON format in the request body.

{
  "language": string,
  "url": string,
  "minLength": int,
  "format": string
}
PropertyDescription
languageLanguage code of the source file.
urlLink to file.
minLengthMinimal length of files textual content to apply paraphrasing detection.
formatFile format.
{
  "language": string,
  "url": string,
  "savingMode": string,
  "outputFormat": string,
  "diversityDegree": string,
  "format": string
}
PropertyDescription
languageLanguage code of the source file.
urlLink to file.
savingModeHow the result shoud be saved, as file, as archive or both.
outputFormatFormat of the paraphrased file.
diversityDegreeDegree of paraphrasing, accepted values Off, Medium and High.
formatFile format.
{
  "language": string,
  "url": string,
  "savingMode": string,
  "outputFormat": string,
  "format": string
}
PropertyDescription
languageLanguage code of the source file.
urlLink to file.
savingModeHow the result shoud be saved, as file, as archive or both.
outputFormatFormat of the simplified file.
formatFile format.
{
  "language": string,
  "url": string,
  "savingMode": string,
  "outputFormat": string,
  "summarization": string,
  "format": string,
  "minLength": int
}
PropertyDescription
languageLanguage code of the source file.
urlLink to file.
savingModeHow the result shoud be saved, as file, as archive or both.
outputFormatFormat of the paraphrased file.
summarizationDegreeSummarization degree, accepted values Off, Medium and High.
formatFile format.
minLengthMinimal length of files textual content to apply summarization.
Note
If the processed file is very long, you may encounter an error when calling via cURL in a shell command. Use the getconf ARG_MAX command to check the maximum length of the command arguments (in bytes).

Evaluation mode

To use GroupDocs.Rewriter Cloud REST API in evaluation mode, send a POST request to the endpoint https://api.groupdocs.cloud/v2.0/rewriter/{task}/document/trial.

This endpoint does not use the Authorization header, so there is no need to generate an access token. All other parameters remain the same as in regular text requests.

Return value

If successful, this method returns JSON with a unique identifier (value of the id property) of the request in the queue:

{
    "status": 202,
    "message": "Starting",
    "id": "dae5390e-3658-4bff-85bf-4a77cc04eaa5_text"
}

Otherwise, it returns a HTTP status code corresponding to the error.

What’s next

Processing will take a few seconds, depending on the size of the text and the current GroupDocs.Rewriter Cloud load. See the article Fetching results for information on how to get results from the server.

cURL example for paraphrasing

curl --request POST --location 'https://api.groupdocs.cloud/v2.0/rewriter/paraphrase/document' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...LxLejtsVFwrZpHA' \
--data '{
  "language": "en",
  "url": "https://rewriter-groupdocs-app.s3.us-west-2.amazonaws.com/0cd7b09d-4d63-4bcd-a9a5-dfd72897aa17.pdf...ff474526313a24821e98",
  "savingMode": "Files",
  "outputFormat": "Pdf",
  "diversityDegree": "Off",
  "format": "Pdf"
}'
curl --request POST --location 'https://api.groupdocs.cloud/v2.0/rewriter/paraphrase/document/trial' \
--header 'Content-Type: application/json' \
--data '{
  "language": "en",
  "url": "https://rewriter-groupdocs-app.s3.us-west-2.amazonaws.com/0cd7b09d-4d63-4bcd-a9a5-dfd72897aa17.pdf...ff474526313a24821e98",
  "savingMode": "Files",
  "outputFormat": "Pdf",
  "diversityDegree": "Off",
  "format": "Pdf"
}'
{
    "status": 202,
    "message": "Starting",
    "id": "dae5390e-3658-4bff-85bf-4a77cc04eaa5"
}