75 lines
1.2 KiB
Markdown
75 lines
1.2 KiB
Markdown
|
|
# Binect API Specification
|
||
|
|
|
||
|
|
## Overview
|
||
|
|
This document specifies the Binect API endpoints used by BinectChrome extension.
|
||
|
|
|
||
|
|
## Base URL
|
||
|
|
```
|
||
|
|
https://api.binect.de
|
||
|
|
```
|
||
|
|
|
||
|
|
## Authentication
|
||
|
|
Username/password authentication using HTTP Basic Auth or JSON payload.
|
||
|
|
|
||
|
|
### Endpoint: Login
|
||
|
|
```
|
||
|
|
POST /auth/login
|
||
|
|
Content-Type: application/json
|
||
|
|
|
||
|
|
{
|
||
|
|
"username": "string",
|
||
|
|
"password": "string"
|
||
|
|
}
|
||
|
|
|
||
|
|
Response 200 OK:
|
||
|
|
{
|
||
|
|
"token": "string",
|
||
|
|
"expiresAt": "ISO8601 timestamp"
|
||
|
|
}
|
||
|
|
|
||
|
|
Response 401 Unauthorized:
|
||
|
|
{
|
||
|
|
"error": "Invalid credentials"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## PDF Upload
|
||
|
|
|
||
|
|
### Endpoint: Upload PDF
|
||
|
|
```
|
||
|
|
POST /documents/upload
|
||
|
|
Authorization: Bearer {token}
|
||
|
|
Content-Type: multipart/form-data
|
||
|
|
|
||
|
|
Form fields:
|
||
|
|
- file: PDF file (binary)
|
||
|
|
- filename: string (optional)
|
||
|
|
|
||
|
|
Response 200 OK:
|
||
|
|
{
|
||
|
|
"documentId": "string",
|
||
|
|
"status": "received",
|
||
|
|
"uploadedAt": "ISO8601 timestamp"
|
||
|
|
}
|
||
|
|
|
||
|
|
Response 400 Bad Request:
|
||
|
|
{
|
||
|
|
"error": "Invalid file format"
|
||
|
|
}
|
||
|
|
|
||
|
|
Response 401 Unauthorized:
|
||
|
|
{
|
||
|
|
"error": "Authentication required"
|
||
|
|
}
|
||
|
|
|
||
|
|
Response 413 Payload Too Large:
|
||
|
|
{
|
||
|
|
"error": "File size exceeds limit"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## Notes
|
||
|
|
- API may evolve - this is v1 specification
|
||
|
|
- For actual implementation, verify with Binect API documentation
|
||
|
|
- Rate limits may apply
|