Consider these ideas as you build your integration with Gliffy. The following suggestions stem from our experience with building Gliffy integrations and from the feedback of our users.
The user experience for many applications might look something like the following (your particular integration may have a different flow, but this is a good guideline for content management systems interested in adding Gliffy functionality).
This application flow is based heavily on our Confluence Plugin. (Note that the Confluence Plugin doesn't currently use the Gliffy API) Try out the Gliffy Plugin for Confluence to see this flow in action.
This suggestion is particularly useful for customers who are building content management systems that include Gliffy drawing capabilities. It is important to give your users a way to add Gliffy drawings in an intuitive way. Simply providing wiki-text isn't sufficient as users wont be able to easily find Gliffy. The best way we've found to solve this problem is to include an 'Add Gliffy Diagram' link in a prominent place on all pages that might include Gliffy Drawings. For wikis, you might want this where you have links to 'Add Page'.
We have developed several client libraries in different languages that address the complexity of OAuth and making calls to the REST API. Using a client library in your target language is a quick way to jumpstart your integration. Since the client libraries are open sourced under the Apache license, you are free to modify it to your needs.
Gliffy only allows Premium account holders to create private diagrams. This is to encourage customers to upgrade their Basic accounts to Premium accounts.
Developers: It is important that you check the expiration date of your account prior to creating diagrams for users. If the account expiration date is in the past, all newly created diagrams will be public by default, and the account MAY NOT create private diagrams. If the expiration date has passed, the UI of the home application should notify the user that they may only create private diagrams if they upgrade to a Premium Gliffy account.
We suggest you wrap the Gliffy editor in your own html page for several reasons:
One easy way to accomplish this task is through an iFrame. Here's an example from the PHP client library that wraps the Gliffy editor:
Call the delete OAuth token request when your user logs out of your application. By deleting the OAuth token, any URL's created while the token was active will become invalid. This is a good idea as it will enhance the security of your integration.