NATS5 REST API Member GET details
From TMM Wiki
GET /member/details
Note: This is an autogenerated wiki page for the NATS5 API. There may be additional descriptions or examples available on the NATS 4 API wiki for this API.
Description
- Get member information
Resource URL
- http://domain/api/member/details
- Replace domain with the nats domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params
- memberid
- optional
- session
- optional
- memberidx
- optional
- username
- optional
- siteid
- optional
- transactionid
- optional
- email
- optional
- status
- optional
- token_hash
- optional
- subscriptionid
- optional
- subscriptions
- optional
- transactions
- optional
- full_info
- optional
- all_data
- optional
- surfer_actions
- optional
- loginlogs
- optional
- notes
- optional
- member_data
- optional
- ident_details
- optional
- create_missing_sub
- optional
- igm_data
- as of NATS version 5.0.3.1
- optional
Example Request
Method: GET
URL: http://domain/api/member/details
Query String: memberid=3&username=test+username&siteid=1&email=test%40email.com
Response:
{ "memberid": "3", "identid": "4", "loginid": "0", "refurl_lookup_id": "2", "status": "1", "trial": "0", "joined": "1565382563", "expired": "0", "last_login": "1565382564", "stamp": "1565382564", "siteid": "1", "username": "test username", "password": "testPassword", "cryptpass": "d3695SDTr1h2k", "ip": "", "email": "test@email.com", "session": "4184eb9f9064c7b773c8dfd159505af4", "mailok": "1", "flat_price": "0", "first_login": "1565382564", "third_party_partner_id": "0", "cascadeid": "0", "cascade_item_id": "0", "token": "0", "original_username": "test username", "renamed": "0", "marked": "0", "token_hash": "f561384f9bf88197514d49fc321d5f85", "member_subscription_id": "3", "memberidx": "NATS:3", "billerid": "0", "statid": "75d4dd7a3ec43e", "cost": "0", "cost_charge": "0", "spent": "0", "refunded": "0", "charges": "0", "next_rebill": "0", "optionid": "0", "rebills": "0", "active": "1", "upgradeid": "", "expires": "1591329600", "nats_expires": "1591329600", "biller_expires": "0", "original_optionid": "0", "created_date": "1565382563", "ip_hex": "", "flagged": "0", "loginid_nice": false, "siteid_nice": "Membership Site A", "site_type": "0", "biller": false, "refurl": "No Referring URL" }
Example Code
PHP
<?php $headers = array( //set your username and API key here 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: tmm1phrvezsbu' ); $url = 'http://yourdomain.com'; //set your NATS URL here $data = Array( 'memberid' => '3', 'username' => 'test username', 'siteid' => 1, 'email' => 'test@email.com', ); $request = Array( 'method' => 'GET', 'path' => 'v1/member/details', 'data' => $data ); /*code below is the same for (almost) every API call */ $curl = curl_init(); $url = $url.'/api/'.$request['path']; $query = http_build_query($request['data']); if($request['method'] == 'GET'){ //add query string parameters to the end of the url $url = $url.'?'.$query; }else{ //send parameters as POST fields curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $query); if($request['method'] != 'POST'){ $headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method } } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $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); ?>