CORE_ATTACHMENT_READ | CORE Endpoint | |
/rpc/core/?method=CORE_ATTACHMENT_READ | ||
This method allows you to import a text file, and get the data returned in a format like an Advanced Search. | ||
If you just want the contents of an attachment try CORE_FILE_READ |
PARAMETERS - via Query String | TYPE | ||
AllColumnsText | Text (1) | Y / N [default]. If you don't want to specify the columns through JSON (below), and want all data returned 'as is' from within the file, set this to Y | |
Id | Numeric | Mandatory. |
PARAMETERS - via JSON Post | |
{ "columns" : [ { "title" : "Surname", "dataType" : "1" }, { "title" : "NumberOfChildren", "dataType" : "2" }, { "title" : "BirthDate", "dataType" : "3" } ], "id" : "13456", "delimeter" : ",", "skipRows" : "0", "processRows" : "5000", "firstLineIsCaptions" : "Y" } |
PARAMETERS - via XML Post | ||
Same fields are available as per JSON |
PARAMETERS | JSON post | |
Column Title | Optional.
|
|
Datatype | Optional
|
|
Id | Mandatory. Id of the attachment. This is the minimum that needs to be passed. If this is all that you do pass, then the import will work out the column titles and datatypes for you. It will assumes that the first line in the file are the column headings | |
Delimeter | Optional. Defaults to a comma. | |
FirstLineIsCaptions | Optional. Defaults to a Y | |
ProcessRows | Optional. Defaults to 5000. Number of records in the file to process | |
SkipRows | Optional. Defaults to 0. Number of records in the file to skip. If the first line are captions, it does not count as a row |
RETURN | TYPE | ||
RowLimit | Text (1) | Y / N. Y means that it stopped after reaching the ProcessRows. N means it stopped after reaching the end of the file |
EXAMPLES | |
1. | Using a QueryString, import a file that contains Surname,NumberOfChildren,BirthDate. Let the system do all the work. The attachment is 1234 |
/rpc/core/?method=CORE_ATTACHMENT_READ&id=1234 | |
2. | Using JSON, as per above, but force validation on the columns |
{ "columns" : [ { "title" : "Surname", "dataType" : "1" }, { "title" : "NumberOfChildren", "dataType" : "2" }, { "title" : "BirthDate", "dataType" : "3" } ], "id" : "1234" } |
|
3. | As per above, but the delimeter is |, plus the data starts on the first row |
{ "columns" : [ { "title" : "Surname", "dataType" : "1" }, { "title" : "NumberOfChildren", "dataType" : "2" }, { "title" : "BirthDate", "dataType" : "3" } ], "id" : "1234", "delimeter" : "|", "firstLineIsCaptions" : "N" } |