How to load affiliate manager information

Here is an example of how can affiliate load affiliate manager information. 
 
<?php
include 'PapApi.class.php'; //the PapApi.class.php can be found at the PAP installation folder, in the 'api' directory

$session = new Pap_Api_Session("https://your_pap_url/scripts/server.php");

if(!$session->login("affiliate login","password", Pap_Api_Session::AFFILIATE)) {
  die("Cannot login. Message: ". $session->getMessage());
}

$request = new Gpf_Rpc_FormRequest("Pap_Affiliates_MerchantInfo", "load", $session);

// send request
try {
  $request->sendNow();
} catch(Exception $e) {
  die("API call error: ".$e->getMessage());
}

$response = $request->getForm();

if($response->isSuccessful()) {
  echo 'Success:';
  echo '<br>';
  echo $response->getFieldValue('WelcomeMessage');
  echo '<br>';
  echo $response->getFieldValue('data1');
  echo '<br>';
  echo $response->getFieldValue('data2');
  echo '<br>';
  echo $response->getFieldValue('data3');
  echo '<br>';
  echo $response->getFieldValue('data4');
  echo '<br>';
  echo $response->getFieldValue('data5');
  echo '<br>';
  echo $response->getFieldValue('data6');
  echo '<br>';
  echo $response->getFieldValue('data7');
  echo '<br>';
  echo $response->getFieldValue('data8');
  echo '<br>';
  echo $response->getFieldValue('photo');
} else {
  echo 'Unsuccess.';
}
?>
 
×