NATS4 API Record Member Login

From TMM Wiki
Revision as of 16:12, 22 June 2012 by TMMMegan (talk | contribs) (Created page with "'''''This API function is available in NATS 4.1.4.1 and higher.''''' The 'record_member_login' API function is used to record the logins to your membership sites in NATS. Th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This API function is available in NATS 4.1.4.1 and higher.

The 'record_member_login' API function is used to record the logins to your membership sites in NATS. This function works similarly to Member Logging.

This function needs several parameters:

  • username
  • siteid
  • ip address

The call will return either "SUCCESS: 1" or "FAILURE: No Member Found".


Examples

NuSOAP Example (continuing from main article NuSOAP Example):

$values = Array(
      'username' => 'apitest_login', 
      'siteid' => '1', 
      'ip' =>'75.99.182.234');

$result = $client->call('record_member_login', $values, 'natsapiadmin_wsdl');
var_dump($result);

Output:

SUCCESS: 1

An example of the request:

<?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:record_member_login xmlns:tns="urn:natsapiadmin_wsdl">
          <username xsi:type="xsd:string">apitest_login</username>
          <siteid xsi:type="xsd:string">1</siteid>
          <ip xsi:type="xsd:string">75.99.182.234</ip>
      </tns:record_member_login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

You will get a response similar to:

<?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/">
<SOAP-ENV:Body>
      <ns1:record_member_loginResponse xmlns:ns1="urn:natsapiadmin_wsdl">
          <return xsi:type="xsd:string">SUCCESS: 1</return>
      </ns1:record_member_loginResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>