Hi Ravi,
Kindly check the below mentioned pseudo-code which might help you for getting the affiliate domain details.
# 1. Initialize the API
use Netegrity::PolicyMgtAPI;
$policyapi = Netegrity::PolicyMgtAPI‑>New();
$session = $policyapi‑>CreateSession("adminid", "adminpwd");
# 2. Get an existing affiliate domain
$affiliate = $affdomain‑>GetAffiliate("affname");
Please refer below mentioned bookself link for more details.
https://support.ca.com/cadocs/0/CA%20SiteMinder%2012%2052-ENU/Bookshelf_Files/HTML/idocs/245016.html#o243996
Also I attached the sample perl code for creating an affiliate domain for your reference.
Thanks,
Sharan