GET member/details
Description
- The member/details api resource is a feature in NATS4 that allows you to access a member's details.
Resource URL
- http://domain/api/member/details
- Replace domain with the nats domain
Request Method
Response Format
Authentication
Parameters
Paremeters can be sent as url encoded params.
There are two types of parameters for this function.
Filters
These are parameters used to specify which member you're looking for. This function will only return one member; use these filters to choose which one.
- memberid
- session
- memberidx (Ex: If the member joined under Epoch with subscriptionid 12345, their memberidx would be EPOCH:12345)
- username
- siteid
- transactionid
- email
- status
- token_hash
- subscriptionid
Options
These parameters allow you to specify what data you want to be returned. The member's main information will be returned by default; this specifies what you want in addition to that.
- subscriptions -- return all subscriptions for the member
- transactions -- return all transactions for the member (implies subscriptions).
- full_info -- whether to also get the info from the member_info table (name, address, zip, country, etc)
- ident_details -- whether to also return all the identifier information (ie, instead of just returning identid 1234, also return what programid, siteid, tourid, biller, etc that is)
Configurations
- Starting with NATS version 4.1.11.1+ we have a config option in Configuration Admin > Misc section > "API_INCLUDE_BILLER_OPTION_INFO"
- Which you will need to enable to add biller specific option info to get_member_details API function.
Example Request
GET
http://domain/api/member/details
{
"memberid": "2",
"identid": "6",
"loginid": "6",
"networkid": "0",
"refurl_lookup_id": "2",
"status": "1",
"trial": "0",
"joined": "1402603193",
"expired": "0",
"last_login": "0",
"stamp": "1402603193",
"siteid": "1",
"username": "testakovsky2",
"password": "abc123",
"cryptpass": "1f2JYM/vKDxjk",
"ip": "10.10.10.79",
"email": "hello@toomuchmedia.com",
"session": "805dcd81818e7593a909fb4c2f2dadba",
"mailok": "1",
"flat_price": "0",
"first_login": "0",
"third_party_partner_id": "0",
"cascadeid": "2",
"cascade_item_id": "2",
"token": "0",
"original_username": "testakovsky2",
"renamed": "0",
"marked": "0",
"token_hash": "509f18ef8dd27d6a4fab5ececea7c097",
"member_subscription_id": "2",
"memberidx": "NETBILLING:111684925893",
"billerid": "4",
"statid": "8539a066a729f6",
"cost": "0",
"cost_charge": "0",
"spent": "66600",
"refunded": "0",
"charges": "1",
"next_rebill": "1460231993",
"optionid": "1",
"rebills": "0",
"active": "1",
"upgradeid": "",
"expires": "1460231993",
"nats_expires": "1460231993",
"biller_expires": "0",
"original_optionid": "1",
"created_date": "1402603114",
"loginid_assigned": "0",
"identid_assigned": "0",
"gateway_token": "111684925892",
"passthrough1": "",
"passthrough2": "",
"passthrough3": "",
"passthrough4": "",
"passthrough5": "",
"member_identid": "6",
"member_loginid": "6",
"firstname": "Testakovsky",
"lastname": "Test",
"address1": "666 666 St",
"address2": "",
"zip": "11111",
"city": "Heck",
"country": "US",
"state": "NJ",
"shipping_firstname": "",
"shipping_lastname": "",
"shipping_address1": "",
"shipping_address2": "",
"shipping_zip": "",
"shipping_city": "",
"shipping_country": "",
"shipping_state": "",
"phone": "",
"xsell_success": "0",
"xsell_message": "",
"custom1": "Hello, this is a test",
"custom2": "",
"custom3": "",
"custom4": "",
"custom5": "",
"last_modified": "0",
"loginid_nice": "affiliate2",
"long_ip": "168430159",
"biller": "NETBILLING",
"refurl": "No Referring URL",
"subscriptions": {
"2": {
"member_subscription_id": "2",
"memberid": "2",
"memberidx": "NETBILLING:111684925893",
"billerid": "4",
"statid": "8539a066a729f6",
"stamp": "1402603193",
"joined": "1402603193",
"expired": "0",
"cost": 1250,
"cost_charge": "0",
"spent": "66600",
"refunded": "0",
"charges": "1",
"next_rebill": "1460231993",
"optionid": "1",
"rebills": "0",
"active": "1",
"upgradeid": "",
"expires": "1460231993",
"nats_expires": "1460231993",
"biller_expires": "0",
"original_optionid": "1",
"created_date": "1402603114",
"identid": "6",
"loginid": "6",
"loginid_assigned": "0",
"identid_assigned": "0",
"gateway_token": "111684925892",
"passthrough1": "",
"passthrough2": "",
"passthrough3": "",
"passthrough4": "",
"passthrough5": "",
"biller": "NETBILLING"
}
}
}
Example Code
PHP
<?php
$curl = curl_init();
$data = array(
'session' => '805dcd81818e7593a909fb4c2f2dadba',
'username' => 'testakovsky2',
'full_info' => true,
'subscriptions' => true
);
$data_string = http_build_query($data);
$url = 'http://domain/api/member/details?'.$data_string;
$headers = array(
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: tmm1phrvezsbu'
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$resp = curl_exec($curl);
//dumps an associative array representation of the json
var_dump(json_decode($resp, true));
// Close request to clear up some resources
curl_close($curl);
?>
Python
- This example requires pip and the request library which can be installed via pip by: 'pip install requests'
import requests
url = 'http://domain/api/member/details'
params = {
'username': 'testakovsky2',
'session': '805dcd81818e7593a909fb4c2f2dadba',
'full_info': 'true',
'subscriptions': 'true'
}
headers = {
'api-key': '44b5498dbcb481a0d00b404c0169af62',
'api-username': 'tmm1phrvezsbu'
}
res = requests.get(url, params=params, headers=headers)
print res.json()
node.js
- This example requires npm and the request module which can be installed via npm by: 'npm install request'
var request = require('request');
var options = {
url: 'http://domain/api/member/details',
method: 'GET',
qs: {
'username': 'testakovsky2',
'session': '805dcd81818e7593a909fb4c2f2dadba',
'full_info': 'true',
'subscriptions': 'true'
},
json: true,
headers: {
'api-key': '44b5498dbcb481a0d00b404c0169af62',
'api-username': 'tmm1phrvezsbu'
}
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
else{
console.log(body);
}
}
request(options, callback);
Curl
curl -X GET 'http://domain/api/member/details?session=805dcd81818e7593a909fb4c2f2dadba&username=testakovsky2&full_info=true&subscriptions=true"