Import Content
0 min
{ "id" "efjlajsbdq8edic7j5t2q", "type" "api oas v2", "data" { "method" "post", "url" " https //api archbee com/api/public api/import content https //api archbee com/api/public api/import content ", "servers" \[ { "url" " https //api archbee com/api/public api/import content https //api archbee com/api/public api/import content ", "description" "archbee api server" } ], "name" "import content", "description" " create new doc from imported markdown file in case of zip file, create a new doctree and keeps archived tree structure ", "contenttype" "application/json", "request" { "pathparameters" \[], "headerparameters" \[ { "kind" "required", "name" "content type", "type" "string", "example" "multipart/form data", "description" "", "default" "multipart/form data" } ], "queryparameters" \[], "bodydataparameters" \[], "formdataparameters" \[ { "kind" "required", "name" "file", "type" "file", "example" "upload file", "description" " markdown file ( md) or archive ( zip) containing multiple markdown files ", "default" "@markdowns zip" }, { "kind" "optional", "name" "type", "type" "string ", "example" "markdown", "description" "type of import file only markdown supported for now on this route ", "default" "markdown" } ], "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" "import ok status", "jsonexample" "", "isexpanded" true, "schema" \[ { "kind" "optional", "type" "object", "description" "import ok status", "schema" \[ { "name" "status", "kind" "optional", "type" "string ", "description" "response status", "example" "ok" }, { "name" "data", "kind" "optional", "type" "object", "description" "", "example" "", "schema" \[ { "name" "docid", "kind" "optional", "type" "string", "description" "created doc id (first doc in case of archive tree) ", "example" "21 character string0" } ] } ], "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" "mtcmfh3lqefp6v1nolfi0", "language" "curl", "label" "curl", "code" "curl request post \\\n url https //api archbee com/api/public api/import content https //api archbee com/api/public api/import content \\\n header 'accept application/json' \\\n header 'content type multipart/form data' \\\n form 'file="@markdowns zip"' \\\n form 'type="markdown"'" }, { "id" "knzwbl4k5qk 1 fzpguxk", "language" "javascript", "label" "javascript", "code" "var myheaders = new headers();\nmyheaders append("accept", "application/json");\nmyheaders append("content type", "multipart/form data");\n\nvar formdata = new formdata();\nformdata append("file", "@markdowns zip");\nformdata append("type", "markdown");\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body formdata,\n redirect 'follow'\n};\n\nfetch(" https //api archbee com/api/public api/import content https //api archbee com/api/public api/import content ", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));" }, { "id" "dqngsw7zpnaym99tqp0g4", "language" "ruby", "label" "ruby", "code" "require "uri"\nrequire "net/http"\n\nurl = uri(" https //api archbee com/api/public api/import content")\n\nhttps https //api archbee com/api/public api/import content")\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"] = "multipart/form data"\nform data = \[\['file', file open('undefined')],\['type', file open('undefined')]]\nrequest set form form data, 'multipart/form data'\nresponse = https request(request)\nputs response read body\n" }, { "id" "adscvrdiu2 jxjvqhmzme", "language" "python", "label" "python", "code" "import requests\n\nurl = " https //api archbee com/api/public api/import content"\n\npayload https //api archbee com/api/public api/import content"\n\npayload = {}\nfiles=\[\n\n]\nheaders = {\n 'accept' 'application/json',\n 'content type' 'multipart/form data'\n}\n\nresponse = requests request("post", url, headers=headers, data=payload, files=files)\n\nprint(response text)\n" } ], "selectedlanguageid" "mtcmfh3lqefp6v1nolfi0" }, "results" { "languages" \[ { "id" "vdkpvahtrjerhyv h4obk", "language" "200", "code" "// import ok status\n{\n "status" "ok",\n "data" {\n "docid" "21 character string0"\n }\n}" }, { "id" "wtkkjnthefgi6mc4raf f", "language" "400", "code" "// invalid request\n{\n "status" "not ok",\n "messages" \[\n "some error message"\n ]\n}" } ], "selectedlanguageid" "vdkpvahtrjerhyv h4obk" } }, "children" \[ { "text" "" } ] }