Sending texts for processing
To process plain text, send a POST request to the https://api.groupdocs.cloud/v2.0/rewriter/{task}/text
GroupDocs.Rewriter Cloud REST API endpoint, where task means what you want to do: detect, paraphrase, simpllify, summarize or synonymize.. To authorize the request, pass the access token in Authorization header (Bearer authentication).
The text and processing parameters are provided in JSON format in the request body.
{
"language": string,
"text": string,
"texts": list of strings
}
Property | Description |
---|---|
language | Language code of the source text. |
text | Text to be detected for paraphrasing. |
texts | Texts to be detected for paraphrasing. |
{
"language": string,
"text": string,
"texts": list of string,
"suggestions": string,
"diversityDegree": string
}
Property | Description |
---|---|
language | Language code of the source text. |
text | Text for paraphrasing. |
texts | Texts for paraphrasing. |
suggestions | Number of variants to return, accepted values One, Two or Three. |
diversityDegree | Degree of paraphrasing, accepted values Off, Medium and High. |
{
"language": string,
"text": string,
"texts": list of strings
}
Property | Description |
---|---|
language | Language code of the source text. |
text | Text for simplification. |
texts | Texts for simplification. |
{
"language": string,
"text": string,
"texts": list of strings
"summarizationDegree": string
}
Property | Description |
---|---|
language | Language code of the source text. |
text | Text to be detected for summarization. |
texts | Texts to be detected for summarization. |
summarizationDegree | Summarization degree, accepted values Off, Medium and High. |
{
"language": string,
"text": string,
"texts": list of strings
"synonyms": string
}
Property | Description |
---|---|
language | Language code of the source text. |
text | Text to be detected for paraphrasing |
texts | Texts to be detected for paraphrasing. |
synonyms | Number of synonyms to return, accepted values One to Five and All. |
NoteIf the processed text is very long, you may encounter an error when calling via cURL in a shell command. Use thegetconf ARG_MAX
command to check the maximum length of the command arguments (in bytes).
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}/text/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 translation requests.
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.
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 --request POST --location 'https://api.groupdocs.cloud/v2.0/rewriter/paraphrase/text' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...LxLejtsVFwrZpHA' \
--data '{
"language": "en",
"text": "Hello, everyone! We will try to rephrase this text into something new.",
"suggestions": "One",
"diversityDegree": "Medium"
}'
curl --request POST --location 'https://api.groupdocs.cloud/v2.0/rewriter/paraphrase/text/trial' \
--header 'Content-Type: application/json' \
--data '{
"language": "en",
"text": "Hello, everyone! We will try to rephrase this text into something new.",
"suggestions": "One",
"diversityDegree": "Medium"
}'
{
"status": 202,
"message": "Starting",
"id": "dae5390e-3658-4bff-85bf-4a77cc04eaa5_text"
}