api

Affily::api(string $method[, array $params[, string $responseType]])

The feature allows communication with The Affily platform through calling the supported methods and passing the data in the array.

Parameters

Name Type Description
method string calling the method supported by the platform
params array data array passed to the method that will use the data in order to return the response
responseType string format of server response, below is a list of supported formats:
  • JSON

Example

PHP
    require_once("php-sdk/affily.php");

    
$config = array(
        
'id' => ''# ID App
        
'secret' => '' # Secret Code
    
);

    
$affily = new Affily($config);

    try
    {
        
$GeoTrack $affily->api(
            
'geo.location',                 # method
            
array( 'ip'=> '66.249.78.161' # params
        
);

        echo 
"Region: " $GeoTrack['region'];
    }
    catch (
AffilyException $e)
    {
        
error_log($e->getMessage());
    }

Response

Data array or string of characters.

Method list

affiliate

affiliate.add

create partner account

commision

commision.add

add commission

commision.report

get commisions from exact period

commision.update

commision update