[PR #1397] REST API v1 using django-ninja #2911

Closed
opened 2026-03-01 18:01:07 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/ArchiveBox/ArchiveBox/pull/1397

State: closed
Merged: Yes


Summary

I recently integrated Archivebox with a small python script. The current approach of setting up the full django environment is somewhat cumbersome and limits usecases where the interaction is triggered by remote systems/containers.

So here goes my initial draft of a REST API based on django ninja.

For Auth I implemented Token/Bearer Auth. Token can be obtained and validated via API Endpoints.
Ideally there should be a UI (Django Admin,...) to make obtaining them more friendly to users.

The current API resembles the CLI for compatibility and simplicity.
Adding CRUD Endpoints should be rather straight forward.

Ideally Endpoints should return a TASK-ID for long running tasks for long polling or allow for SSE subscription.
This would require to update to Django 4.2 for async support.

Related issues

Touches on all the API issues:
#496
#1126

Changes these areas

  • Token model
  • Token based authentication
  • ADD/UPDATE/REMOVE/LIST Endpoints
  • CRUD Endpoints for Snapshot/Link,...
  • UI for Token
  • Extensive Testing suite
  • (future) streaming/fully async endpoints

Screenshot from 2024-04-10 01-45-11

**Original Pull Request:** https://github.com/ArchiveBox/ArchiveBox/pull/1397 **State:** closed **Merged:** Yes --- <!-- IMPORTANT: Do not submit PRs with only formatting / PEP8 / line length changes. --> # Summary I recently integrated Archivebox with a small python script. The current approach of setting up the full django environment is somewhat cumbersome and limits usecases where the interaction is triggered by remote systems/containers. So here goes my initial draft of a REST API based on django ninja. For Auth I implemented Token/Bearer Auth. Token can be obtained and validated via API Endpoints. Ideally there should be a UI (Django Admin,...) to make obtaining them more friendly to users. The current API resembles the CLI for compatibility and simplicity. Adding CRUD Endpoints should be rather straight forward. Ideally Endpoints should return a TASK-ID for long running tasks for long polling or allow for SSE subscription. This would require to update to Django 4.2 for async support. # Related issues Touches on all the API issues: #496 #1126 # Changes these areas - [X] Token model - [x] Token based authentication - [X] ADD/UPDATE/REMOVE/LIST Endpoints - [x] CRUD Endpoints for Snapshot/Link,... - [ ] UI for Token - [ ] Extensive Testing suite - [ ] (future) streaming/fully async endpoints ![Screenshot from 2024-04-10 01-45-11](https://github.com/ArchiveBox/ArchiveBox/assets/3877188/2927b793-2769-466b-97b9-fb0a1333bd27)
kerem 2026-03-01 18:01:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#2911
No description provided.