plate-api

A connector to the Plate API. It takes care of the authentication procedure. It also provides a basic wrapper around the Plate API, so objects in Plate can be manipulated as local objects.

Usage no npm install needed!

<script type="module">
  import plateApi from 'https://cdn.skypack.dev/plate-api';
</script>

README

Plate API

npm version Build Status install size

Welcome to the Node Plate Api package for Node.js

Installation:

npm install --save plate-api

Usage

To initialize an instance of the PlateAPI:

PlateApi = require("plate-api");

// Replace 'publickey' and 'secretkey' with the keys of your API integration.
plateApi = new PlateApi("publickey", "secretkey")

To make a request:

plateApi.sendRequest(
  "POST",
  "/site_translations/471/posts",
  {
    content_type_id: 11373,
    title: "An API Page!",
    slug: "a-slug-for-api"
  }
).then(
  function (response) {
    console.log("Successful response");
    console.log(response.body);
  },
  function (response) {
    console.log("Error response");
    console.log(response.body);
  }
)