The available Swagger UI for the Congree REST API is located in the following URL: http:///congree/swagger
Congree REST API endpoints are located at http:///congree/api
AuthoringMemory
POST | /congree/api/AuthoringMemory/v1/ImportXml?lang={CultureName} | HTTP request used to add content to the Congree Sentence Database |
The culture name in the format languagecode2-country/regioncode2. languagecode2 is a lowercase two-letter code derived from ISO 639-1. country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag.
E.g. /congree/api/AuthoringMemory/v1/ImportXml?lang=de-DE
The content type should be multipart/form-data and it should contain file XML.
{ "DetectedParagraphsCount": 0, "DetectedSentencesCount": 0, "AddedSentencesCount": 0, "FailedParagraphsCount": 0 }
Requirements
The content has to be well-formed XML with resolved entity references.
Maximum size: 10 MB
Authoring Memory: Search
POST | /api/AuthoringMemory/v1/Search | Searches for sentence in Authoring Memory |
This endpoint requires a JSON object as parameter:
{ "Xml": "string", "RuleSetName": "string" }
Property | Description |
---|---|
Xml | A well-formed XML string. |
RuleSetName | The name of the rule set the string is assigned to. |
The request returns a JSON object providing the information detailed below.
{ "ResultXml": "string", "Sentences": [ { "Id": 0, "ContextId": 0, "DisplayContent": "string", "SearchResults": [ { "SearchMode": "Similar", "Similarity": 0, "Class": "string", "DisplayContent": "string", "ApplyContent": "string", "Evaluation": "Approved", "Attributes": [ { "Name": "string", "Values": [ "string" ] } ], "Penalties": [ { "PenaltyType": "DifferentText", "Value": 0 } ] } ] } ] }
Property | Description |
---|---|
ResultXml | The string that was searched for annotated with processing instructions (PI) providing a markup to identify indiviual portions of the text. |
Sentences | An array of all sentences that were found |
Id | Id - identifier of original sentence. It refers to corresponding PI in ResultXml |
ContextId | Identifier of paragraph. It refers to the corresponding PI in ResultXml. |
SearchResults | An array of search results for a specific sentence. |
SearchMode | The search method that was applied to get this result. Possible values are "Similar", "Concordance", "Word", "Approximate". |
Similarity | The computed similarity between two sentences. This value is calculated if SearchMode is Similar. |
Class | Congree class |
DisplayContent | Contains the content of the found sentence. It can also contains the additional Processing Instructions which Congree adds to mark the difference between the original and the found sentences, where <?cngr-dif-b TypeOfDifference?> - indicates the beginning of the range where the difference in the content begins <?cngr-dif-e TypeOfDifference?> - indicates the end of the range where the difference in content ends <?cngr-dif-r TypeOfDifference?> - indicates that the content was removed at this location Each Processing Instruction contains as a PIContent an integer value that indicates the type of difference (TypeOfDifference). The the type of difference can take the following values: 2 - Authoring Memory content contains more characters than checked content. 3 - Checked content contains more characters than the Authoring Memory. 4 - Indicates that Auto-Adjustment was applied at this point. 5 - Indicates that "placeholder" was detected. Congree recognizes tag as placeholder when it is defined as "Ignore content" in the paragraph recognition Treatments. How "placeholder" works: E.g. Let's assume <u> is a placeholder. If an original sentence is: This is a test <u>certain content that should not be considered when searching</u>. And found result is This </u> is not a test. Then the resulting sentence will be This <u>certain content that should not be considered when searching</u> is not a test. |
ApplyContent | The content that Congree proposes to insert into the editor. |
Evaluation | The Data Grooming state. Possible values are "Approved", "Discarded", "Unknown". |
Attributes | An array of attributes associated with found sentence, |
Name | The name of ther attribute |
Values | An array of values assigned to the attribute |
Penalties | An array of penalties imposed for mismatching the original proposal. |
PenaltyType | The type of penalty. Supported types are: DifferentText, DifferentInlineElements, DifferentPunctuation, DifferentSpecialCharacters, DifferentClass, SwitchedWords, DifferentCase, DifferentSpaces, DifferentNumbers. |
Value | The value deducted from the similarity after the fine is imposed |
Authoring Memory: Attributes
POST | /api/AuthoringMemory/v1/Attributes | Adds new attributes with values |
GET | /api/AuthoringMemory/v1/Attributes | Returns available attributes |
DELETED | /api/AuthoringMemory/v1/Attributes | Deleted available attributes |
Attributes can be specified by:
- Type (string, optional): Type = ['Text', 'Picklist'],
- Name (string, optional): Name
- Values (Array[string], optional): Available values
Authoring Memory: Sentences
POST | /api/AuthoringMemory/v1/Sentences/{sentenceId}/Attributes | Adds new attibutes or values to the sentence |
GET | /api/AuthoringMemory/v1/Sentences/{sentenceId}/Attributes | Gets attributes for certain sentence |
DELETE | /api/AuthoringMemory/v1/Sentences/{sentenceId}/Attributes | Deletes attributes or values of the sentence |
GET | /congree/api/AuthoringMemory/v1/Sentences | Get sentences based on the provided filter |
DELETE | /congree/api/AuthoringMemory/v1/Sentences | Cleans up Authoring Memory sentences |
DELETE | /congree/api/AuthoringMemory/v2/Sentences | Deletes sentences from Authoring Memory |
The body of the request should contain the options you can find in the table below in the following form:
{ "ClearImportedSentences" : true, "ClearDataGroomingSentences": true }
Option name | Description |
---|---|
ClearImportedSentences | Deletes imported (via API /congree/api/AuthoringMemory/v1/ImportXml) sentences |
ClearDataGroomingSentences | Deletes all sentences from Congree Data Grooming and also related sentences from the Authoring Memory |
In order to get the task status and results, use the methods described in Tasks. The result is an empty object.
{ "Id": "00000000-0000-0000-0000-000000000000" }
Information
GET | /congree/api/Information/v1/Version | Returns Congree Server and Web API versions |
{ "CongreeWebApiVersion": "string", "CongreeVersion": "string" }
GET | /congree/api/Information/v1/Components | Returns available components |
The response structure corresponds to CongreeComponentInfo class, see Type definitions - IBulkCheckService - Auxiliary types.
[ { "Id": "string", "Name": "string" } ]