Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Indexing API Draft #1

Open
rgbkrk opened this issue Apr 16, 2015 · 4 comments
Open

Indexing API Draft #1

rgbkrk opened this issue Apr 16, 2015 · 4 comments

Comments

@rgbkrk
Copy link
Member

rgbkrk commented Apr 16, 2015

We'll want to expose a simplistic API for nbviewer to send notebooks to. Under the hood we'll hit elasticsearch, but that will be abstracted away from the notebook viewer.

Submitting a notebook

POST /api/index/{ uuid.uuid5(uuid.NAMESPACE_URL, notebook_url) }
{
  "public": true,
  "content": { Full notebook document },
  "notebook_url": "http://jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb"
}

Retrieving the stored contents

GET /api/index/{ uuid.uuid5(uuid.NAMESPACE_URL, notebook_url) }

Returns the trimmed version of the body from the post. The notebook document e.g. may or may not have the base64 encoded images stripped out.

Delete an entry from the index

DELETE /api/index/{ uuid.uuid5(uuid.NAMESPACE_URL, notebook_url) }

I'm on the fence about if we should slightly adhere to the contents API for consistency or just choose the fields that make sense to us.

@yuvipanda
Copy link

/me performs necromancy

Do you think APIs should be versioned? :)

@rgbkrk
Copy link
Member Author

rgbkrk commented Dec 24, 2015

Yes!

...not that I always do it at the start

Nice to see you @yuvipanda!

Since this came from nowhere, do you prefer the API version in the path /api/v1/index/ or as part of an explicit Accept header application/vnd.jupyter.v3.raw+json?

@yuvipanda
Copy link

Definitely prefer it in the URL path - much more obvious, IMO.

@minrk
Copy link
Member

minrk commented Dec 30, 2015

+1 to versioned URLs. I don't like using Accept headers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants