Hackathon2019

<back to all web services

DocumentRequest

Requires Authentication
The following routes are available for this service:
GET/api/document/{TopDestination}/chunk/{ChunkId}Lookup chunk in document by the documents destination and chunk id. Use ChunkId=1 for first chunk
DocumentRequest Parameters:
NameParameterData TypeRequiredDescription
TopDestinationpathstringYesThe document id. Returned from the search endpoint
ChunkIdpathintYesThe part/chunk of the document. Defaults to the first chunk (chunkid=0)
DocumentResponse Parameters:
NameParameterData TypeRequiredDescription
TotalChunksformintNoNumber of chunks in the document
ChunkIdformintNoThe current chunk id
MainDestinationformstringNoThe document destination
MetadataformDocumentMetadataNoDocument Metadata
SubdestinationsformList<string>NoList of subdestinations in this chunk
HighlightTermsformList<string>NoList of highlighted terms (when a documentsearch is performed to fetch chunk)
HtmlformstringNoThe actual Rhtml (Rettsdata html) belonging to this chunk
DocumentMetadata Parameters:
NameParameterData TypeRequiredDescription
TitleformstringNoThe document title
SourceformstringNoThe document source
AuthorformstringNoThe document author
PublishedDateformDateTimeNoThe document publish date
StatusformstringNoThe legal status of the document

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

HTTP + CSV

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

GET /api/document/{TopDestination}/chunk/{ChunkId} HTTP/1.1 
Host: hackathon2019.rettsdata.no 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"totalChunks":0,"chunkId":0,"mainDestination":"String","metadata":{"title":"String","source":"String","author":"String","publishedDate":"0001-01-01T00:00:00.0000000","status":"String"},"subdestinations":["String"],"highlightTerms":["String"],"html":"String"}