Search document
0 min
{ "id" "6 2rmwtaghqu cur8x1lk", "type" "api oas v2", "data" { "method" "post", "url" " https //api archbee com/api/public api/docs/search https //api archbee com/api/public api/docs/search ", "servers" \[ { "url" " https //api archbee com/api/public api/docs/search https //api archbee com/api/public api/docs/search ", "description" "archbee api server" } ], "name" "search document", "description" " search archbee documents in docspace can perform one of the 3 types of search \n \n ai chat to return ai generative answer accompanied by source docs; \n ai retrieval to return just similar docs with the query; \n words to perform normal search aka "word based"; use empty query to return all docs \n single doc to return document info by id \n ", "contenttype" "application/json", "request" { "pathparameters" \[], "headerparameters" \[ { "kind" "required", "name" "content type", "type" "string", "example" "application/json", "description" "" } ], "queryparameters" \[], "bodydataparameters" \[ { "kind" "required", "name" "body", "type" "object", "description" "", "schema" \[ { "name" "query", "kind" "required", "type" "string", "description" "filter text, question or document title", "example" "" }, { "name" "searchonlytitle", "kind" "optional", "type" "boolean", "description" "optional search only by title", "example" "" }, { "name" "persistsearch", "kind" "optional", "type" "boolean", "description" "optional wether to keep a searchsession in our database and return its id ", "example" "" }, { "name" "searchsessionid", "kind" "optional", "type" "string", "description" "optional id for the searchsession object to update more useful for ai chat ", "example" "" }, { "name" "docid", "kind" "optional", "type" "string", "description" "optional return only one document with this id, if there is one", "example" "21 character string0" }, { "name" "datatextformat", "kind" "optional", "type" "string\<markdown | html>", "description" "optional return documents with datatext in this format", "example" "" }, { "name" "parentdocid", "kind" "optional", "type" "string", "description" "optional return only child documents of the doc with this id, if there are any can be "null" for retrieving the root docs ", "example" "21 character string0" }, { "name" "type", "kind" "optional", "type" "string\<words | ai chat | ai retrieval>", "description" "optional which type of search to use; default is word based", "example" "" } ], "isexpanded" true } ], "formdataparameters" \[], "oauthparameters" \[ { "id" "bearerauth", "name" "bearerauth", "kind" "optional", "type" "http", "description" " requires the authorization header in the form authorization bearer {base64(docspaceid apikey)} where the token is base64 encoding of docspaceid, tilde, and apikey ", "scheme" "bearer" } ] }, "responses" \[ { "statuscode" "200", "description" "process status", "jsonexample" "", "isexpanded" true, "schema" \[ { "kind" "optional", "type" "object", "description" "process status", "schema" \[ { "name" "status", "kind" "optional", "type" "string ", "description" "response status", "example" "" }, { "name" "data", "kind" "optional", "type" "object", "description" "response data", "example" "", "schema" \[ { "name" "searchsessionid", "kind" "optional", "type" "string", "description" "search session id, can be used as input for next search calls ", "example" "" }, { "name" "docs", "kind" "optional", "type" "array", "description" "array of doc responses", "modelref" "#/components/schemas/docresponse", "customtype" "docresponse\[]", "schema" \[ { "name" "id", "kind" "optional", "type" "string", "description" "archbee id, used for private access", "example" "" }, { "name" "name", "kind" "optional", "type" "string", "description" "name of document", "example" "" }, { "name" "urlkey", "kind" "optional", "type" "string", "description" "url of public document, used for public access (if published)", "example" "" }, { "name" "urlalias", "kind" "optional", "type" "string", "description" "in case you are migrating from another platform and you’d like to get a redirecting url to your current url, you can use this url path ", "example" "" }, { "name" "hidden", "kind" "optional", "type" "boolean", "description" "indicates if document is hidden", "example" "" }, { "name" "privacy", "kind" "optional", "type" "string\<private | shared with team | public via link | public>", "description" "describes how to access the document via public url (if published)", "example" "" }, { "name" "highlight", "kind" "optional", "type" "object", "description" "text from document, similar with query (word based search only)", "example" "", "schema" \[] } ] } ] } ], "isexpanded" true } ] }, { "statuscode" "400", "description" "invalid request", "jsonexample" "", "isexpanded" true, "schema" \[ { "kind" "optional", "type" "object", "description" "", "customtype" "response400", "schema" \[ { "name" "status", "kind" "optional", "type" "string\<ok | not ok>", "description" "response status", "example" "not ok" }, { "name" "messages", "kind" "optional", "type" "array", "description" "array of messages", "example" "\["some error message"]", "itemtype" "string", "customtype" "string\[]", "itemexample" "some error message", "itemdefault" "" } ], "modelref" "#/components/schemas/response400", "isexpanded" true } ] } ], "hasxcodesamples" false, "examples" { "languages" \[ { "id" "e9cbtzhnynmksn4zr9trf", "language" "curl", "label" "curl", "code" "curl request post \\\n url https //api archbee com/api/public api/docs/search https //api archbee com/api/public api/docs/search \\\n header 'accept application/json' \\\n header 'content type application/json' \\\n data '{\n "query" ""\n }'" }, { "id" " kxgr4vvwm1 2da3vyboq", "language" "javascript", "label" "javascript", "code" "var myheaders = new headers();\nmyheaders append("accept", "application/json");\nmyheaders append("content type", "application/json");\n\nvar raw = json stringify({\n "query" ""\n});\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(" https //api archbee com/api/public api/docs/search https //api archbee com/api/public api/docs/search ", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));" }, { "id" "3xzwzuvtgjr4m8v2tn2ku", "language" "ruby", "label" "ruby", "code" "require "uri"\nrequire "json"\nrequire "net/http"\n\nurl = uri(" https //api archbee com/api/public api/docs/search")\n\nhttps https //api archbee com/api/public api/docs/search")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\["accept"] = "application/json"\nrequest\["content type"] = "application/json"\nrequest body = json dump({\n "query" ""\n})\n\nresponse = https request(request)\nputs response read body\n" }, { "id" "hcfh kh8yylfj374io5q ", "language" "python", "label" "python", "code" "import requests\nimport json\n\nurl = " https //api archbee com/api/public api/docs/search"\n\npayload https //api archbee com/api/public api/docs/search"\n\npayload = json dumps({\n "query" ""\n})\nheaders = {\n 'accept' 'application/json',\n 'content type' 'application/json'\n}\n\nresponse = requests request("post", url, headers=headers, data=payload)\n\nprint(response text)\n" } ], "selectedlanguageid" "e9cbtzhnynmksn4zr9trf" }, "results" { "languages" \[ { "id" "e7kk2ctumupv6qfhhc2pe", "language" "200", "code" "// process status\n{\n "status" "",\n "data" {\n "searchsessionid" "",\n "docs" \[\n {\n "id" "",\n "name" "",\n "urlkey" "",\n "urlalias" "",\n "hidden" false,\n "privacy" "",\n "highlight" {}\n }\n ]\n }\n}" }, { "id" "uw3dl lzsw9qqo97sn0s7", "language" "400", "code" "// invalid request\n{\n "status" "not ok",\n "messages" \[\n "some error message"\n ]\n}" } ], "selectedlanguageid" "e7kk2ctumupv6qfhhc2pe" } }, "children" \[ { "text" "" } ] }