Share Link logo Share Link

Share Link API


Overview

The Share Link API is a read-only JSON API that allows retrieval of your Share Link data for use on your website or application where widgets are not feasible or practical.

{warning} There are strict retrieval limits on the use of the Share Link API and you must implement your own caching from the data you retrieve via the API, requesting new data no more than every 20 minutes. ie. You should not be retrieving from the API for each page view. Failure to adhere to this will result in API access being revoked.

API endpoints are created in the same way as widgets via the create widget page and selecting any widget labelled "API". You can customise the data the API endpoint will provide and see a preview of the (demo) data.

Once you have created and saved an API widget you can access the end point as below.

Retrieving API endpoints

Select the widget you have created from the main menu and click the "Embed" tab from the preview page. This will show you the different options for placing the widget in your site.

embed-demo-widget

As we will not be embedding the widget into a website you do not need all the embed code, just the URL of the widget. This can be found towards the end of the second line of code (that starts with <iframe>). Copy everything after src=" until the closing ".

For example:

<iframe width="100%" frameborder="0" loading="lazy" class="sharelink" scrolling="no" style="width: 1px;min-width: 100%;" src="https://app.sharelinktechnologies.com/widget/df3050ef-05fb-456c-8fe3-6bbe6f96f46c"></iframe>

Gives you the URL endpoint of:

https://app.sharelinktechnologies.com/widget/df3050ef-05fb-456c-8fe3-6bbe6f96f46c

You can now make GET requests to this URL to retrieve the JSON data.

{primary} Share Link data is locked to your domain. You will still need to make the GET request from your licensed domain and ensure that a request header is being sent containing this domain.

See a full PHP example.

Best practices

Cache data

You should not be retrieving data from the Share Link API for every page view, infact doing so may result in your Share Link data becoming unavailable due to request limits. Instead download the data once every 20 minutes (this is the update time for Share Link data anyway, so checking it anymore gives no advantage).

Limit quantity of data retrieved

When retrieving large amounts of data from the Share Link API consider if it will change and what can be cached to reduce the amount of data you need to retrieve upon each request.

As API endpoints are still basically widgets you can customise the data that is retrieved the same way you can any other widget.

For example, if you require an API end point to retrieve your ASX Announcements you should:

1) Create an ASX Announcements API widget with no pagination and no (or very large) number of ASX Announcements retrieved

2) Call this end point once and save the resulting announcements to a data store (usually your website's database)

3) Update the widget to retrieve only 3-5 ASX Announcements and save it

4) Make get requests every 20-30 minutes on the same endpoint and update the database when new announcements are imported