Procurize.AI REST API -viite#
Ohjelmallisesti pääset tietopohjaasi – asiakirjoihin, kyselylomakkeisiin, RAG:iin ja raportteihin – API-tunnisteellasi.
Koskee: Procurize.AI API v1
Todennus: API-avainX-API-Key-otsikon kautta (katso API Tokens tokenien hallintaan)
Perus-URL:https://api.procurize.com
Yleiskatsaus#
Procurize.AI REST API tarjoaa ohjelmallisen pääsyn alustan keskeisiin ominaisuuksiin. Se mahdollistaa Procurize.AI:n integroinnin sisäisiin järjestelmiisi, tietopohjan hallinnan automatisoinnin ja räätälöityjen työnkulkujen rakentamisen.
Tuetut moduulit (tunnuksella todennettu):
- RagArticle – hallitse asiakirjoja
- RagFaq – hallitse UKK-kohteita
- RagQuery – suorita RAG-kyselyitä
Todennus#
Kaikki todennetut päätepisteet vaativat API-tunnisteen, joka lähetetään pyynnön otsikossa.
| Otsake | Arvo |
|---|---|
X-API-Key | <YOUR_API_TOKEN> |
Esimerkki:
curl -X GET "https://api.procurize.com/v1/..." \
-H "X-API-Key: your-api-token-here"
💡 Tunnisteet on sidottu organisaatioosi – sinun ei tarvitse määrittää organisaatio-ID:tä pyynnössä .
Perus-URL#
Kaikki REST API -päätepisteet sijaitsevat:
https://api.procurize.com
Virheenkäsittely#
API käyttää standardi‑HTTP‑statuskoodeja.
| Koodi | Merkitys |
|---|---|
200 OK | Pyyntö onnistui |
201 Created | Resurssi luotu onnistuneesti |
204 No Content | Pyyntö onnistui, ei vastausrunkoa |
400 Bad Request | Virheellinen pyyntö tai virheelliset parametrit |
401 Unauthorized | Puuttuva tai virheellinen API-tunniste |
403 Forbidden | Tunnisteella ei ole oikeuksia tähän toimintaan |
404 Not Found | Resurssia ei löydy |
500 Internal Server Error | Odottamaton palvelinvirhe |
Virhevastaukset sisältävät koneellisesti luettavan virhekoodin ja ihmisluettavan viestin.
Moduuliviite#
RagArticle#
GET /questionnaire/rag/articles/summary#
Yhteenveto: Yhteenveto etusivulle
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| proj | query | string (uuid) | Ei | Projektin ID. |
Vastaus (200):
{
"active": 5
}
GET /questionnaire/rag/articles/total#
Yhteenveto: Artikkeleiden määrä
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| q | query | string | Ei | Suodata artikkelin nimen tai koodin perusteella. |
| state | query | array | Ei | Suodata tilojen perusteella. |
| project | query | array | Ei | Suodata projektien perusteella. |
| type | query | array | Ei | Suodata asiakirjatyypin perusteella. |
Vastaus (200):
42
GET /questionnaire/rag/articles/list#
Yhteenveto: Hae artikkelilista
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| q | query | string | Ei | Suodata artikkelin nimen tai koodin perusteella. |
| state | query | array | Ei | Suodata tilojen perusteella. |
| project | query | array | Ei | Suodata projektien perusteella. |
| type | query | array | Ei | Suodata asiakirjatyypin perusteella. |
| s | query | string | Ei | Lajittelukenttä. |
| asc | query | boolean | Ei | Nouseva lajittelu. |
| ps | query | integer (int32) | Ei | Sivun koko. |
| p | query | integer (int32) | Ei | Sivunumero (alkaen yhdestä). |
Vastaus (200):
{
"paging": {
"pageNumber": 1,
"pageSize": 10,
"total": 42,
"totalPages": 5
},
"items": [
{
"code": "ART-001",
"org": "00000000-0000-0000-0000-000000000000",
"id": "00000000-0000-0000-0000-000000000000",
"name": "Article Title",
"description": "Article description",
"documentTypes": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Type Name",
"plural": "Type Names",
"count": 5
}
],
"size": 150,
"revision": {
"id": "00000000-0000-0000-0000-000000000000",
"collectionId": "00000000-0000-0000-0000-000000000000",
"rev": 3,
"date": "2025-01-15T10:30:00Z",
"author": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"authorName": "John Doe",
"analysisSummary": {
"id": "00000000-0000-0000-0000-000000000000",
"initiator": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"created": "2025-01-15T10:30:00Z",
"state": "Completed",
"stateDate": "2025-01-15T10:35:00Z",
"stateDetails": "Analysis completed successfully",
"operationId": "op-12345"
}
},
"type": "Article",
"state": "Active",
"projects": [
"00000000-0000-0000-0000-000000000000"
],
"items": [
"00000000-0000-0000-0000-000000000000"
],
"isShared": false
}
]
}
POST /questionnaire/rag/file-to-md#
Yhteenveto: Palauttaa tiedoston Markdown-sisällön
Pyyntörunko (multipart/form-data):
{
"url": "https://example.com/file.pdf",
"file": "binary"
}
Vastaus (200):
"Markdown content from file"
POST /questionnaire/rag/article/create#
Yhteenveto: Luo artikkeli
Pyyntörunko (multipart/form-data):
{
"code": "ART-001",
"name": "Article Title",
"description": "Article description",
"content": "# Article Content\n\nThis is the article content.",
"url": "https://example.com/file.pdf",
"file": "binary"
}
Vastaus (200):
{
"code": "ART-001",
"org": "00000000-0000-0000-0000-000000000000",
"id": "00000000-0000-0000-0000-000000000000",
"name": "Article Title",
"description": "Article description",
"documentTypes": null,
"size": 150,
"revision": null,
"type": "Article",
"state": "Active",
"projects": null,
"items": null,
"isShared": false
}
GET /questionnaire/rag/article/check#
Yhteenveto: Tarkista artikkelin olemassaolo.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
Vastaus (200):
true
GET /questionnaire/rag/article-info#
Yhteenveto: Hae artikkelin tiedot koodin perusteella.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
Vastaus (200):
{
"code": "ART-001",
"org": "00000000-0000-0000-0000-000000000000",
"id": "00000000-0000-0000-0000-000000000000",
"name": "Article Title",
"description": "Article description",
"documentTypes": null,
"size": 150,
"revision": null,
"type": "Article",
"state": "Active",
"projects": null,
"items": null,
"isShared": false
}
GET /questionnaire/rag/article#
Yhteenveto: Hae artikkelin sisältö koodin perusteella
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
| format | query | string | Ei | Jos true, palauttaa HTML-sisällön vastausrunkoon. Muuten palauttaa artikkelin sisällön Markdown-muodossa. |
| split | query | boolean | Ei | Jos true, palauttaa sisällön RAG-elementtien mukaan jaoteltuna. |
| css | query | boolean | Ei | Jos true, palauttaa HTML/PDF-sisällön CSS-tyylien kanssa. |
Vastaus (200):
"# Article Title\n\nThis is the article content in Markdown format."
POST /questionnaire/rag/article#
Yhteenveto: Päivitä artikkelin metatiedot
Pyyntörunko:
{
"code": "ART-001",
"name": "Updated Article Title",
"description": "Updated description",
"projects": [
"00000000-0000-0000-0000-000000000000"
],
"documentTypes": [
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Type Name",
"plural": "Type Names"
}
],
"isShared": true,
"state": "Active"
}
Vastaus (200):
{}
DELETE /questionnaire/rag/article#
Yhteenveto: Poista artikkeli
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
GET /questionnaire/rag/article/pdf#
Yhteenveto: Hae artikkeli PDF-muodossa koodin perusteella
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
Vastaus (200):
(pdf binary)
GET /questionnaire/rag/article/content#
Yhteenveto: Hae artikkelin sisältö
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
Vastaus (200):
{
"content": "# Article Title\n\nContent here."
}
POST /questionnaire/rag/article/content#
Yhteenveto: Päivitä artikkelin sisältö
Pyyntörunko (multipart/form-data):
{
"code": "ART-001",
"content": "# Updated Content",
"file": "binary"
}
POST /questionnaire/rag/plural#
Yhteenveto: Hae substantiivin monikkomuoto
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| noun | query | string | Ei | Monikkomuotoon muutettava substantiivi. |
Vastaus (200):
{
"plural": "Articles"
}
POST /questionnaire/rag/article/find-types#
Yhteenveto: Analysoi artikkeli AI:n avulla ja palauta niiden tyypit
Pyyntörunko (multipart/form-data):
{
"code": "ART-001",
"content": "# Article Content"
}
Vastaus (200):
[
{
"plural": "Types"
}
]
POST /questionnaire/rag/article/format-with-ai#
Yhteenveto: Muotoile artikkelin sisältö AI:n avulla
Pyyntörunko (multipart/form-data):
{
"code": "ART-001",
"content": "# Article Content"
}
Vastaus (200):
{
"formattedContent": "# Formatted Article Content"
}
POST /questionnaire/rag/article/improve-on-suggestions#
Yhteenveto: Paranna asiakirjaa ehdotusten perusteella
Pyyntörunko (multipart/form-data):
{
"suggestions": [
{
"sectionTitle": "Introduction",
"suggestion": "Add more details here."
}
],
"code": "ART-001",
"content": "# Article Content"
}
Vastaus (200):
{
"improvedContent": "# Improved Content"
}
GET /questionnaire/rag/article/parts#
Yhteenveto: Palauttaa listan artikkelin osista
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | query | array | Kyllä | Artikkelin osien lista. |
Vastaus (200):
[
{
"id": "00000000-0000-0000-0000-000000000000",
"code": "part-1",
"title": "Introduction",
"orderNumber": 1,
"content": "Introduction content."
}
]
GET /questionnaire/rag/article/revisions#
Yhteenveto: Palauttaa listan artikkelin revisioista
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
Vastaus (200):
[
{
"id": "00000000-0000-0000-0000-000000000000",
"collectionId": "00000000-0000-0000-0000-000000000000",
"rev": 1,
"date": "2025-01-15T10:30:00Z",
"author": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"authorName": "John Doe",
"analysisSummary": {
"id": "00000000-0000-0000-0000-000000000000",
"initiator": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"created": "2025-01-15T10:30:00Z",
"state": "Completed",
"stateDate": "2025-01-15T10:35:00Z",
"stateDetails": "Analysis completed",
"operationId": "op-12345"
}
}
]
GET /questionnaire/rag/article/revisions/info/{id}#
Yhteenveto: Hae artikkelin revision tiedot
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | path | string (uuid) | Kyllä | Revision ID. |
Vastaus (200):
{
"id": "00000000-0000-0000-0000-000000000000",
"collectionId": "00000000-0000-0000-0000-000000000000",
"rev": 1,
"date": "2025-01-15T10:30:00Z",
"author": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"authorName": "John Doe",
"analysisSummary": {
"id": "00000000-0000-0000-0000-000000000000",
"initiator": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"created": "2025-01-15T10:30:00Z",
"state": "Completed",
"stateDate": "2025-01-15T10:35:00Z",
"stateDetails": "Analysis completed",
"operationId": "op-12345"
}
}
GET /questionnaire/rag/article/revisions/{id}#
Yhteenveto: Hae artikkelin revision sisältö
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | path | string (uuid) | Kyllä | Revision ID. |
Vastaus (200):
"# Article Revision Content\n\nPrevious version."
GET /questionnaire/rag/article/analyze#
Yhteenveto: Analysoi artikkelin sisältö AI:n avulla
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Artikkelin koodi. |
| rev | query | integer (int32) | Ei | Revision numero. |
| force | query | boolean | Ei | Pakota uuden analyysin luominen ja poista mahdollinen aikaisempi keskeneräinen analyysitulos, jos se on olemassa. |
Vastaus (200):
{
"id": "00000000-0000-0000-0000-000000000000",
"initiator": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"created": "2025-01-15T10:30:00Z",
"state": "Completed",
"stateDate": "2025-01-15T10:35:00Z",
"stateDetails": "Analysis completed",
"operationId": "op-12345"
}
GET /questionnaire/rag/article/analyze/{id}#
Yhteenveto: Hae artikkelin analyysitulokset
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | path | string (uuid) | Kyllä | Analyysi ID. |
Vastaus (200):
{
"id": "00000000-0000-0000-0000-000000000000",
"initiator": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"created": "2025-01-15T10:30:00Z",
"state": "Completed",
"stateDate": "2025-01-15T10:35:00Z",
"stateDetails": "Analysis completed",
"operationId": "op-12345",
"fragments": [
"fragment-1",
"fragment-2"
],
"ownInconcies": "Own inconsistencies found",
"ragInconcies": "RAG inconsistencies found",
"proposals": "Improvement proposals"
}
GET /questionnaire/rag/messages/list#
Yhteenveto: Listaa kaikki viestit
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | query | string (uuid) | Kyllä | RAG-kokoelman ID. |
| item | query | string (uuid) | Ei | RAG-kohteen ID. |
| message | query | string (uuid) | Ei | Viestin ID. |
| asc | query | boolean | Ei | Nouseva lajittelu. |
| ps | query | integer (int32) | Ei | Sivun koko. |
| p | query | integer (int32) | Ei | Sivunumero (alkaen yhdestä). |
Vastaus (200):
{
"paging": {
"pageNumber": 1,
"pageSize": 10,
"total": 5,
"totalPages": 1
},
"items": [
{
"id": "00000000-0000-0000-0000-000000000000",
"replyTo": null,
"questionnaire": null,
"section": null,
"question": null,
"ragCollection": "00000000-0000-0000-0000-000000000000",
"ragItem": "00000000-0000-0000-0000-000000000000",
"targetId": "00000000-0000-0000-0000-000000000000",
"targetType": "Question",
"targetNum": 1,
"author": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"text": "Message content",
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-15T10:30:00Z",
"replies": 0
}
]
}
POST /questionnaire/rag/messages/add#
Yhteenveto: Lisää uusi viesti
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | query | string (uuid) | Kyllä | RAG-kokoelman ID. |
| item | query | string (uuid) | Ei | RAG-kohteen ID. |
| message | query | string (uuid) | Ei | Viestin ID, johon vastataan. |
Pyyntörunko:
{
"text": "New message content"
}
Vastaus (200):
{
"id": "00000000-0000-0000-0000-000000000000",
"replyTo": null,
"questionnaire": null,
"section": null,
"question": null,
"ragCollection": "00000000-0000-0000-0000-000000000000",
"ragItem": "00000000-0000-0000-0000-000000000000",
"targetId": "00000000-0000-0000-0000-000000000000",
"targetType": "Question",
"targetNum": 1,
"author": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"text": "New message content",
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-15T10:30:00Z",
"replies": 0
}
POST /questionnaire/rag/message#
Yhteenveto: Päivitä olemassa oleva viesti
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| c | query | string (uuid) | Kyllä | RAG-kokoelman ID. |
| id | query | string (uuid) | Kyllä | Viestin ID. |
Pyyntörunko:
{
"text": "Updated message content"
}
Vastaus (200):
{
"id": "00000000-0000-0000-0000-000000000000",
"replyTo": null,
"questionnaire": null,
"section": null,
"question": null,
"ragCollection": "00000000-0000-0000-0000-000000000000",
"ragItem": "00000000-0000-0000-0000-000000000000",
"targetId": "00000000-0000-0000-0000-000000000000",
"targetType": "Question",
"targetNum": 1,
"author": {
"id": "user123",
"name": "John Doe",
"email": "john.doe@example.com",
"login": "johndoe",
"ra": true
},
"text": "Updated message content",
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-15T10:45:00Z",
"replies": 0
}
DELETE /questionnaire/rag/message#
Yhteenveto: Poista olemassa oleva viesti
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| id | query | string (uuid) | Kyllä | Viestin ID. |
Vastaus (200):
{}
RagFaq#
GET /questionnaire/rag/faq-collections/summary#
Yhteenveto: Yhteenveto etusivulle
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| proj | query | string (uuid) | Ei | Projektin ID. |
Vastaus (200):
{
"active": 3
}
GET /questionnaire/rag/faq-collections/total#
Yhteenveto: FAQ-kokoelmien määrä.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| q | query | string | Ei | Suodata kokoelman nimen tai koodin perusteella. |
| state | query | array | Ei | Suodata tilojen perusteella. |
| project | query | array | Ei | Suodata projektien perusteella. |
Vastaus (200):
3
GET /questionnaire/rag/faq-collections/list#
Yhteenveto: Hae lista FAQ-kokoelmista.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| q | query | string | Ei | Suodata kokoelman nimen tai koodin perusteella. |
| state | query | array | Ei | Suodata tilojen perusteella. |
| project | query | array | Ei | Suodata projektien perusteella. |
| s | query | string | Ei | Lajittelukenttä. |
| asc | query | boolean | Ei | Nouseva lajittelu. |
| ps | query | integer (int32) | Ei | Sivun koko. |
| p | query | integer (int32) | Ei | Sivunumero (alkaen yhdestä). |
Vastaus (200):
{
"paging": {
"pageNumber": 1,
"pageSize": 10,
"total": 3,
"totalPages": 1
},
"items": [
{
"code": "FAQ-001",
"org": "00000000-0000-0000-0000-000000000000",
"id": "00000000-0000-0000-0000-000000000000",
"name": "FAQ Collection",
"description": "FAQ collection description",
"documentTypes": null,
"size": 5,
"revision": null,
"type": "Faq",
"state": "Active",
"projects": null,
"items": null,
"isShared": false
}
]
}
GET /questionnaire/rag/faq-collections/find-items#
Yhteenveto: Etsi FAQ-kohteita.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| q | query | string | Kyllä | Suodata kysymyksen perusteella. |
| project | query | string (uuid) | Ei | Suodata projektin perusteella. |
| ps | query | integer (int32) | Ei | Sivun koko. |
| p | query | integer (int32) | Ei | Sivunumero (alkaen yhdestä). |
Vastaus (200):
{
"paging": {
"pageNumber": 1,
"pageSize": 10,
"total": 5,
"totalPages": 1
},
"items": [
{
"index": 0,
"question": "What is this product?",
"answer": "This is a great product.",
"comment": "Product FAQ",
"state": "Active"
}
]
}
POST /questionnaire/rag/faq-collection/create#
Yhteenveto: Luo uusi FAQ-kokoelma.
Pyyntörunko (multipart/form-data):
{
"code": "FAQ-001",
"name": "FAQ Collection",
"description": "FAQ collection description",
"content": "Content here",
"file": "binary"
}
Vastaus (200):
{
"code": "FAQ-001",
"id": "00000000-0000-0000-0000-000000000000",
"name": "FAQ Collection",
"description": "FAQ collection description",
"documentTypes": null,
"size": 5,
"revision": null,
"type": "Faq",
"state": "Active",
"projects": null,
"items": null,
"isShared": false
}
POST /questionnaire/rag/faq-collection#
Yhteenveto: Päivitä FAQ-kokoelman metatiedot.
Pyyntörunko:
{
"code": "FAQ-001",
"name": "Updated FAQ Collection",
"description": "Updated description",
"projects": null,
"documentTypes": null,
"isShared": false,
"state": "Active"
}
DELETE /questionnaire/rag/faq-collection#
Yhteenveto: Poista FAQ-kokoelma.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
GET /questionnaire/rag/faq-collection#
Yhteenveto: Hae FAQ-kokoelma.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
Vastaus (200):
{
"code": "FAQ-001",
"org": "00000000-0000-0000-0000-000000000000",
"id": "00000000-0000-0000-0000-000000000000",
"name": "FAQ Collection",
"description": "FAQ collection description",
"documentTypes": null,
"size": 5,
"revision": null,
"type": "Faq",
"state": "Active",
"projects": null,
"items": null,
"isShared": false
}
GET /questionnaire/rag/faq-collection/check#
Yhteenveto: Tarkista FAQ-kokoelman olemassaolo.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
Vastaus (200):
true
GET /questionnaire/rag/faq-collection/items-total#
Yhteenveto: FAQ-kohteiden määrä.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
| q | query | string | Ei | Suodata FAQ-kohteen sisällön perusteella. |
Pyyntörunko:
["Active", "Default"]
Vastaus (200):
5
GET /questionnaire/rag/faq-collection/items#
Yhteenveto: Hae lista FAQ-kohteista.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
| q | query | string | Ei | Suodata FAQ-kohteen sisällön perusteella. |
| state | query | array | Ei | Suodata tilojen perusteella. |
| s | query | string | Ei | Lajittelukenttä. |
| asc | query | boolean | Ei | Nouseva lajittelu. |
| ps | query | integer (int32) | Ei | Sivun koko. |
| p | query | integer (int32) | Ei | Sivunumero (alkaen yhdestä). |
Vastaus (200):
{
"paging": {
"pageNumber": 1,
"pageSize": 10,
"total": 5,
"totalPages": 1
},
"items": [
{
"index": 0,
"question": "What is this product?",
"answer": "This is a great product.",
"comment": "Product FAQ",
"state": "Active"
}
]
}
POST /questionnaire/rag/faq-collection/item/create#
Yhteenveto: Luo uusi FAQ-kohde.
Pyyntörunko:
{
"code": "FAQ-001",
"index": 0,
"question": "What is this product?",
"answer": "This is a great product.",
"comment": "Product FAQ",
"state": "Active"
}
Vastaus (200):
{
"index": 0,
"question": "What is this product?",
"answer": "This is a great product.",
"comment": "Product FAQ",
"state": "Active"
}
GET /questionnaire/rag/faq-collection/item#
Yhteenveto: Hae FAQ-kohde.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
| index | query | integer (int32) | Kyllä | Nollapohjainen indeksi FAQ-kohteelle kokoelmassa. |
Vastaus (200):
{
"index": 0,
"question": "What is this product?",
"answer": "This is a great product.",
"comment": "Product FAQ",
"state": "Active"
}
POST /questionnaire/rag/faq-collection/item#
Yhteenveto: Päivitä FAQ-kohde.
Pyyntörunko:
{
"code": "FAQ-001",
"index": 0,
"newIndex": 1,
"question": "Updated question?",
"answer": "Updated answer.",
"comment": "Updated comment",
"state": "Active"
}
DELETE /questionnaire/rag/faq-collection/item#
Yhteenveto: Poista FAQ-kohde.
Parametrit:
| Nimi | Sijainti | Tyyppi | Pakollinen | Kuvaus |
|---|---|---|---|---|
| code | query | string | Kyllä | Kokoelman koodi. |
| index | query | integer (int32) | Kyllä | Nollapohjainen indeksi FAQ-kohteelle kokoelmassa. |
RagQuery#
POST /questionnaire/rag/query#
Yhteenveto: Suorita kysely RAG-tietopohjassa
Pyyntörunko:
{
"project": "00000000-0000-0000-0000-000000000000",
"excludeCollections": [
"00000000-0000-0000-0000-000000000000"
],
"question": "What is this product?",
"yourCompanyName": "Acme Corp",
"yourCompanyAlias": "Acme",
"customerName": "John Doe",
"options": [
"option1",
"option2"
],
"multiselect": false,
"nArticles": 5,
"nFaqs": 3,
"threshold": 0.5,
"debug": false,
"withJustification": true,
"withConfidenceLevel": true,
"withFragments": true,
"nAttempts": 3
}
Vastaus (200):
{
"attempt": 1,
"preparedQuery": {
"original": "What is this product?",
"enhanced": "What is this product and its features?"
},
"ragItems": [
{
"id": "00000000-0000-0000-0000-000000000000",
"distance": 0.25
}
],
"question": "What is this product?",
"generalInstructions": "Based on the knowledge base, here is the answer:",
"text": "This product is a great solution for your needs.",
"explanation": "The answer was found in multiple sources with high confidence."
}
POST /questionnaire/rag/query-stream#
Yhteenveto: Suorita kysely RAG-tietopohjassa
Pyyntörunko:
{
"project": "00000000-0000-0000-0000-000000000000",
"excludeCollections": [
"00000000-0000-0000-0000-000000000000"
],
"question": "What is this product?",
"yourCompanyName": "Acme Corp",
"yourCompanyAlias": "Acme",
"customerName": "John Doe",
"options": [
"option1",
"option2"
],
"multiselect": false,
"nArticles": 5,
"nFaqs": 3,
"threshold": 0.5,
"debug": false,
"withJustification": true,
"withConfidenceLevel": true,
"withFragments": true,
"nAttempts": 3
}
Vastaus (200):
[
{
"text": "This product is a great solution",
"fragments": [
{
"id": "00000000-0000-0000-0000-000000000000",
"part": 1,
"distance": 0.25,
"type": "Article",
"code": "ART-001",
"title": "Product Title",
"fragment": "Product content fragment"
}
]
},
{
"text": " for your needs.",
"fragments": []
}
]
POST /questionnaire/rag/query-fragments#
Yhteenveto: Suorita kysely RAG-tietopohjassa
Pyyntörunko:
{
"project": "00000000-0000-0000-0000-000000000000",
"exclude_documents": [
"00000000-0000-0000-0000-000000000000"
],
"query": "What is this product?",
"top_k": 5,
"similarity_threshold": 0.5,
"prepare_query": true
}
Vastaus (200):
{
"results": [
{
"document_id": "00000000-0000-0000-0000-000000000000",
"document_code": "ART-001",
"document_title": "Product Title",
"revision": 3,
"chunk_index": 0,
"content": "Product content fragment",
"metadata": {
"author": "John Doe",
"created_at": "2025-01-15T10:30:00Z",
"last_updated_at": "2025-01-15T10:35:00Z",
"doc_categories": [
"Product",
"Information"
]
},
"similarity_score": 0.85
}
]
}
Aiheeseen liittyvät artikkelit#
- API-tunnisteet – Luominen & Hallinta – miten luodaan ja hallitaan tunnisteita
- Kysy AI:lta tietopohjasi avulla – RAG-kyselyiden käyttö
