NATS4 API Ping

From Tmmwiki

Jump to: navigation, search
NATS 4
API
NATS4 API
Add Affiliate
Admin Get Adtools
Adtool Types
Adtool Categories
Ping
Affiliate Get Campaigns
Get Member Details
Set Affiliate Defaults
Set Affiliate Admin Settings
Set Affiliate Customs
Decode Natscode
Set Affiliate Information
Set Affiliate Settings
Set Member Details
Bulk Import Adtools
Send Email API Function

Ping is a test function to make sure that you can successfully connect to the API. To perform a ping you must make a SOAP call with the following parameters:

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tns="urn:natsapiadmin_wsdl">
<SOAP-ENV:Body>
	<tns:ping xmlns:tns="urn:natsapiadmin_wsdl">
	</tns:ping>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

You will get a response similar to:

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
	<ns1:pingResponse xmlns:ns1="urn:natsapiadmin_wsdl">
		<return xsi:type="xsd:boolean">true</return>
	</ns1:pingResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


NuSOAP Example (continuing from main article NuSOAP Example):

$result = $client->call('ping', Array(), 'natsapiadmin_wsdl');
var_dump($result);

Output:

bool(true)
products