Share Link logo Share Link

Share Link API

PHP Example

Below is an example of using PHP's curl library to retrieve JSON data from the Share Link API.

{primary} Be sure to replace the example widget UUID with yours and the .test domain with one from your domains page.

‚Äč// create curl resource
$ch = curl_init();

// set url
curl_setopt($ch, CURLOPT_URL, 'http://app.sharelinktechnologies.com/widget/106c7070-36e7-4430-aa67-7567c47f175f');
curl_setopt($ch, CURLOPT_REFERER, 'http://yourdomain.test');
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// $output contains the output string
$output = curl_exec($ch);

// close curl resource to free up system resources
curl_close($ch);

// $output now contains the JSON API result, you can use json_decode to read it, here we just display on screen
echo $output;

The result wil vary based on the widget type you hav selected, but JSON is self describing so you can exam the data and recognise the fields returned:

[
    {
        "released_at":"1998-01-06 00:00:00",
        "title":"New Issue of Securities - Exercise of June 1999 options",
        "url":"https://www.asx.com.audisplayAnnouncement.do?display=header&issuerId=1370&documentNumber=142662&documentDate=1998-01-06",
        "price_sensitive":0
    },
    {
        "released_at":"1998-02-06 00:00:00",
        "title":"Sells Country Supermarket Chain",
        "url":"https://www.asx.com.audisplayAnnouncement.do?display=header&issuerId=1370&documentNumber=143544&documentDate=1998-02-06",
        "price_sensitive":1
    },
    {
        "released_at":"1998-02-09 00:00:00",
        "title":"Purchase of business assets of Key Transport Pty Ltd",
        "url":"https://www.asx.com.audisplayAnnouncement.do?display=header&issuerId=1370&documentNumber=143585&documentDate=1998-02-09",
        "price_sensitive":0
    },
    {
        "released_at":"1998-02-10 00:00:00",
        "title":"Half Yearly Report & ASC accounts","url":"https://www.asx.com.audisplayAnnouncement.do?display=header&issuerId=1370&documentNumber=143628&documentDate=1998-02-10",
        "price_sensitive":1},
    {
        "released_at":"1998-02-18 00:00:00",
        "title":"Notice re Dampier to Bunbury gas pipeline",
        "url":"https://www.asx.com.audisplayAnnouncement.do?display=header&issuerId=1370&documentNumber=143821&documentDate=1998-02-18",
        "price_sensitive":0
    }
]