Trendsic Platform Service

<back to all web services

DocumentSearchRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/DocumentSearch
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*


open class DocumentSearchRequest
{
    open var searchTerms:String? = null
    open var searchMode:DocumentSearchMode? = null
    open var termMode:DocumentTermMode? = null
    open var userId:UUID? = null
}

enum class DocumentSearchMode(val value:Int)
{
    Exact(1),
    Contains(2),
    StartsWith(3),
    EndsWith(4),
}

enum class DocumentTermMode(val value:Int)
{
    All(1),
    Any(2),
}

open class DocumentSearchResponse
{
    open var DocumentSearchCount:Int? = null
    open var DocumentSearchResults:ArrayList<DocumentSearchResult> = ArrayList<DocumentSearchResult>()
    open var ResponseStatus:ResponseStatus? = null
}

open class DocumentSearchResult
{
    open var AttachmentId:UUID? = null
    open var DateAdded:Date? = null
    open var AttachmentName:String? = null
    open var Description:String? = null
    open var DocumentType:String? = null
    open var DocumentGroup:String? = null
    open var DropboxTableName:String? = null
    open var DropboxRecordId:Int? = null
    open var AttachmentTableName:String? = null
    open var AttachmentFieldName:String? = null
    open var AttachmentRecordId:Int? = null
    open var FilePath:String? = null
    open var OCRSource:String? = null
    open var OCRResult:String? = null
    open var Lines:ArrayList<LineSearchResult> = ArrayList<LineSearchResult>()
}

open class LineSearchResult
{
    open var LineText:String? = null
    open var PageNo:Int? = null
    open var PageLineNo:Int? = null
    open var DocLineNo:Int? = null
    open var BoxTop:Double? = null
    open var BoxLeft:Double? = null
    open var BoxWidth:Double? = null
    open var BoxHeight:Double? = null
}

Kotlin DocumentSearchRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/DocumentSearch HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	searchTerms: String,
	searchMode: Exact,
	termMode: All,
	userId: 00000000000000000000000000000000
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	DocumentSearchCount: 0,
	DocumentSearchResults: 
	[
		{
			AttachmentId: 00000000000000000000000000000000,
			DateAdded: 0001-01-01,
			AttachmentName: String,
			Description: String,
			DocumentType: String,
			DocumentGroup: String,
			DropboxTableName: String,
			DropboxRecordId: 0,
			AttachmentTableName: String,
			AttachmentFieldName: String,
			AttachmentRecordId: 0,
			FilePath: String,
			OCRSource: String,
			OCRResult: String,
			Lines: 
			[
				{
					LineText: String,
					PageNo: 0,
					PageLineNo: 0,
					DocLineNo: 0,
					BoxTop: 0,
					BoxLeft: 0,
					BoxWidth: 0,
					BoxHeight: 0
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}