Rhizome-Conifer / conifer

Collect and revisit web pages.
https://conifer.rhizome.org
Apache License 2.0
1.47k stars 117 forks source link

Provide an API to upload web archives #828

Open refparo opened 3 years ago

refparo commented 3 years ago

So that it could work with browser extensions like https://github.com/machawk1/warcreate

despens commented 3 years ago

There is an API already, please see https://conifer.rhizome.org/docs/api

refparo commented 3 years ago

Thanks! A link to this API doc should be provided on the main page.

refparo commented 3 years ago

How is it exactly used? I tried

curl --cookie "__wr_sesh=(***)" \
  -X "PUT" 'https://conifer.rhizome.org/api/v1/upload' \
  -H 'accept: application/json' \
  --upload-file ./20210705110711693.warc

but kept getting {"error": "not_found"}

refparo commented 3 years ago

After some experiments with curl, now I can't even upload a warc on the website... The response was a 500 internal server error.

m4rk3r commented 3 years ago

hey @refparo, we haven't published that API because it still needs some additional details as you are finding out -- sorry about that. You also need to supply the filename in a filename query param. Here's the frontend code as an example. force-coll can be used to add the warc to an existing collection.

Are you still getting a 500 when attempting on the site now?