Skip to main content
Version: 3

APIs for Text Layout

This page discusses the APIs that you can use to create and manage a Text Layout.

Prerequisites​

  • All APIs require an ACCESS_TOKEN in the request header for access.
  • In case of basic authentication, you need to send Authorization header as Basic <Base64 encoded username and password>

Creating a Text Layout using APIs​

The APIs to create a Text Layout allow you to define and save layouts in two ways:

  • Manual method: Define fields directly in an API request payload.
  • File upload method: Use an API to upload a sample file and create the Layout from the uploaded file.

Both methods require a separate API to save the Layout.

Manual method​

This method uses the following two APIs to: [+] Create the Layout by entering the fields manually [-] Hide

API Endpointhttp://<Domain>/SchemaUI/rest/advschema/xsd/create
MethodPOST
Request payload example
Code
{
"json": {
"category": "Schema",
"type": "text",
"version": "1.0",
"sequentially": true
},
"schema": {
"defineMode": "data",
"entityName": "Customer_Text_Schema",
"schemaType": "text",
"project": "Default",
"entityId": "",
"description": "Schema for customer records (Name, Age, Dob)",
"fieldSeparator": "",
"encodingUsed": "UTF-8"
},
"appInfo": {
"XSDVersion": "1",
"sheets": "CSV",
"startRowNumber": "1",
"bottomRowSkipCount": "0",
"fieldSeparator": ",",
"recordSeparator": "\\n",
"allowLessFields": false,
"allowIgnoreCase": false,
"allowMoreFields": false,
"allowDiscontinousOrder": false,
"removeLastNewLineSeperator": false,
"removeInvalidChar": false,
"enclosedChar": "\""
},
"sheet": [
{
"section": [
{
"name": "Table",
"sectiontype": "table",
"ignoreBlankRows": "0",
"uniqueFieldNames": "",
"fields": [
{
"originalName": "Name",
"name": "Name",
"type": "string",
"format": "AAAAAAA",
"subFormat": "",
"dataMode": "plainText",
"newObject": "true",
"sheetName": "CSV",
"actualTableName": "Table",
"tableName": "Table",
"sectionType": "Table"
},
{
"originalName": "Age",
"name": "Age",
"type": "integer",
"format": "AAAAAAA",
"subFormat": "",
"dataMode": "plainText",
"newObject": "true",
"sheetName": "CSV",
"actualTableName": "Table",
"tableName": "Table",
"sectionType": "Table"
},
{
"originalName": "Dob",
"name": "Dob",
"type": "date",
"format": "yyyy-MM-dd",
"subFormat": "hh:mm:ss",
"dataMode": "plainText",
"newObject": "true",
"sheetName": "CSV",
"actualTableName": "Table",
"tableName": "Table",
"sectionType": "Table"
}
]
}
]
}
],
"dataFilePresent": false,
"filePath": ""
}

| | Success response example | Code

{
"filePath": "D:\\Mono_Enigma_AC\\enigma\\BPMServer\\web\\AdvanceSchemaRepository\\temp\\34228d13-4813-4e01-977e-bedf0fc9def4\\Customer_Text_Schema.json",
"xsd": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n\t<xs:element"Root\">\n\t\t<xs:annotation>\n\t\t\t<xs:appinfo>\n\t\t\t\t<XSDVersion>1</XSDVersion>\n\t\t\t\t<fieldSeparator>,</fieldSeparator>\n\t\t\t\t<recordSeparator>\\n</recordSeparator>\n\t\t\t\t<allowDiscontinousOrder>false</allowDiscontinousOrder>\n\t\t\t\t<allowIgnoreCase>false</allowIgnoreCase>\n\t\t\t\t<allowLessFields>false</allowLessFields>\n\t\t\t\t<removeLastNewLineSeperator>false</removeLastNewLineSeperator>\n\t\t\t\t<removeInvalidChar>false</removeInvalidChar>\n\t\t\t\t<enclosedChar>\"</enclosedChar>\n\t\t\t\t<startRowNumber>1</startRowNumber>\n\t\t\t\t<skippedBottomRows>0</skippedBottomRows>\n\t\t\t\t<allowMoreFields>false</allowMoreFields>\n\t\t\t</xs:appinfo>\n\t\t</xs:annotation>\n\t\t<xs:complexType>\n\t\t\t<xs:sequence>\n\t\t\t\t<xs:element"Record\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n<xs:complexType><xs:sequence>\n<xs:element"Name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\"/>\n<xs:element"Age\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:integer\"/>\n<xs:element"Dob\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:date\"/>\n</xs:sequence>\n<xs:attribute"recordNumber\" type=\"xs:string\" use=\"required\"/>\n</xs:complexType></xs:element>\n\t\t\t</xs:sequence>\n\t\t</xs:complexType>\n\t</xs:element>\n</xs:schema>"
}

| | Error response example | Code

Unable to create xsd string.

| [+] Save the Layout [-] Hide

API Endpointhttp://<Domain>/SchemaUI/rest/advschema/create
MethodPOST
Request payload example
Code
{
"schemaData": {
"TextSchema": {
"advancedSchema": true,
"headerPresent": true,
"nameValueMap": null,
"encodingUsed": "UTF-8",
"password": "",
"json": null,
"xsd": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n\t<xs:element"Root\">\n\t\t<xs:annotation>\n\t\t\t<xs:appinfo>\n\t\t\t\t<XSDVersion>1</XSDVersion>\n\t\t\t\t<fieldSeparator>,</fieldSeparator>\n\t\t\t\t<recordSeparator>\\n</recordSeparator>\n\t\t\t\t<allowDiscontinousOrder>false</allowDiscontinousOrder>\n\t\t\t\t<allowIgnoreCase>false</allowIgnoreCase>\n\t\t\t\t<allowMoreFields>false</allowMoreFields>\n\t\t\t\t<allowLessFields>false</allowLessFields>\n\t\t\t\t<removeLastNewLineSeperator>false</removeLastNewLineSeperator>\n\t\t\t\t<removeInvalidChar>false</removeInvalidChar>\n\t\t\t\t<enclosedChar></enclosedChar>\n\t\t\t\t<startRowNumber>1</startRowNumber>\n\t\t\t\t<skippedBottomRows>0</skippedBottomRows>\n\t\t\t\t<arrayLayout>false</arrayLayout>\n\t\t\t</xs:appinfo>\n\t\t</xs:annotation>\n\t\t<xs:complexType>\n\t\t\t<xs:sequence>\n\t\t\t\t<xs:element"Record\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n<xs:complexType><xs:sequence>\n<xs:element"Name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:string\">\n<xs:annotation><xs:appinfo><format>AAAAAAA</format><originalName><![CDATA[Name]]></originalName><parent> </parent>\n</xs:appinfo></xs:annotation></xs:element>\n<xs:element"Age\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:integer\">\n<xs:annotation><xs:appinfo><format>AAAAAAA</format><originalName><![CDATA[Age]]></originalName><parent> </parent>\n</xs:appinfo></xs:annotation></xs:element>\n<xs:element"Dob\" minOccurs=\"0\" maxOccurs=\"1\" type=\"xs:date\">\n<xs:annotation><xs:appinfo><format>yyyy-MM-dd hh:mm:ss</format><originalName><![CDATA[Dob]]></originalName><parent> </parent>\n</xs:appinfo></xs:annotation></xs:element>\n</xs:sequence>\n<xs:attribute"recordNumber\" type=\"xs:string\" use=\"required\"/>\n</xs:complexType></xs:element>\n\t\t\t</xs:sequence>\n\t\t</xs:complexType>\n\t</xs:element>\n</xs:schema>",
"advanceXsd": null,
"allowLessFields": false,
"allowIgnoreCase": false,
"allowMoreFields": false,
"skippedBottomRows": "0",
"startRowNumber": "1",
"allowDiscontinousOrder": false,
"passwordProtected": false,
"repositoryLocation": null,
"xsdFilePath": "",
"recordService": null,
"previousVersion": "",
"permissionMask": "770",
"description": "Schema for customer records (Name, Age, Dob)",
"entityName": "Customer_Text_Schema",
"entityFolderPath": "D:\\Mono_Enigma_AC\\enigma\\BPMServer\\web\\AdvanceSchemaRepository\\temp\\34228d13-4813-4e01-977e-bedf0fc9def4\\Customer_Text_Schema.json",
"project": "Default",
"encloseFieldsInQuotes": false,
"quotesHandlingOn": false,
"removeLastNewLineSeperator": false,
"removeInvalidChar": false,
"reusable": true
}
},
"schemaType": "text",
"filePath": "D:\\Mono_Enigma_AC\\enigma\\BPMServer\\web\\AdvanceSchemaRepository\\temp\\34228d13-4813-4e01-977e-bedf0fc9def4\\Customer_Text_Schema.json",
"fileChange": false
}

| | Success response example | Code

{
"id": "192168001111175765207883100003",
"entityName": "Customer_Text_Schema",
"serviceName": "TextSchema",
"filePath": [
"web/AdvanceSchemaRepository\\192168001111175765207883100003\\Customer_Text_Schema.json"
]
}

|

Headers​

NameValueRequiredDescription
Content-Typeapplication/jsonYesRequest body must be JSON formatted.
ACCESS_TOKEN<JWT Token>YesJWT Token to access Adeptia services

File upload method​

This method uses the following three APIs to: