Skip to content

Document REST Endpoint

romankarl edited this page Mar 30, 2015 · 5 revisions

Document REST Endpoint

DDHAPT provides a REST endpoint for adding documents which should be used to update the database according to the crawl results. The HTTP request is defined as:

POST /documents
Content-Type: application/json

[
{
"id_watched_target":<long>,
"wayback_timestamp":<String>,
"landing_page_url":<String>,
"document_url":<String>,
"filename":<String>
},
<further documents>
]

Example

POST https://www.webarchive.org.uk/act-ddhapt/documents
Content-Type: application/json

[{
"id_watched_target":1,
"wayback_timestamp":"20150303002015",
"landing_page_url":"http://www.thinknpc.org/publications/show-and-tell/",
"document_url":"http://www.thinknpc.org/publications/show-and-tell/show-and-tell_charities-polling-evidence-of-doing-good/?post-parent=13114",
"filename":"Show-and-tell_charities-polling-evidence-of-doing-good.pdf"
}]

Notes

  • A watched target has its own id which isn't the same as the target id.
  • There is a limit on the length of the posted JSON content which is currently 1MB.