API Module Customer searchCustomerRequest

From Openprovider API documentation

(Difference between revisions)
Jump to: navigation, search
Line 48: Line 48:
===Raw XML===
===Raw XML===
-
  to do
+
  <?xml version="1.0" encoding="UTF-8"?>
 +
<openxml>
 +
  <credentials>
 +
    <username>username</username>
 +
    <password>password</password>
 +
  </credentials>
 +
  <searchcustomerrequest>
 +
    <offset>0</offset>
 +
    <limit>100</limit>
 +
    <order>asc</order>
 +
    <orderby>companyName</orderby>
 +
    <companynamepattern>*hosting*</companynamepattern>
 +
    <withadditionaldata>0</withadditionaldata>
 +
  </searchcustomerrequest>
 +
</openxml>
 +
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<openxml>
 +
  <reply>
 +
    < code>0</code>
 +
    <desc></desc>
 +
    <data>
 +
      <results>
 +
        <array>
 +
          <item>
 +
            <id>156384</id>
 +
            <companyname>Hosting Unlimited</companyname>
 +
            <name>
 +
              <initials>J.B.</initials>
 +
              <firstname>John</firstname>
 +
              <prefix>van</prefix>
 +
              <lastname>Halen</lastname>
 +
            </name>
 +
            <gender>M</gender>
 +
            <phone>
 +
              <countrycode>+8</countrycode>
 +
              <areacode>383</areacode>
 +
              <subscribernumber>1231212</subscribernumber>
 +
            </phone>
 +
            <fax>
 +
              <countrycode>+8</countrycode>
 +
              <areacode>383</areacode>
 +
              <subscribernumber>1231213</subscribernumber>
 +
            </fax>
 +
            <address>
 +
              <street>Main Street</street>
 +
              <number>2</number>
 +
              <zipcode>630060</zipcode>
 +
              <city>Washington</city>
 +
              <country>US</country>
 +
              <suffix>a</suffix>
 +
            </address>
 +
            <email>info@openprovider.nl</email>
 +
            <handle>JH000001-US</handle>
 +
            <comments></comments>
 +
            <resellerid>123915</resellerid>
 +
          </item>
 +
        </array>
 +
      </results>
 +
      <total>1</total>
 +
    </data>
 +
  </reply>
 +
</openxml>

Revision as of 08:35, 16 April 2010

Contents

Module Customer > Search

Module customer
Command name searchCustomerRequest
Use Returns a list of customer objects matching search criteria
Input
  • limit
  • offset
  • emailPattern
  • lastNamePattern
  • companyNamePattern
  • withAdditionalData
Output Result set of customer details:

Examples

Using PHP class

$request = new OP_Request;
$request->setCommand('searchCustomerRequest')
 ->setAuth(array('username' => 'username', 'password' => 'password'))
 ->setArgs(array(
   'offset' => 50,
   'limit'  => 25,
   'emailPattern' => '*@openprovider.nl',
   'lastNamePattern' => 'Smith',
   'companyNamePattern' => '*prov*'
 ));

Raw XML

<?xml version="1.0" encoding="UTF-8"?>
<openxml>
  <credentials>
    <username>username</username>
    <password>password</password>
  </credentials>
  <searchcustomerrequest>
    <offset>0</offset>
    <limit>100</limit>
    <order>asc</order>
    <orderby>companyName</orderby>
    <companynamepattern>*hosting*</companynamepattern>
    <withadditionaldata>0</withadditionaldata>
  </searchcustomerrequest>
</openxml>

<?xml version="1.0" encoding="UTF-8"?>
<openxml>
  <reply>
    < code>0</code>
    <desc></desc>
    <data>
      <results>
        <array>
          <item>
            <id>156384</id>
            <companyname>Hosting Unlimited</companyname>
            <name>
              <initials>J.B.</initials>
              <firstname>John</firstname>
              <prefix>van</prefix>
              <lastname>Halen</lastname>
            </name>
            <gender>M</gender>
            <phone>
              <countrycode>+8</countrycode>
              <areacode>383</areacode>
              <subscribernumber>1231212</subscribernumber>
            </phone>
            <fax>
              <countrycode>+8</countrycode>
              <areacode>383</areacode>
              <subscribernumber>1231213</subscribernumber>
            </fax>
            <address>
              <street>Main Street</street>
              <number>2</number>
              <zipcode>630060</zipcode>
              <city>Washington</city>
              <country>US</country>
              <suffix>a</suffix>
            </address>
            <email>info@openprovider.nl</email>
            <handle>JH000001-US</handle>
            <comments></comments>
            <resellerid>123915</resellerid>
          </item>
        </array>
      </results>
      <total>1</total>
    </data>
  </reply>
</openxml>
Views
Personal tools