Use this endpoint to get an Brid marketplace metrics per site.
apiv2/marketplace/partner/<SITE_ID>.json
This method is type of POST and will not receive any GET parameters.
SITE_ID is an integer ID of your web property/site in Brid CMS.
Parameters:
Name | Type | Description |
---|---|---|
data[date_from] *required | string | Starting date |
data[date_to] *required | string | End date |
data[demand_id] *required | integer | A valid demand ID. This param will work only if the filter:demand param is passed in the request |
data[filter] *required | string | Accepted values: demand |
data[results] *required | string | Accepted values: by_day, total |
Date format should be in: "YYYY-MM-DD".
<?php
require_once('lib/BridApi.php');
try{
$api = new BridApi(array('auth_token'=>'YOUR_AUTH_TOKEN_HERE'));
?>
<h2>Json</h2>
<?php
$post = array('data[date_from]'=>'2020-01-01', 'data[date_to]'=>'2020-01-31', 'data[demand_id]'=>'2','data[filter]'=>'none', 'data[results]'=>'by_day');
$return = $api->post(['marketplace', 'partner', {YOUR_SITE_ID}], $post);
print_r($return);
?>
<?php
}catch(Exception $e){
echo $e->getMessage();
}
?>
BridApi.php is a small library we provide in our git repository which allows you to quick-start your implementation so we advise you to use it. These examples are made with this library in mind. Make sure to substitute and use your own authorization token and Site ID when trying out these examples.