{"openapi":"3.0.0","info":{"title":"Polyblog API","version":"1.0.0"},"servers":[{"url":"https://www.polyblog.io"}],"paths":{"/articles":{"get":{"summary":"get articles","description":"returns an array of articles","parameters":[{"in":"query","name":"blogId","required":true,"schema":{"type":"string"}},{"in":"query","name":"locale","schema":{"type":"string"}},{"in":"query","name":"published","schema":{"type":"boolean"}},{"in":"query","name":"slug","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":0}},{"in":"query","name":"skip","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"A list of articles","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"blogId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"content":{"type":"string"},"slug":{"type":"string"},"locale":{"type":"string"},"coverUrl":{"type":"string"},"published":{"type":"boolean"},"creationTime":{"type":"string","format":"date-time"},"lastEditTime":{"type":"string","format":"date-time"}}}}}}}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://www.polyblog.io/articles',\n  qs: {\n    blogId: 'SOME_STRING_VALUE',\n    locale: 'SOME_STRING_VALUE',\n    published: 'SOME_BOOLEAN_VALUE',\n    slug: 'SOME_STRING_VALUE',\n    limit: 'SOME_INTEGER_VALUE',\n    skip: 'SOME_INTEGER_VALUE'\n  }\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://www.polyblog.io/articles?blogId=SOME_STRING_VALUE&locale=SOME_STRING_VALUE&published=SOME_BOOLEAN_VALUE&slug=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE'"},{"lang":"Shell + Httpie","source":"http GET 'https://www.polyblog.io/articles?blogId=SOME_STRING_VALUE&locale=SOME_STRING_VALUE&published=SOME_BOOLEAN_VALUE&slug=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"www.polyblog.io\")\n\nconn.request(\"GET\", \"/articles?blogId=SOME_STRING_VALUE&locale=SOME_STRING_VALUE&published=SOME_BOOLEAN_VALUE&slug=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\")\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://www.polyblog.io/articles?blogId=SOME_STRING_VALUE&locale=SOME_STRING_VALUE&published=SOME_BOOLEAN_VALUE&slug=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://www.polyblog.io/articles');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'blogId' => 'SOME_STRING_VALUE',\n  'locale' => 'SOME_STRING_VALUE',\n  'published' => 'SOME_BOOLEAN_VALUE',\n  'slug' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://www.polyblog.io/articles');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'blogId' => 'SOME_STRING_VALUE',\n  'locale' => 'SOME_STRING_VALUE',\n  'published' => 'SOME_BOOLEAN_VALUE',\n  'slug' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]));\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/blogs":{"get":{"summary":"get blog details","description":"returns a blog details","parameters":[{"in":"path","name":"blogId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"blog details","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"coverUrl":{"type":"string"},"creationTime":{"type":"string","format":"date-time"},"lastEditTime":{"type":"string","format":"date-time"},"locales":{"type":"array","items":{"type":"string"}}}}}}}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {method: 'GET', url: 'https://www.polyblog.io/blogs'};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://www.polyblog.io/blogs"},{"lang":"Shell + Httpie","source":"http GET https://www.polyblog.io/blogs"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"www.polyblog.io\")\n\nconn.request(\"GET\", \"/blogs\")\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://www.polyblog.io/blogs\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://www.polyblog.io/blogs');\n$request->setMethod(HTTP_METH_GET);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://www.polyblog.io/blogs');\n$request->setRequestMethod('GET');\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}}},"components":{},"tags":[]}