| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/DocumentSearch |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class DocumentSearchRequest
{
public String searchTerms = null;
public DocumentSearchMode searchMode = null;
public DocumentTermMode termMode = null;
public UUID userId = null;
public String getSearchTerms() { return searchTerms; }
public DocumentSearchRequest setSearchTerms(String value) { this.searchTerms = value; return this; }
public DocumentSearchMode getSearchMode() { return searchMode; }
public DocumentSearchRequest setSearchMode(DocumentSearchMode value) { this.searchMode = value; return this; }
public DocumentTermMode getTermMode() { return termMode; }
public DocumentSearchRequest setTermMode(DocumentTermMode value) { this.termMode = value; return this; }
public UUID getUserId() { return userId; }
public DocumentSearchRequest setUserId(UUID value) { this.userId = value; return this; }
}
public static enum DocumentSearchMode
{
Exact(1),
Contains(2),
StartsWith(3),
EndsWith(4);
private final int value;
DocumentSearchMode(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static enum DocumentTermMode
{
All(1),
Any(2);
private final int value;
DocumentTermMode(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static class DocumentSearchResponse
{
public Integer DocumentSearchCount = null;
public ArrayList<DocumentSearchResult> DocumentSearchResults = new ArrayList<DocumentSearchResult>();
public ResponseStatus ResponseStatus = null;
public Integer getDocumentSearchCount() { return DocumentSearchCount; }
public DocumentSearchResponse setDocumentSearchCount(Integer value) { this.DocumentSearchCount = value; return this; }
public ArrayList<DocumentSearchResult> getDocumentSearchResults() { return DocumentSearchResults; }
public DocumentSearchResponse setDocumentSearchResults(ArrayList<DocumentSearchResult> value) { this.DocumentSearchResults = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public DocumentSearchResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class DocumentSearchResult
{
public UUID AttachmentId = null;
public Date DateAdded = null;
public String AttachmentName = null;
public String Description = null;
public String DocumentType = null;
public String DocumentGroup = null;
public String DropboxTableName = null;
public Integer DropboxRecordId = null;
public String AttachmentTableName = null;
public String AttachmentFieldName = null;
public Integer AttachmentRecordId = null;
public String FilePath = null;
public String OCRSource = null;
public String OCRResult = null;
public ArrayList<LineSearchResult> Lines = new ArrayList<LineSearchResult>();
public UUID getAttachmentId() { return AttachmentId; }
public DocumentSearchResult setAttachmentId(UUID value) { this.AttachmentId = value; return this; }
public Date getDateAdded() { return DateAdded; }
public DocumentSearchResult setDateAdded(Date value) { this.DateAdded = value; return this; }
public String getAttachmentName() { return AttachmentName; }
public DocumentSearchResult setAttachmentName(String value) { this.AttachmentName = value; return this; }
public String getDescription() { return Description; }
public DocumentSearchResult setDescription(String value) { this.Description = value; return this; }
public String getDocumentType() { return DocumentType; }
public DocumentSearchResult setDocumentType(String value) { this.DocumentType = value; return this; }
public String getDocumentGroup() { return DocumentGroup; }
public DocumentSearchResult setDocumentGroup(String value) { this.DocumentGroup = value; return this; }
public String getDropboxTableName() { return DropboxTableName; }
public DocumentSearchResult setDropboxTableName(String value) { this.DropboxTableName = value; return this; }
public Integer getDropboxRecordId() { return DropboxRecordId; }
public DocumentSearchResult setDropboxRecordId(Integer value) { this.DropboxRecordId = value; return this; }
public String getAttachmentTableName() { return AttachmentTableName; }
public DocumentSearchResult setAttachmentTableName(String value) { this.AttachmentTableName = value; return this; }
public String getAttachmentFieldName() { return AttachmentFieldName; }
public DocumentSearchResult setAttachmentFieldName(String value) { this.AttachmentFieldName = value; return this; }
public Integer getAttachmentRecordId() { return AttachmentRecordId; }
public DocumentSearchResult setAttachmentRecordId(Integer value) { this.AttachmentRecordId = value; return this; }
public String getFilePath() { return FilePath; }
public DocumentSearchResult setFilePath(String value) { this.FilePath = value; return this; }
public String getOcrSource() { return OCRSource; }
public DocumentSearchResult setOcrSource(String value) { this.OCRSource = value; return this; }
public String getOcrResult() { return OCRResult; }
public DocumentSearchResult setOcrResult(String value) { this.OCRResult = value; return this; }
public ArrayList<LineSearchResult> getLines() { return Lines; }
public DocumentSearchResult setLines(ArrayList<LineSearchResult> value) { this.Lines = value; return this; }
}
public static class LineSearchResult
{
public String LineText = null;
public Integer PageNo = null;
public Integer PageLineNo = null;
public Integer DocLineNo = null;
public Double BoxTop = null;
public Double BoxLeft = null;
public Double BoxWidth = null;
public Double BoxHeight = null;
public String getLineText() { return LineText; }
public LineSearchResult setLineText(String value) { this.LineText = value; return this; }
public Integer getPageNo() { return PageNo; }
public LineSearchResult setPageNo(Integer value) { this.PageNo = value; return this; }
public Integer getPageLineNo() { return PageLineNo; }
public LineSearchResult setPageLineNo(Integer value) { this.PageLineNo = value; return this; }
public Integer getDocLineNo() { return DocLineNo; }
public LineSearchResult setDocLineNo(Integer value) { this.DocLineNo = value; return this; }
public Double getBoxTop() { return BoxTop; }
public LineSearchResult setBoxTop(Double value) { this.BoxTop = value; return this; }
public Double getBoxLeft() { return BoxLeft; }
public LineSearchResult setBoxLeft(Double value) { this.BoxLeft = value; return this; }
public Double getBoxWidth() { return BoxWidth; }
public LineSearchResult setBoxWidth(Double value) { this.BoxWidth = value; return this; }
public Double getBoxHeight() { return BoxHeight; }
public LineSearchResult setBoxHeight(Double value) { this.BoxHeight = value; return this; }
}
}
Java DocumentSearchRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<DocumentSearchRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<searchMode>Exact</searchMode>
<searchTerms>String</searchTerms>
<termMode>All</termMode>
<userId>00000000-0000-0000-0000-000000000000</userId>
</DocumentSearchRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DocumentSearchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<DocumentSearchCount>0</DocumentSearchCount>
<DocumentSearchResults>
<DocumentSearchResult>
<AttachmentFieldName>String</AttachmentFieldName>
<AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
<AttachmentName>String</AttachmentName>
<AttachmentRecordId>0</AttachmentRecordId>
<AttachmentTableName>String</AttachmentTableName>
<DateAdded>0001-01-01T00:00:00</DateAdded>
<Description>String</Description>
<DocumentGroup>String</DocumentGroup>
<DocumentType>String</DocumentType>
<DropboxRecordId>0</DropboxRecordId>
<DropboxTableName>String</DropboxTableName>
<FilePath>String</FilePath>
<Lines>
<LineSearchResult>
<BoxHeight>0</BoxHeight>
<BoxLeft>0</BoxLeft>
<BoxTop>0</BoxTop>
<BoxWidth>0</BoxWidth>
<DocLineNo>0</DocLineNo>
<LineText>String</LineText>
<PageLineNo>0</PageLineNo>
<PageNo>0</PageNo>
</LineSearchResult>
</Lines>
<OCRResult>String</OCRResult>
<OCRSource>String</OCRSource>
</DocumentSearchResult>
</DocumentSearchResults>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</DocumentSearchResponse>