Fixes
This commit is contained in:
1 parent
04794aea54
commit
cfd31f398c
61 files changed
+2062
-254
No files matched your search
@@ -0,0 +1,45 @@
|
||||
# Public API / processing audit (v11)
|
||||
|
||||
## Customer-facing API contract
|
||||
|
||||
- **Public API base**: `https://api.descrybe.io/api/v1`
|
||||
- **Interactive reference**: `https://descrybe.io/docs`
|
||||
- **Spec**: `https://api.descrybe.io/api/v1/openapi.yaml`
|
||||
- **Authentication**: Company API key in `Authorization: Bearer dk_...` or `X-API-Key: dk_...`, except public health/spec operations.
|
||||
- **Dashboard operations**: Team and platform-admin controls are not available via an API key. They require a signed-in dashboard session and CSRF where applicable.
|
||||
|
||||
Source comparison: `apps/api/internal/httpapi/v1.go` vs `apps/api/internal/httpapi/v1_openapi.go`. The router registers **35 public paths and 49 method/path operations**; all 49 are covered by the OpenAPI definition. The OpenAPI document also includes two intentionally separate session-only paths (`/team/{userID}`, `/admin/emails/set-password`).
|
||||
|
||||
## Processing modes
|
||||
|
||||
The **What to process** menu now includes only these content deliverables:
|
||||
|
||||
| Choice | Execution mode | What happens |
|
||||
|---|---|---|
|
||||
| AI Title | `title` | Runs the enrichment pipeline to generate product copy |
|
||||
| AI Description | `description` | Runs the enrichment pipeline to generate product copy |
|
||||
| SEO Meta | `seo_meta` | Generates `meta_title` / `meta_description`, preserving existing product name and description |
|
||||
| Any combination | `enhance` | Runs the combined enrichment pass; the backend is not yet a fully independent field-by-field AI generator |
|
||||
|
||||
Category resolution and attribute parsing are internal prerequisites and are not checkboxes. The backend uses `processing_type` to select execution; `processing_types` is an informational selection list, not an execution instruction.
|
||||
|
||||
For the public API, `POST /products/process` accepts products by EAN; `POST /process` uses raw-product UUIDs. The payloads, status codes, and response wrappers differ. See [public-api-reference.md](public-api-reference.md) and the interactive OpenAPI spec.
|
||||
|
||||
## Feed and export formats
|
||||
|
||||
- Feed ingestion: XML (including `SHOPITEM` and nested `PARAMS`), CSV, JSON.
|
||||
- Feed create: `name` plus `url` or `item_path`. Remote feeds can generally infer an item path. Explicit JSON array paths are also supported.
|
||||
- Secret-bearing feed headers are configured through the logged-in dashboard; the public `POST /feeds` body does not accept arbitrary headers.
|
||||
- Export-feed create supports `xml`, `csv`, and `json`; public token URLs have the corresponding extension. JSON token download is registered at `/api/public/export-feeds/{token}.json`.
|
||||
|
||||
## Deployment
|
||||
|
||||
Deploy the **web, API, and worker** from the same ZIP. This update does not require a database migration. After deployment, check the production `/docs` page, the three processing checkboxes, a SEO-only job, and a JSON export URL.
|
||||
|
||||
## Checks and limitations
|
||||
|
||||
- OpenAPI YAML parses; all references resolve; all 49 public route/method registrations appear in the document.
|
||||
- Two frontend processing selection tests pass.
|
||||
- The modified frontend TypeScript blocks parse.
|
||||
- All 664 Go source/test files parse with standard `go/parser`.
|
||||
- A complete Go 1.25 API/worker compilation, Svelte build, database-integrated processing, and live endpoint E2E were **not** available here, so production runtime compatibility still requires your deployment checks.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Feed removal – unprocessed raw product cleanup (v12)
|
||||
|
||||
`DELETE /api/feeds/{id}` (dashboard) and `DELETE /api/v1/feeds/{id}` (public API, where authorized) now use the same service transaction:
|
||||
|
||||
1. Lock the company-owned feed (`SELECT … FOR UPDATE`). Cross-company IDs return 404.
|
||||
2. Transfer raw products still associated with another existing feed (legacy `feed_ids`) to that surviving feed.
|
||||
3. Delete raw products owned only by the removed feed when `is_processed = false` and `processing_status IN ('unprocessed', 'failed')`.
|
||||
4. Remove deleted-feed references from the `feed_ids` arrays of retained raw products.
|
||||
5. Delete the input-feed row and let normal foreign keys remove its mappings/sync history while setting feed IDs to NULL on preserved products.
|
||||
6. Commit all actions together. If any statement fails, nothing is deleted.
|
||||
|
||||
**Never deleted:** already processed products; actively processing raw products; products owned by another feed; users' other companies' data. When a processed output points to a raw product that is removed, PostgreSQL detaches its `raw_product_id` reference; the processed output stays.
|
||||
|
||||
**Response:** `{ "id": "...", "deleted": true, "deleted_unprocessed_products": 42 }`.
|
||||
|
||||
**Caveat:** a raw product in `processing` status is not deleted because a worker may be generating content; deleting the source feed detaches it instead. The worker should be deployed with the matching API release so feed synchronization writes respect the deleted feed's FK.
|
||||
|
||||
**Checks:** `go test ./internal/feeds -run TestDeleteFeedRemovesOnlyOwnedUnprocessedProducts -count=1` from `apps/api`, with migrated test PostgreSQL and `DATABASE_URL`. This verifies two deleted rows, processed/processing preservation, multi-source reassignment, tenant boundaries, and repeat deletion. A full Go 1.25 build and DB integration test must run on the deployment/test environment.
|
||||
|
||||
No database migration is necessary.
|
||||
@@ -0,0 +1,85 @@
|
||||
# Descrybe feed import/export — XML and JSON v10
|
||||
|
||||
## XML: supplier SHOPITEM records and nested attributes
|
||||
|
||||
Feeds with `<SHOP><SHOPITEM>…</SHOPITEM></SHOP>` are supported. Record path is detected as `SHOP/SHOPITEM`, and the sync parser recognizes `SHOPITEM` even if the UI has not saved a record path. `PRODUCT` inside `SHOPITEM` is treated as the product name, not an item wrapper.
|
||||
|
||||
Recommended EMOS mapping (auto-suggestions select available standard fields):
|
||||
|
||||
| Source | Target |
|
||||
| --- | --- |
|
||||
| `EAN` | `gtin` (required) |
|
||||
| `PRODUCT` | `title` |
|
||||
| `PRODUCTNO` | `sku` |
|
||||
| `PRODUCTNO2` | `mpn` |
|
||||
| `MANUFACTURER` | `brand` |
|
||||
| `CATEGORY` | `category` (hierarchical supplier path retained) |
|
||||
| `DESCRIPTION_BASIC` | `description` (the supplier's HTML) |
|
||||
| `PARAMS` | `specifications` (nested named values) |
|
||||
| `DESCRIPTION` | `specifications` (pipe-separated `label: value` fallback when `PARAMS` is unavailable) |
|
||||
| `IMGURL` | `image_url` |
|
||||
| `ADDITIONAL_IMAGE_URLS` | `additional_image_urls` |
|
||||
| `PRICE_VAT` | `price` |
|
||||
| `PRICE_VOC` | `purchase_price` |
|
||||
| `AVAILABILITY` | `availability` |
|
||||
| `URL` | `product_url` |
|
||||
|
||||
Every `PARAMS/PARAM` entry becomes its own `PARAMS/<normalized-name>` key, with its corresponding `VAL` and no value from any other `PARAM`. `ORDER` only affects the supplier's display order and is not imported as a technical attribute. Additional `IMGURL_ALTERNATIVE_XX` URLs are collected into `ADDITIONAL_IMAGE_URLS`.
|
||||
|
||||
For auto-mapping: open the feed's **Map fields** screen, extract schema, review suggested mappings, and apply. Required mappings appear first; newly added mapping rows are inserted at the top of the editable section. Approve proposed aliases when supplier semantics are ambiguous.
|
||||
|
||||
## JSON product feed (URL or file)
|
||||
|
||||
Create a feed using JSON and supply an HTTP URL or a local `.json` file. Supported shapes include:
|
||||
|
||||
```json
|
||||
[{"ean":"8595025395184","name":"Lamp"}]
|
||||
```
|
||||
|
||||
```json
|
||||
{"data":{"products":[{"ean":"8595025395184","name":"Lamp","attributes":[{"name":"color","value":"white"}]}]}}
|
||||
```
|
||||
|
||||
Also recognizes arrays named `products`, `items`, `results`, `records`, `shopitem`, `offers`, `entries`, and `data`. For unusual shapes, set the JSON product record path (e.g., `data/products`) on the mapping screen. Scalar fields use slash-separated nested paths, and repeated `[{name,value}]` attribute pairs become named specification children.
|
||||
|
||||
For the Sanotechnik example, use `https://datacore.sanotechnik.com/datacore/sanotechnik-products/?format=json`. The exact response shape could not be verified from the external endpoint; extract the schema and confirm the suggested item path and mappings before syncing the full feed.
|
||||
|
||||
## Authentication and headers
|
||||
|
||||
Feed creation/editing supports Bearer tokens, a named API-key header, and additional string-valued HTTP headers. Credentials are encrypted in existing `input_feeds.options`, not returned in feed DTOs. When editing a feed, leave header inputs blank to retain existing credentials. A redirect to another hostname strips all custom headers. HTTP and DNS targets are subject to the existing SSRF protections.
|
||||
|
||||
JSON URL catalog import for **products, categories, or attributes** is available in the respective catalog pages. These are bounded one-time imports using existing company-scoped CSV upserts and a **6 MiB** catalog upload limit. For large product catalogs, use an automatically synced JSON feed instead (existing max **256 MiB** download and **1,000,000** row guard).
|
||||
|
||||
Example one-time catalog request (requires a user session or supported authentication):
|
||||
|
||||
```http
|
||||
POST /api/categories/import
|
||||
Content-Type: application/json
|
||||
|
||||
{"url":"https://supplier.example/catalog/categories?format=json","format":"json","request_headers":{"X-API-Key":"YOUR_KEY"}}
|
||||
```
|
||||
|
||||
Use `/api/attributes/import` or `/api/products/import` for those catalog types. Direct one-time product imports use the existing product catalog's core-field importer; nested specifications should be imported with a mapped JSON feed.
|
||||
|
||||
## JSON export
|
||||
|
||||
Select **Custom JSON** when creating an export feed. Generated JSON contains a configurable array root (default `products`); fields are mapped from Descrybe product data. JSON public feeds have paths:
|
||||
|
||||
```text
|
||||
/api/public/export-feeds/<token>.json
|
||||
```
|
||||
|
||||
The export stream writes records incrementally; the format choice is also honored for on-demand and selected-product exports. Do not share the public export URL as a secret credential: the URL token is the access mechanism, as with existing CSV/XML public exports.
|
||||
|
||||
## Deployment and verification
|
||||
|
||||
No SQL migration is needed for these features because feed type, export format, and encrypted source settings reuse existing TEXT/JSONB columns.
|
||||
|
||||
1. Deploy updated **API, worker and frontend** together.
|
||||
2. Rebuild using **Go 1.25** (required by the project).
|
||||
3. Create an XML `SHOPITEM` feed and verify named attributes survive sync; map EAN as GTIN.
|
||||
4. Create a JSON feed and extract its schema; check the detected array path.
|
||||
5. Create a Custom JSON export and fetch the generated `.json` URL.
|
||||
6. Run the new Go parser/catalog regression tests and your normal integration suite.
|
||||
|
||||
Focused tests were run under an isolated Go 1.23 standard-library harness for parser and JSON-to-CSV helper files. Changed frontend scripts passed TypeScript syntax transpilation. The complete Go 1.25 application build, Svelte compiler build, and live Sanotechnik request were not verified in this environment.
|
||||
@@ -0,0 +1,26 @@
|
||||
# Descrybe v11 – Processing and public API documentation
|
||||
|
||||
**Source baseline:** Descrybe v10 XML/JSON feed imports and exports.
|
||||
|
||||
## Updated
|
||||
|
||||
- The product bulk **What to process** menu offers AI Title, AI Description, and SEO Meta only.
|
||||
- SEO-only processing uses `processing_type: seo_meta`. The AI is called for metadata, but saved title/description fields are kept instead of accepting unrelated rewrites.
|
||||
- SEO Meta is gated like other paid AI processing modes.
|
||||
- The in-app documentation and RapiDoc target the production API endpoint by default.
|
||||
- OpenAPI is corrected for JSON feed/import/export formats, optional feed record paths, actual processing-mode behavior, permissions, and SEO metadata.
|
||||
- JSON public export links now use `.json` rather than defaulting to `.xml`.
|
||||
- The public API guide includes all router-registered paths and real production authentication examples.
|
||||
|
||||
## Deploy
|
||||
|
||||
Update **frontend, API, and worker together**. No new database migration is required. The production API reference is at `https://descrybe.io/docs`.
|
||||
|
||||
## Check
|
||||
|
||||
1. Bulk-select some products and open **What to process**. Only AI Title / AI Description / SEO Meta should appear.
|
||||
2. Run only **SEO Meta**. The existing product name and description should remain unchanged; generated `meta_title` and `meta_description` should be available in processed product data when company policy allows SEO metadata and AI generation succeeds.
|
||||
3. Create a JSON export feed; its returned URL should end in `.json`.
|
||||
4. Open `/docs`, authorize using a company API key, and verify the production server and the documented paths.
|
||||
|
||||
See [API_V11_AUDIT.md](API_V11_AUDIT.md) for contract checks and limitations.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Descrybe – sestanek z naročnikom: dobavitelji in pilot
|
||||
|
||||
**Trajanje:** 30 minut · **Cilj:** na dejanskih EAN-ih preveriti uvoz, kakovost podatkov, slovenski AI opis ter izvozne podatke; dogovoriti se za odgovornosti in stroške.
|
||||
|
||||
## 1. Kratek uvod (3 min)
|
||||
|
||||
»Descrybe je platforma za zbiranje, urejanje in dopolnjevanje podatkov o izdelkih. Iz dobaviteljskih virov uvozimo izdelke, preslikamo polja, kategorije in tehnične lastnosti, po potrebi pripravimo AI naslove, opise in SEO meta podatke ter izvozimo podatke za vašo trgovino. Cilj je, da po prvi nastavitvi lahko večino rednega dela upravljate sami.«
|
||||
|
||||
### Kaj je že pripravljeno
|
||||
|
||||
- **GROHE:** iz prejetega CSV so bili pripravljeni ločeni uvozi kategorij, atributov in izdelkov. Potreben je še pregled pravilnosti ter preizkus generiranja slovenskih vsebin.
|
||||
- **EMOS:** XML format in ugnezdene lastnosti so bile preizkušene. Na produkcijskem viru je treba potrditi dostopnost, EAN preslikavo in periodično sinhronizacijo.
|
||||
- **Sanotechnik:** dobavitelj nudi JSON; preslikavo njegovih polj in EAN omejitev je treba potrditi na dejanskem dostopnem viru.
|
||||
- **KOOPMAN in TRBOVC:** obseg je treba najprej preveriti, ker podatki niso nujno v enotnem strukturiranem viru.
|
||||
- **Groupe SEB:** ločena ocena po prejemu specifikacije.
|
||||
|
||||
## 2. Praktični pilot (10 min)
|
||||
|
||||
1. Naročnik predloži TXT z EAN-i. Za sestanek izberemo **5–10 izdelkov**, med njimi vsaj enega iz GROHE in enega iz EMOS. Pred uvozom preverimo, ali lahko izbor EAN izvajamo z obstoječim filtrom; po potrebi ga vključimo v izvedbeni obseg.
|
||||
2. Prikažemo razliko med **surovim uvozom** in **AI obdelavo**: EAN, naziv, znamka, opis, kategorija, tehnične lastnosti, slike, dokumenti.
|
||||
3. Za 1–2 izdelka izberemo slovenski jezik, pregledamo AI naziv, HTML opis in SEO meta podatke. Ustreznost preveri naročnik; prevod se ne ustvari že s samim uvozom dobaviteljeve datoteke.
|
||||
4. Pokažemo **izvoz v CSV, XML ali JSON** glede na preslikavo in dejansko razpoložljive podatke. Pred končno obljubo preverimo konkreten izvozni profil trgovine.
|
||||
5. Zabeležimo manjkajoče podatke in odločitve (npr. energetske nalepke, PDF dokumenti, barve, kategorije).
|
||||
|
||||
**Opomba o preizkusu:** paket Free in prikazani Demo z 0 AI krediti ne omogočata dokazovanja AI generiranja. Za tak preizkus mora imeti testni račun dodeljene AI kredite oziroma ustrezno plačljivo naročnino.
|
||||
|
||||
## 3. Kaj vključuje Descrybe in kaj ni zajeto
|
||||
|
||||
| Zajeto v osnovnem izdelku, v okviru paketa | Izven standardnega priklopa / dodatno po ponudbi |
|
||||
|---|---|
|
||||
| Uvoz dobaviteljskih CSV, XML in JSON virov ter preslikava polj | Razvoj posebnih konektorjev, avtomatizacija neprilagojenih PDF-jev, kompleksno zajemanje spletnih strani |
|
||||
| Uvoz in urejanje kategorij ter atributov, če so podatki na voljo | Ročno dopolnjevanje podatkov, ki jih dobavitelj ne zagotavlja |
|
||||
| AI naslovi, opisi, meta podatki in izbrani jeziki ob ustreznem dobroimetju | Neomejeni AI prevodi ali zagotovilo, da AI vsebina nikoli ne potrebuje pregleda |
|
||||
| Izvoz glede na podprta polja in nastavljen profil | Integracija z ERP/spletno trgovino, za katero je treba razviti nov namenski modul |
|
||||
| Prikaz uvoženih podatkov in razpoložljivih podatkov za energijske oznake | Jamstvo zakonodajne skladnosti, pridobitev manjkajočih izjav in specifikacij od proizvajalcev |
|
||||
|
||||
**KOOPMAN lučke:** za izdelke, za katere veljajo pravila energijskega označevanja, so potrebni pravilni energijski razred, elektronska nalepka in podatkovni list, ki morajo biti ustrezno predstavljeni kupcem. Pred priklopom določimo, katere izdelke pravila zajemajo, ali so modeli v EPREL in ali so dokumenti/slovenske informacije razpoložljivi. Ne smemo obljubiti ustvarjanja energijskih nalepk ali razredov iz nič. Končno pravilnost objave potrdi trgovec. Vir: https://energy-efficient-products.ec.europa.eu/product-list/light-sources_en in https://energy-efficient-products.ec.europa.eu/dealers_en
|
||||
|
||||
## 4. Pet načinov vključitve (enkratno, brez DDV)
|
||||
|
||||
| Scenarij | Cena | Vključeno | Tipičen rok |
|
||||
|---|---:|---|---|
|
||||
| **Samostojni začetek** | **0 €** | Registracija, navodila, samostojna preslikava enega vira, samostojen preizkus | Samostojno |
|
||||
| **Pomoč pri začetku** | **199 €** | 1 običajen strukturiran vir, osnovna preslikava, preverjanje manjšega vzorca, 1 kratek prikaz | 1–2 delovna dneva |
|
||||
| **Katalog iz več virov** | **649 €** | Do 3 običajni strukturirani viri, kategorije, atributi, osnovna pravila, kontrolni vzorec in predaja | 3–5 delovnih dni |
|
||||
| **Poslovni zagon** | **1.490 €** | Do 3 standardni viri, razpored sinhronizacije, do 2 jezika, izvoz/API povezava na obstoječe zmožnosti in usposabljanje | 1–2 tedna |
|
||||
| **Integracija po meri** | **od 3.500 €** | ERP/PIM, zahtevni PDF viri, posebne integracije, večje migracije in QA po dogovoru | Po oceni |
|
||||
|
||||
Cene veljajo za dogovorjen obseg dela. Velikost kataloga ni sama po sebi obljuba ročne priprave vseh artiklov. Za dodatne posege predhodno potrdimo ceno (orientacijsko 65–85 €/h). **Naročnina in AI krediti niso vključeni.**
|
||||
|
||||
## 5. Okvirna cena za posameznega dobavitelja
|
||||
|
||||
| Dobavitelj | Ocena priklopa | Pogoj |
|
||||
|---|---:|---|
|
||||
| **GROHE** | **0–99 €** | Če se uporabi že pripravljena CSV preslikava, le končna validacija in kratek prikaz. |
|
||||
| **EMOS** | **149–249 €** | Dostopen XML, EAN, slike, lastnosti, brez razvoja posebnega konektorja. |
|
||||
| **Sanotechnik** | **199–299 €** | Delujoč JSON endpoint in ustrezna preslikava kategorij/slik/polja SKU/EAN. |
|
||||
| **KOOPMAN** | **350–650 €** | Če je dostop do ustreznih produktnih podatkov, slik, modelov ter energetskih dokumentov; dodatno delo lahko ceno spremeni. |
|
||||
| **TRBOVC** | **450–950 €** | Splet + PDF: po pregledu strukture, dovoljene uporabe in možnosti samodejne ekstrakcije; drugače po uri ali novi ponudbi. |
|
||||
| **Groupe SEB** | **Po ogledu vira** | Najprej brezplačna kratka tehnična ocena, nato fiksna ponudba za dogovorjen obseg. |
|
||||
|
||||
**Predlog za to stranko:** najprej **brezplačni 30-minutni prikaz** in omejeni pilot. Nato **649 € za do tri standardne vire** (npr. že pripravljeni GROHE + EMOS + Sanotechnik, če so dostopni in preslikava zadostuje). KOOPMAN ter TRBOVC se ocenita posebej, če vključujeta neurejene dokumente, dodatno preverjanje ali spletno zajemanje. To ni avtomatska zaveza za kompletno obdelavo vseh dobaviteljev.
|
||||
|
||||
## 6. Redna naročnina – pomembna omejitev
|
||||
|
||||
**Po naročnikovem ceniku** so naročnine v USD, enkratna nastavitev pa je tu predlagana v EUR brez DDV.
|
||||
|
||||
- **Free:** $0/mesec; 50 SKU; 1 vir; **0 AI kreditov**.
|
||||
- **Starter:** $49/mesec; 100 SKU; 2 vira; 100 kreditov.
|
||||
- **Plus:** $199/mesec; 400 SKU; 3 viri; 400 kreditov.
|
||||
- **Growth:** $299/mesec; 1.200 SKU; 5 virov; 1.200 kreditov.
|
||||
- **Business:** $499/mesec; 4.000 SKU; 8 virov; 4.000 kreditov.
|
||||
- **Scale:** $999/mesec; 12.000 SKU; 12 virov; 12.000 kreditov.
|
||||
- **Enterprise:** ponudba po meri; veljajo pogodbeno dogovorjeni pogoji.
|
||||
|
||||
Če ostane vseh **pet virov** (GROHE, EMOS, Sanotechnik, KOOPMAN, TRBOVC), je Growth najnižji od prikazanih paketov z dovolj velikim številom virov **pod pogojem, da je izbranih največ 1.200 SKU**. Z Groupe SEB bi bilo virov šest, zato bi bil med prikazanimi standardnimi paketi potreben najmanj Business (in največ 4.000 SKU). Končni paket določimo šele po prejemu seznama EAN. Letni način obračuna je ločen od mesečnega; pred ponudbo potrdimo aktualen cenik.
|
||||
|
||||
## 7. Vprašanja in dogovor ob koncu (5 min)
|
||||
|
||||
- Koliko **unikatnih EAN-ov** je na seznamu in koliko izdelkov je dejansko v prodaji?
|
||||
- Kateri dobavitelji morajo v prvi fazi delovati in kako pogosto je potrebna sinhronizacija?
|
||||
- Kateri jeziki so obvezni in ali želi naročnik AI besedila ali samo prenos obstoječih podatkov?
|
||||
- Katera polja mora trgovina prejeti v izvozu (EAN, naziv, opis HTML, specifikacije, slike, meta naslov/opis, oznake)?
|
||||
- Ali so na voljo potrebna dovoljenja za pridobivanje podatkov, dostopi in energetske listine?
|
||||
- Dogovor: priprava pilota na 5–10 EAN-ih, potrditev izvoznega vzorca, nato pisna ponudba in rok za izbrane dobavitelje.
|
||||
|
||||
**Zaključni stavek:** »Predlagamo, da najprej skupaj preizkusimo nekaj vaših izdelkov od uvoza do končnega izvoza. Tako boste videli rezultat in ceno dejanske nastavitve še pred odločitvijo za večji projekt.«
|
||||
@@ -0,0 +1,72 @@
|
||||
# Descrybe public API
|
||||
|
||||
Production API: `https://api.descrybe.io/api/v1`
|
||||
Interactive reference: `https://descrybe.io/docs`
|
||||
OpenAPI YAML: `https://api.descrybe.io/api/v1/openapi.yaml`
|
||||
|
||||
## Authentication
|
||||
|
||||
Use a company API key from Settings → API keys. Team members with API Keys management permission can create keys. Send `Authorization: Bearer dk_...` (preferred) or `X-API-Key: dk_...`. Treat the secret as confidential; the full key is shown only when created. These are company-scoped public API endpoints, not dashboard session endpoints.
|
||||
|
||||
## Example requests
|
||||
|
||||
```bash
|
||||
curl -H 'Authorization: Bearer dk_YOUR_KEY' 'https://api.descrybe.io/api/v1/products?page=1&limit=25'
|
||||
curl -H 'Authorization: Bearer dk_YOUR_KEY' 'https://api.descrybe.io/api/v1/feeds'
|
||||
curl -X POST 'https://api.descrybe.io/api/v1/process' -H 'Authorization: Bearer dk_YOUR_KEY' -H 'Content-Type: application/json' -d '{"raw_product_ids":["YOUR_RAW_UUID"],"processing_type":"seo_meta"}'
|
||||
```
|
||||
|
||||
For `POST /products/process`, supply `items[].ean` and expect HTTP 200 with a `data` envelope. For `POST /process`, supply existing `raw_product_ids` and expect HTTP 202 with flat processing job details. `processing_types` is informational; **`processing_type` controls the execution mode**. `seo_meta` processes SEO metadata while keeping existing enhanced titles/descriptions. Multiple selected content outputs use the `enhance` mode.
|
||||
|
||||
## URL feeds
|
||||
|
||||
Feeds support XML, CSV, and JSON. For a public create call use `POST /feeds` with `name`, `url`, `feed_type`, and optional `item_path`. JSON object wrappers and XML record names can usually be detected during schema extraction; specify an item path if automatic detection does not find the right array. For protected URL sources or custom authorization headers, use the authenticated company dashboard feed configuration, which securely saves the secrets. The public feed-create JSON contract does not accept arbitrary secret headers.
|
||||
|
||||
Export feeds support XML, CSV and JSON, with a URL extension matching the saved format. For exports, create a template with `POST /export-feeds` and generate with `POST /export-feeds/{id}/generate`. The public download token must be handled like a secret.
|
||||
|
||||
## Registered endpoints
|
||||
|
||||
All paths below are relative to `/api/v1`, and are checked against the API router.
|
||||
|
||||
- `GET, POST /attributes`
|
||||
- `POST /attributes/create`
|
||||
- `PATCH, DELETE /attributes/{id}`
|
||||
- `GET /campaigns`
|
||||
- `POST /campaigns/prepare`
|
||||
- `GET, POST /categories`
|
||||
- `POST /categories/create`
|
||||
- `GET, PATCH, DELETE /categories/{id}`
|
||||
- `GET, POST /export-feeds`
|
||||
- `GET, PATCH, DELETE /export-feeds/{id}`
|
||||
- `POST /export-feeds/{id}/export-products`
|
||||
- `POST /export-feeds/{id}/generate`
|
||||
- `POST /export-feeds/{id}/rotate-token`
|
||||
- `PUT /export-feeds/{id}/template`
|
||||
- `GET, POST /feeds`
|
||||
- `GET, PATCH, DELETE /feeds/{id}`
|
||||
- `POST /feeds/{id}/extract-schema`
|
||||
- `GET, PUT /feeds/{id}/mappings`
|
||||
- `POST /feeds/{id}/sync`
|
||||
- `POST /feeds/{id}/sync-process-sample`
|
||||
- `GET /health`
|
||||
- `GET /marketing/calendar`
|
||||
- `POST /marketing/calendar/prepare`
|
||||
- `GET /openapi.yaml`
|
||||
- `POST, GET /process`
|
||||
- `GET /process/{id}`
|
||||
- `POST /process/{id}/cancel`
|
||||
- `POST /process/{id}/retry`
|
||||
- `POST /process/{id}/terminate`
|
||||
- `GET /products`
|
||||
- `POST /products/process`
|
||||
- `GET /products/process/{id}`
|
||||
- `GET /products/quality`
|
||||
- `POST /products/reset`
|
||||
- `GET, PATCH /products/{id}`
|
||||
|
||||
## Response handling
|
||||
|
||||
Public catalog and feed list/create routes generally use `data` (and `meta` for paginated lists). Processing jobs under `/process` use a flat job response instead. Do not interchange processed product `id` and `raw_product_id` for job starts. Handle 401 for invalid/revoked keys, 402 for plan/credit gates, 429 with `Retry-After` for throttled operations, and validation errors as documented per operation.
|
||||
|
||||
The dashboard has additional `/api/*` endpoints requiring a signed-in session and CSRF token. Two dashboard-only Team/Admin operations are included in the OpenAPI document for operator reference; **API keys cannot call them**.
|
||||
|
||||
Reference in new issue
Block a user