API Module Customer searchCustomerRequest
From Openprovider API documentation
(Difference between revisions)
(Created page with '==Module Customer > Search== {| border="1" cellpadding="4" |- style="background-color:#BBBBBB;" |'''Module''' |customer |- style="background-color:#EEEEEE;" |'''Command name''' |…') |
(→Module Customer > Search) |
||
| (17 intermediate revisions not shown) | |||
| Line 13: | Line 13: | ||
|'''Input''' | |'''Input''' | ||
| | | | ||
| - | *limit | + | *[[API Format Limit|limit]] (''default value: 100, maximum value: 1000'') |
| - | *offset | + | *[[API Format Offset|offset]] (''default value: 0'') |
*emailPattern | *emailPattern | ||
*lastNamePattern | *lastNamePattern | ||
*companyNamePattern | *companyNamePattern | ||
| - | *withAdditionalData | + | *withAdditionalData (''default value: 0'') |
| + | *columns (possible values: id, companyName, firstName, lastName, fullName, prefix, initials, email, handle) | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
|'''Output''' | |'''Output''' | ||
|Result set of customer details: | |Result set of customer details: | ||
| - | *handle | + | *[[API Format Handle|handle]] |
*companyName | *companyName | ||
| - | *vat | + | *[[API Format vat|vat]] |
*[[API Format Name|name]] | *[[API Format Name|name]] | ||
| - | *gender | + | *[[API Format Gender|gender]] |
*[[API Format Address|address]] | *[[API Format Address|address]] | ||
*[[API Format Phone|phone]] | *[[API Format Phone|phone]] | ||
*[[API Format Phone|fax]] | *[[API Format Phone|fax]] | ||
*email | *email | ||
| - | *[[API Format Additional Data|additionalData]] (if withAdditionalData = true) | + | *[[API Format Additional Data Customer|additionalData]] (if withAdditionalData = true) |
| + | *[[API_Format_Extensions_Additional_Data_Customer|extensionAdditionalData]] (if withAdditionalData = true) | ||
|} | |} | ||
| Line 40: | Line 42: | ||
->setAuth(array('username' => 'username', 'password' => 'password')) | ->setAuth(array('username' => 'username', 'password' => 'password')) | ||
->setArgs(array( | ->setArgs(array( | ||
| - | 'offset' => | + | 'offset' => 0, |
'limit' => 25, | 'limit' => 25, | ||
'emailPattern' => '*@openprovider.nl', | 'emailPattern' => '*@openprovider.nl', | ||
| Line 48: | Line 50: | ||
===Raw XML=== | ===Raw XML=== | ||
| - | + | ''Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.'' | |
| + | <?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> | ||
| + | </item> | ||
| + | </array> | ||
| + | </results> | ||
| + | <total>1</total> | ||
| + | </data> | ||
| + | </reply> | ||
| + | </openXML> | ||
Current revision as of 12:29, 20 May 2020
Contents |
Module Customer > Search
| Module | customer |
| Command name | searchCustomerRequest |
| Use | Returns a list of customer objects matching search criteria |
| Input | |
| 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' => 0,
'limit' => 25,
'emailPattern' => '*@openprovider.nl',
'lastNamePattern' => 'Smith',
'companyNamePattern' => '*prov*'
));
Raw XML
Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.
<?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>
</item>
</array>
</results>
<total>1</total>
</data>
</reply>
</openXML>