Page tree
Skip to end of metadata
Go to start of metadata

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 typeREST Basic
Datasource URL
https://marketplace.atlassian.com/rest/1.0/vendors/<vendorId>/
Datasource Test URL
sales
Datasource User(Technical) User that is allowed to access the vendor account
Datasource PasswordPassword of the (technical) user

 Query

Query URL
sales?add-on=<PluginKey>
Query JSON path
$.sales

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;
}

Template Example

Template example
## @param doubleclick:false

<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>



Download this example!


pocketquery-example-REST-AtlassianMarketplaceSales.xml


Download the export file with the entities on the left and import it in your PocketQuery administration.




  • No labels