jQuery Plugin for Publitio API
Switch branches/tags
Nothing to show
Clone or download
Latest commit b5c80fa Jan 25, 2018
Permalink
Failed to load latest commit information.
src Initial commit Jan 23, 2018
.gitignore Initial commit Jan 23, 2018
.npmignore Initial commit Jan 23, 2018
README.md small commit Jan 25, 2018
examples.js small commit Jan 25, 2018
package-lock.json Initial commit Jan 23, 2018
package.json 1.0.1 Jan 25, 2018

README.md

Publitio jQuery SDK


Description

Simple jQuery Plugin for Publitio API


Requirements

This Plugin is dependent on jQuery and CryptoJS. For obvious reasons it needs to be loaded after jQuery and CryptoJS, otherwise it won't work.


Instalation

Using npm:
$ npm install publitio_jquery_plugin --save
Using yarn:

$ yarn add publitio_jquery_plugin


Usage

<!-- Your jQuery script-->
<script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
<!-- Your CryptoJS CDN script -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
<!-- Or if you use the npm package for CryptoJS
<script src="./node_modules/crypto-js/crypto-js.js"></script> -->
<!-- Include Publitio jQuery Plugin script-->
<script src="node_modules/publitio_jquery_sdk/dist/publitio.js"></script>
$(document).ready(() => {

	// xxxx => YOUR API_KEY
	// yyyy => YOUR API_SECRET
	$.publitio.init('xxxx', 'yyyy')

})

Sample api call to list files:

// list files
$.publitio.call('/files/list', 'GET', { offset: '0', limit: '10' })
	.then((data) => { console.log(data) })
    .catch((error) => { console.log(error) })

See examples.js file for full list of available classes, methods and options, or check the official docs on Publitio Docs