Sync Open Api document
0 min
{ "id" "ajbc7cnfz32lb0psg1k s", "type" "api oas v2", "data" { "method" "post", "url" " https //api archbee com/api/public api/sync api reference https //api archbee com/api/public api/sync api reference ", "servers" \[ { "url" " https //api archbee com/api/public api/sync api reference https //api archbee com/api/public api/sync api reference ", "description" "archbee api server" } ], "name" "sync open api document", "description" "sync open api document with a new or existing open api tree", "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" "optional", "name" "doctreeid", "type" "string", "example" "21 character string0", "description" " optional, main category id where open api was imported; if undefined, a new doctree is created and its id is returned ", "default" "21 character string0" }, { "kind" "required", "name" "file", "type" "file", "example" "upload file", "description" " open api file, json or yml or yaml or zip ", "default" "@swagger json" }, { "kind" "optional", "name" "type", "type" "string\<openapi | postman>", "example" "openapi", "description" "type of import file default openapi", "default" "openapi" }, { "kind" "optional", "name" "openapitryit", "type" "string\<true | false>", "example" true, "description" "optional you can now test your api's directly in the editor or on your published docs with the new api try it!", "default" true }, { "kind" "optional", "name" "showdownloadopenapifile", "type" "string\<true | false>", "example" true, "description" " optional you can show/hide the download link of the imported open api file in the open api tree ", "default" false }, { "kind" "optional", "name" "shouldcreateschemacategory", "type" "string\<true | false>", "example" true, "description" "optional you can create models category to display all your models ", "default" false }, { "kind" "optional", "name" "shouldcreateintro", "type" "string\<true | false>", "example" true, "description" "optional you can create an additional document to display open api intro ", "default" false }, { "kind" "optional", "name" "openapilanguageexamples", "type" "list", "example" "\["python","r","javascript"]", "description" "optional add your custom language examples maximum 5 programming language examples are allowed!" } ], "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" "doctreeid", "kind" "optional", "type" "string", "description" "returned created/updated open api tree structure ", "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" "s1w3ma9bne fnnp6qkxtt", "language" "curl", "label" "curl", "code" "curl request post \\\n url https //api archbee com/api/public api/sync api reference https //api archbee com/api/public api/sync api reference \\\n header 'accept application/json' \\\n header 'content type multipart/form data' \\\n form 'doctreeid="21 character string0"' \\\n form 'file="@swagger json"' \\\n form 'type="openapi"' \\\n form 'openapitryit="true"' \\\n form 'showdownloadopenapifile="true"' \\\n form 'shouldcreateschemacategory="true"' \\\n form 'shouldcreateintro="true"'" }, { "id" "x9zzdpvib7h42ndam kg6", "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("doctreeid", "21 character string0");\nformdata append("file", "@swagger json");\nformdata append("type", "openapi");\nformdata append("openapitryit", "true");\nformdata append("showdownloadopenapifile", "true");\nformdata append("shouldcreateschemacategory", "true");\nformdata append("shouldcreateintro", "true");\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/sync api reference https //api archbee com/api/public api/sync api reference ", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));" }, { "id" "lnoe8f4lojhuplsvr9sz6", "language" "ruby", "label" "ruby", "code" "require "uri"\nrequire "net/http"\n\nurl = uri(" https //api archbee com/api/public api/sync api reference")\n\nhttps https //api archbee com/api/public api/sync api reference")\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 = \[\['doctreeid', file open('undefined')],\['file', file open('undefined')],\['type', file open('undefined')],\['openapitryit', file open('undefined')],\['showdownloadopenapifile', file open('undefined')],\['shouldcreateschemacategory', file open('undefined')],\['shouldcreateintro', file open('undefined')]]\nrequest set form form data, 'multipart/form data'\nresponse = https request(request)\nputs response read body\n" }, { "id" "3amlfcr8tvmt3cyukysjn", "language" "python", "label" "python", "code" "import requests\n\nurl = " https //api archbee com/api/public api/sync api reference"\n\npayload https //api archbee com/api/public api/sync api reference"\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" "s1w3ma9bne fnnp6qkxtt" }, "results" { "languages" \[ { "id" "4xe6olarwtrpao4as2jl9", "language" "200", "code" "// import ok status\n{\n "status" "ok",\n "data" {\n "doctreeid" "21 character string0"\n }\n}" }, { "id" "06yfcljaeb4a12s4291xv", "language" "400", "code" "// invalid request\n{\n "status" "not ok",\n "messages" \[\n "some error message"\n ]\n}" } ], "selectedlanguageid" "4xe6olarwtrpao4as2jl9" } }, "children" \[ { "text" "" } ] }