<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=314385&amp;fmt=gif">

Developers

Overview

SharpCloud is a powerful platform that has many use-cases and applications, but it can easily be customized to fit your requirements. 

Most customization can be achieved without any developer skills. Where developer skills are needed, this section is designed to help you along that journey. 

Broadly speaking, developer efforts can be split into two categories: 

1. UI Behaviour – Developing and customizing plugins (Front-end) 

2. Data Integration – Using REST API’s to get data in to the platform (Back-end)

Server v4 (n)


UI Behaviour – Plugins (Front-end) 

We implement visual extensions to SharpCloud stories using Plugins. Plugins are custom bits of code that run from an iFrame hosted in the View or Item Panel. They are built using HTML/CSS/JavaScript and interact with SharpCloud via the Client SDK. Typically, these might be things like a new visualization, custom reports, data entry forms or some user initiated behaviour like sending messaging or initiating some external workflow. 

SharpCloud already includes many free plugins, via the plugin store. You can see the available plugins by adding a Widget View to a story or by adding a Plugin Panel to an item. All of our free plugins include source code so you can see examples of how certain behaviour is achieved or you can use it as a starting point for building a similar plugin. We also provide boiler-plate templates to get you started quickly. 

To build and deploy a plugin, you need access to “Storage Manager” which allows you to upload your code to SharpCloud. Storage Manager is free but not available if you’re using one of our multi-tenant environments (these are; https://app.sharpcloud.com, https://my.sharpcloud.com, https://uk.sharpcloud.com, and https://eu.sharpcloud.com) and will also need to be enabled by your System Administrator. You can think of Storage Manager like SharpCloud’s version of JSFiddle. 

In general, plugins do not require any authentication as they will run in-line in the browser and behave as the user using them. 

We have a series of video's that will walk you through the journey of building Plugins.

Data Integration – REST API’s (Back-end) 

We can automate data flow to SharpCloud using our public REST API’s. 

Documentation 

The swagger page lists all the available endpoints, variable types and allows you to try snippets of code. If you are familiar with this concept, you can access our swagger page from the profile menu when you’re signed in as shown below: 

Authentication 

If you are already logged into SharpCloud, you can use the swagger pages as yourself (the active user). If you need to make remote calls you should generate a Personal Access Token (PAT) from your profile menu and include this as a BEARER token in your requests. The swagger page also supports adding the bearer token so you can see exactly how the underlying requests are formatted. 

Access Control 

The API has the same access control to your stories as a normal user that is accessing the stories via the browser interface and is bound by the same underlying business rules. This means that you may only read stories you have Read-Only access to and can only Create/Update/Delete from those stories that you have Collaborate/Create access on. 

License 

Anyone with an active subscription can access data using the API’s, but there are throttle limits on writes (60 per hour). The limit can be removed on a case-by-case basis so please contact us if you’re affected by these limitations. 

API’s 

SharpCloud offers two public facing API’s. In both cases, a storyID forms part of the request (i.e., the API’s always work on a specific story). Note that the API’s do not currently support Calculations which are currently performed only on the client. 

The public API’s can be broken down into two types: 

1.  Batch

2. OData

Batch API 

This is the easiest way to get large volumes of data in or out of SharpCloud. The batch API’s allow you to send and receive data in JSON format, where the content is normalized so it appears as it would to the user in the client. 

For example, the data is formatted to use friendly names (instead of their internal GUID values) such as “Category” : “Project”, “ExternalID” : “A100”, “Name” : “My Project”, “Cost” : “300”, “Risk” : “Medium” 

Using data in this format makes it much easier to work with and most developers will find it relatively easy to use. Currently the batch API’s support bulk reading and writing of: 

- Items 
- Relationships 
- Panels 
- Resources

Because the batch API’s are intended to automate data flow in and out of SharpCloud, all Items must be referenced by an ExternalID. The ExternalID is your own reference to that Item and is required to Create, Update and Delete the Item. It is a string identifier (max length of 200 characters), that you can use to reference your source system. ExternalID’s are unique per category, not per story. For example, you can have “001” as a Project Item’s ID and “001” as a Risk Item’s ID, where Project and Risk are separate categories.

Note: It is not possible to update the ExternalID via the batch API’s. 

Technically, SharpCloud does not need the ExternalID to operate and the UI will allow blanks and duplicates (internally it uses the unique GUID’s). The rules for the batch API’s are very simple; All items must specify the category that are associated to and you have to use your own unique reference (ExternalID). 

If no matching record is found, the API’s will assume you are creating a new item. If a match is found then updating will be assumed. Deletes can be called specifically (by Category and ExternalID) or by being omitted from the batch (specific options required to make this work). 

Whilst the batch API’s make it easy to move data in and out of SharpCloud in a structured way, they cannot be used to modify the story structure (e.g., adding attributes or categories). For this, you will need to use the OData endpoints. 

Importing and Exporting data is relatively easy and this is how our Data Extracts and Data Connectors communicate with SharpCloud. 

Connectors and Extracts 

Most importing or exporting of data in to and from SharpCloud can be handled using our Data Connectors and Data Extracts. It’s a powerful way of building automation flow (Extract, Transform, Load (ETL)) without any specific developer tools. 

Note: SharpCloud does not provide any tooling to “Push” data and this would need to be a developer task 

Connectors and Extracts come with a lot of advanced functionality built in to make it easy to do simple tasks. They support SQL, which allows data to be transformed before it is sent to SharpCloud, or after it has been extracted. For example, you can use the Advanced SQL to group results, perform arithmetic or join data across tables. 

Note: Connectors and Extracts are also using the public batch API’s to extract or update SharpCloud

OData API 

OData is a standard way to manipulate, query and join nested data. It is an open format and widely used across many scalable applications. More can be found out about it here. You can find details of our public OData API by changing the definition to “Public API V1 (ODATA)” in the top right of the swagger page. You can navigate to the swagger page from the API menu. 

Our OData API can be used to make many complex queries and although it is very powerful, it is harder to use because values are referenced using the internal identifies (GUIDs). The OData API is capable of making changes to the SharpCloud story structures like adding new categories, attributes and tags etc. For most cases, it is easier and more scalable to use the batch API’s above, but there are a few occasions when the OData API is the better or only choice, such as: 

1. You want to manipulate the story structure programmatically (add categories or attributes) 
2. You need to delete an Item that may not have an ExternalID 
3. You need to rename an Items ExternalID. 
4. You want to perform a complex or specific filter on items (E.g. All Items where Name contains “x” and AttributeValue (Cost) > 100) 

If you need more information, please contact us and let us know how we can help. 

Plugin Walkthrough Videos

The below video's are split in to key sections and designed to be used as a walkthrough on how to leverage Storage Manager, the Software Developers Kit (SDK) to create Plugins.

Website_Developers_PluginsIntro1
Introduction to PluginsWelcome to the Plugin Tutorials! Connor, your instructor, will walk you through how to build plugins.
Website_Developers_PluginSetup
Plugin Development SetupThis video will go over how to set yourself up to begin developing your very own plugins.
Website_Developers_StorageManager
Understanding Storage ManagerThis video will go in to detail on Storage Manager, how it works and how to code with it as well, alongside how you will get the plugin to render within your story after it's been uploaded.
Website_Developers_PluginArchitecture1
Overview of Plugin ArchitectureTake a look at how plugins sit on top of the core product and how it manages to grab the stories data through communication with the SharpCloud SDK, all in a simple diagram.
Website_Developers_SDK
Understanding the SharpCloud SDKDeep dive in to the SharpCloud SDK, the functionality it offers as well as how to grab all the data from your story and/or current view to create plugins with live data.
Website_Developers-BoilerPlate1
Boiler Plate PluginA brief explanation of the boilerplate plugin code available within the plugin store as well as what it does and how it utilizes the SharpCloud SDK to full effect. This will be a good starting point for your plugin building.
Website_Developers_CodingPlugin
Debugging ChromeA more advanced section where we introduce you to the powerful features that the chrome developer tools provides you.
Website_Developers-FirstPlugin1
Coding our First PluginWatch and create alongside this video on how to create a simple bar chart plugin, where Connor will guide you on each step.
Website_Developers_ClosingNotes
Syntax and ConfigurationIn this video, we explain to you how to create dynamic configuration for your plugins, which means allowing users to configure your plugin from within their story view.
Website_Developers_Syntax
Closing NotesClosing information and bonus tips on where to find helpful resources if you get stuck while developing plugins.