GithubHelp home page GithubHelp logo

gliffy's Introduction

Gliffy API wrapper

Gem Version Code Climate Bitdeli Badge

Basic usage

Initialization

api = Gliffy::API.new(ACCOUNT_ID, API_KEY, API_SECRET)
api.impersonate('[email protected]')
api.account.root.documents

Working with documents

doc = account.document(DOCUMENT_ID)

doc.name
doc.rename("NEW NAME")

doc.editor(RETURN_TO, RETURN_BUTTON_TEXT)

doc.delete

doc.public?
doc.public = false

Download document as PNG

doc.png.full
doc.png.medium
doc.png.small
doc.png.thumbnail

Obtain a link to the PNG

doc.png_url 'L' # Large (original) size

Download document as SVG

doc.svg.content

Download document as XML

doc.xml.content

Working with folders

root = account.root
root.folders[0].documents
root.folders[1].name
root.folders[1].path

folder.delete

folder.users
folder.grant_access(user)
folder.revoke_access(user)

Users

account.users

account.users[0].username
account.users[1].email

account.create_user("john-smith")

user.email = "[email protected]"
user.password = "new-password"
user.admin = true

user.accessible_folders

Command-line client

Authenticating yourself to gliffy API

CLI client looks for credentials in ~/.gliffy-cli file by default. It is a YAML file with a following simple structure:

gliffy:
  account: <YOUR ACCOUNT ID>
  oauth:
    consumer_key: <YOUR OAUTH CONSUMER KEY>
    consumer_secret: <YOUR OAUTH CONSUMER SECRET>

An alternative ways to specify API credentials are:

  • use --credentials flag
gliffy-cli --credentials <PATH TO CREDENTIALS FILE> ...
  • use --account-id, --consumer-key and --consumer-secret flags
gliffy-cli --account-id <ID> --consumer-key <KEY> --consumer-secret <SECRET> ...

The next step is to impersonate an user:

gliffy-cli ... --user <USERNAME> ...

Keep in mind that new users are provisioned automatically, so if <USERNAME> does not exists, it will be created for you by Gliffy.

List of available commands:

  • user add <USERNAME>
  • user delete <USERNAME>
  • user list
  • user update email <USERNAME>
  • user update password <USERNAME>
  • user admin grant <USERNAME>
  • user admin revoke <USERNAME>
  • document add
  • document content <ID>.<FORMAT>
  • document name <ID>.<FORMAT>
  • document delete <ID>
  • document rename <ID> <NAME>
  • document access public <ID>
  • document access private <ID>
  • folder documents <PATH>
  • folder folders <PATH>
  • folder users <PATH>
  • folder access grant <PATH> <USERNAME>
  • folder access revoke <PATH> <USERNAME>
  • folder document create <PATH> <DOCUMENT>
  • folder create <PATH>
  • folder delete <PATH>

Misc functionality

  • --log-http enables HTTP requests and response logging to STDERR

gliffy's People

Contributors

alxx avatar bitdeli-chef avatar bkon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.