Find and download a document

​Simple search


 

An example on how to perform a simple search is available at Step 2.

That example shows how to perform a simple search with one search parameter. To search for documents based on multiple metadata values, they can just be specified as additional get parameters. For example: 

https://arkiv-test.nets.no/arkiv-rest-generic/external/912341234/eArchive/documents/metadata?customerId=12341234123&documentType=10014&documentDate=20171201&format=xml&userId=charles&trackingCode=1000047

 

Ranges and wildcards


 It is possible to perform searches based on ranges or matching of metadata values, using a special syntax in the value of the URL parameters. Instead of the regular simple syntax of name=value, name=name::operator::arguments should be used, where the operator is one of the operators in the following table, and the arguments is a comma separated list of arguments to the operator. Currently, the only operator that supports more than one argument is BETWEEN.

​Operator​​Description​Number of parameters
​BETWEENSearch for values that numerically or alphabetically is between two values​2
​EQUALS​Same as just specifying the value​1
​NOT​The result should not contain the provided index value​1
​GREATERSearch for values numerically or alphabetically higher than the specified value​1
​GREATER_OR_EQUAL​Same as GREATER, but also matches the specified value​1
​LESS​Search for values numerically or alphabetically lower than the specified value​1
​LESS_OR_EQUAL​Same as LESS, but also matches the specified value​1
​MATCHES​Allows the inclusion of the * character (any number of occurences) to match any sequence of characters. For instance j*p* would match both jupiter and japan.​1

Search Result


 Depending on the value of the format parameter, the result will either be in JSON or XML. Here is an example of a search result, first as XML and then as JSON. 

<searchResults>   
  <index>     
    <description>Test 1</description> 
    <documentDate>20111212</documentDate> 
    <documentGroup>1</documentGroup> 
    <documentId>X20112314abcd12334252</documentId> 
    <documentType>102</documentType> 
    <mimetype>application/pdf</mimetype> 
    <department>1</department> 
    <customerId>12341234124</customerId> 
    <customerId>57656531312</customerId> 
  </index> 
  <index>     
    <description>This is another test</description> 
    <documentDate>20161212</documentDate> 
    <documentGroup>2</documentGroup> 
    <documentId>X20152314abcd12334252</documentId> 
    <documentType>202</documentType> 
    <mimetype>application/pdf</mimetype> 
    <department>1</department> 
    <customerId>55554444222</customerId> 
    <customerId>57656531312</customerId> 
  </index> 
</searchResults> 

{"searchResults":[
  {"documentDate":"20111212", 
   "mimetype":"application/pdf", 
   "customerId":["12341234124","57656531312"], 
   "documentType":"1", 
   "customerRef":"1234",
   "department":"1",
   "description": "Test 1", 
   "documentId":"X20112314abcd12334252",
   "documentGroup":"1"},
  {"documentDate":"20161212", 
   "mimetype":"application/pdf", 
   "customerId":["55554444222","57656531312"], 
   "documentType":"1", 
   "customerRef":"1234",
   "department":"1",
   "description": "This is another test", 
   "documentId":"X20112314abcd12334252",
   "documentGroup":"1"}]}