This query fetches sales information for a specific vendor and a specific plugin.

We at Scandio use a query like this to provide an overview about our current Atlassian Marketplace sales for all of our colleagues - without depending on whether they have direct access to our Marketplace account or not.

Datasource

Datasource type

REST Basic

Datasource URL

https://marketplace.atlassian.com/rest/1.0/vendors/<vendorId>/
CODE

Datasource Test URL

sales
CODE

Datasource User

(Technical) User that is allowed to access the vendor account

Datasource Password

Password of the (technical) user

Query

Query URL

sales?add-on=<PluginKey>
CODE

Query JSON path

$.sales
CODE

Converter Example

function convert(json) {
    var result = [];
    var parsedJsonObject = JSON.parse(json);
    var current, index;
    for (index in parsedJsonObject) {
        // only continue if this property is not inherited
        if (parsedJsonObject.hasOwnProperty(index)) {
            current = parsedJsonObject[index];
            result.push({
                'Date': current.date,
                'Invoice': current.invoice,
                'Organisation Name': current.organisationName,
                'TechnicalContactName': current.technicalContact.name,
                'License Size': current.licenseSize,
                'Purchase Price': '$' + current.purchasePrice,
                'TechnicalContactMail': current.technicalContact.email
            });
        }
    }
    return result;
}
CODE

Template Example

<table class="aui confluenceTable pocketquery-table">
    <thead>
        <tr>
        #foreach ($column in $columns)
            #if(!$column.equals("TechnicalContactMail"))
               <th>$!column</th>
            #end
        #end
        </tr>
    </thead>
     
    <tbody>
        #foreach ($row in $result)
            <tr>
            #foreach ($column in $row)
                #if($velocityCount == 4)
                    <td>
                        <a href="mailto:$row.TechnicalContactMail">
                            $!column
                        </a>
                    </td>
                #elseif($velocityCount < 7)
                    <td>$!column</td>
                #end
            #end
            </tr>
        #end
    </tbody>
</table>
CODE