Difference between revisions of "NATS4 REST API Get Member Search Info String"

From TMM Wiki
Jump to navigationJump to search
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
| show_api_admin_section = true
 
| show_api_admin_section = true
 
}}
 
}}
== '''GET member/searchinfo''' ==
+
== '''GET member/search''' ==
 
'''Description'''  
 
'''Description'''  
 
*[[NATS4]] supports an API resource to get a CSV result for members. The result is a comma separated value string.  
 
*[[NATS4]] supports an API resource to get a CSV result for members. The result is a comma separated value string.  
Line 8: Line 8:
  
 
'''Resource URL'''
 
'''Resource URL'''
*<nowiki>http://domain/api/member/searchinfo</nowiki>
+
*<nowiki>http://domain/api/member/search</nowiki>
 
*Replace domain with the nats domain
 
*Replace domain with the nats domain
  
Line 22: Line 22:
 
== '''Parameters''' ==
 
== '''Parameters''' ==
  
'''''Paremeters can be sent as url encoded params. All parameters are optional so if none are entered, all member information will be displayed in the form of a CSV.''.'''
+
'''''Paremeters can be sent as url encoded params. All parameters are optional so if none are entered, all member information will be displayed in the form of a JSON.''.'''
  
 
*username:  
 
*username:  
Line 43: Line 43:
 
**'''''type: string'''''
 
**'''''type: string'''''
 
**'''''optional'''''
 
**'''''optional'''''
 +
**'''''Most common possible values:'''''
 +
***0 => never joined
 +
***1 => active
 +
***2 => expired
  
 
*firstname:  
 
*firstname:  
Line 135: Line 139:
 
**'''''type: string'''''
 
**'''''type: string'''''
 
**'''''optional'''''
 
**'''''optional'''''
 +
**'''''Most common possible values:'''''
 +
***1 => initial
 +
***2 => rebill
 +
***3 => trial
 +
***4 => credit
 +
***5 => conversion
 +
***6 => chargeback
 +
***7 => manual
 +
***8 => seconds
 +
***9 => expire
 +
***10 => cancel
 +
***11 => impression_trans
 +
***12 => visitor_trans
 +
***13 => qualified_trans
 +
***14 => join_hits_trans
 +
***15 => join_submits_trans
 +
***19 => void
 +
***24 => pending_initial
 +
***25 => pending_rebill
 +
***26 => pending_trial
 +
***27 => pending_conversion
 +
***28 => insufficient_funds
 +
***29 => manual_trial
 +
***30 => credit_reversal
 +
***31 => chargeback_reversal
 +
***32 => void_reversal
 +
***33 => insufficient_funds_reversal
 +
***34 => pre_initial
 +
***35 => pre_rebill
 +
***36 => pre_trial
 +
***37 => pre_conversion
 +
***38 => no_cost_registration
  
 
*nats_transaction_id:  
 
*nats_transaction_id:  
Line 188: Line 224:
 
***7 => All Time
 
***7 => All Time
 
***8 => Free Form
 
***8 => Free Form
 +
***9 => Unix Timestamp (raw value)
  
 
*start_time:  
 
*start_time:  
Line 204: Line 241:
  
 
*orderby:  
 
*orderby:  
 +
**'''''type: string'''''
 +
**'''''optional'''''
 +
 +
*start: ''Note: When using start without setting count, count will be set to 100''
 
**'''''type: string'''''
 
**'''''type: string'''''
 
**'''''optional'''''
 
**'''''optional'''''
Line 211: Line 252:
 
'''GET'''
 
'''GET'''
  
<nowiki>http://domain/api/member/searchinfo</nowiki>
+
<nowiki>http://domain/api/member/search</nowiki>
  
 
*Response on success:  
 
*Response on success:  
Line 234: Line 275:
  
 
$data_string = http_build_query($data);
 
$data_string = http_build_query($data);
$url = 'http://domain/api/member/searchinfo?'.$data_string;
+
$url = 'http://domain/api/member/search?'.$data_string;
  
 
$headers = array(
 
$headers = array(
Line 259: Line 300:
 
import json
 
import json
  
url = 'http://domain/api/member/searchinfo'
+
url = 'http://domain/api/member/search'
  
 
payload = {
 
payload = {
Line 281: Line 322:
  
 
var options = {
 
var options = {
     url: 'http://domain/api/member/searchinfo',
+
     url: 'http://domain/api/member/search',
 
     method: 'GET',
 
     method: 'GET',
 
     qs: {
 
     qs: {
Line 310: Line 351:
 
'''Curl'''
 
'''Curl'''
 
<pre>
 
<pre>
curl -X GET 'http://domain/api/member/searchinfo?memberid=191' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: tmm1phrvezsbu"
+
curl -X GET 'http://domain/api/member/search?memberid=191' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: tmm1phrvezsbu"
 
</pre>
 
</pre>
  
  
 
[[Category:NATS4 API Articles]]
 
[[Category:NATS4 API Articles]]

Latest revision as of 10:18, 17 January 2018

NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers
SOAP API
API
API Best Practices
WSDL Cache
Add Affiliate
Add Member Note
Admin Get Adtools
Adtool Categories
Adtool Types
Affiliate Get Campaigns
Bulk Import Adtools
Caching
Decode Natscode
Expire Manual Member
Get Affiliate Campaigns
Get Affiliate Hit Data
Get Affiliate Loginids
Get Affiliate Nats Codes
Get Affiliate Payout
Get Affiliate Program Campaign List
Get_Affiliate_Program_Campaign_List
Get Member Details
Get Member Instant Upgrade String
Get Member Package Upgrade String
Get Member Token Rebuy String
Get Member Upsell String
Get Payment Data
Get Payvia Rule
Get Profit Loss Report
Ping
Record Member Login
Search Affiliate Info
Search Member Info
Send Email API Function
Set Affiliate Admin Settings
Set Affiliate Customs
Set Affiliate Defaults
Set Affiliate Information
Set Affiliate Settings
Set Member Details
Set Payment Status
Set Payvia Rule
REST API
API Overview
API Best Practices
REST API PATH UPDATES
Adtools
GET /adtools/admin
GET /adtools/categories
GET /adtools/types
POST /adtools/importdump
Affiliate
GET /affiliate/campaigns
GET /affiliate/hitdata
GET /affiliate/payout
GET /affiliate/searchinfo
POST /affiliate/addaffiliate
POST /affiliate/invoice
PATCH /affiliate/setadminsettings
PATCH /affiliate/setcustoms
PATCH /affiliate/setdefaults
PATCH /affiliate/setinformation
PATCH /affiliate/setpayviainfo
PATCH /affiliate/setsettings
PATCH /affiliate/status
Member
GET /member/authstring
GET /member/details
GET /member/searchinfo
GET /suggestedcanceloffers
PATCH /member/setdetails
PATCH /member/setexpiration
POST /member/addnote
POST /member/recordlogin
PUT /member/expiremanual
PATCH /member/forget
Option
GET /option/options
GET /option/rule
PATCH /option/rule
PATCH/option/text
POST /option/rule
Payments
GET /payments/getpayments
GET /payviarule
PATCH /payments/setstatus
PATCH /payviarule
Report
GET /profitlossreport
Get /transactionpayouts
GET /report/transaction
Service
GET /service/decodenatscode
GET /service/ping
POST /service/sendemail

GET member/search

Description

  • NATS4 supports an API resource to get a CSV result for members. The result is a comma separated value string.


Resource URL

  • http://domain/api/member/search
  • Replace domain with the nats domain

Request Method

  • GET

Response Format

  • JSON

Authentication

  • HTTP headers

Parameters

Paremeters can be sent as url encoded params. All parameters are optional so if none are entered, all member information will be displayed in the form of a JSON..

  • username:
    • type: string
    • optional
  • memberid:
    • type: string
    • optional
  • email:
    • type: string
    • optional
  • password:
    • type: string
    • optional
  • status:
    • type: string
    • optional
    • Most common possible values:
      • 0 => never joined
      • 1 => active
      • 2 => expired
  • firstname:
    • type: string
    • optional
  • loginip:
    • type: string
    • optional
  • marked:
    • type: string
    • optional
  • lastname:
    • type: string
    • optional
  • address1:
    • type: string
    • optional
  • zip:
    • type: string
    • optional
  • city:
    • type: string
    • optional
  • address2:
    • type: string
    • optional
  • state:
    • type: string
    • optional
  • country:
    • type: string
    • optional
  • mailok:
    • type: string
    • optional
  • custom1:
    • type: string
    • optional
  • custom2:
    • type: string
    • optional
  • custom3:
    • type: string
    • optional
  • custom4:
    • type: string
    • optional
  • custom5:
    • type: string
    • optional
  • statid:
    • type: string
    • optional
  • subscription:
    • type: string
    • optional
  • billerid:
    • type: string
    • optional
  • cascadeid:
    • type: string
    • optional
  • biller_transid:
    • type: string
    • optional
  • ip:
    • type: string
    • optional
  • trans_type_id:
    • type: string
    • optional
    • Most common possible values:
      • 1 => initial
      • 2 => rebill
      • 3 => trial
      • 4 => credit
      • 5 => conversion
      • 6 => chargeback
      • 7 => manual
      • 8 => seconds
      • 9 => expire
      • 10 => cancel
      • 11 => impression_trans
      • 12 => visitor_trans
      • 13 => qualified_trans
      • 14 => join_hits_trans
      • 15 => join_submits_trans
      • 19 => void
      • 24 => pending_initial
      • 25 => pending_rebill
      • 26 => pending_trial
      • 27 => pending_conversion
      • 28 => insufficient_funds
      • 29 => manual_trial
      • 30 => credit_reversal
      • 31 => chargeback_reversal
      • 32 => void_reversal
      • 33 => insufficient_funds_reversal
      • 34 => pre_initial
      • 35 => pre_rebill
      • 36 => pre_trial
      • 37 => pre_conversion
      • 38 => no_cost_registration
  • nats_transaction_id:
    • type: string
    • optional
  • siteid:
    • type: string
    • optional
  • tourid:
    • type: string
    • optional
  • optionid:
    • type: string
    • optional
  • affiliate:
    • type: string
    • optional
  • loginid:
    • type: string
    • optional
  • natscode:
    • type: string
    • optional
  • programid:
    • type: string
    • optional
  • subid1:
    • type: string
    • optional
  • subid2:
    • type: string
    • optional
  • period:
    • type: string
    • optional
    • Possible values:
      • 0 => This Period
      • 1 => Last Period
      • 2 => Today
      • 3 => Yesterday
      • 4 => This Week
      • 5 => This Month
      • 6 => This Year
      • 7 => All Time
      • 8 => Free Form
      • 9 => Unix Timestamp (raw value)
  • start_time:
    • type: string
    • optional
    • Note: If specify an Start time, you must specify Period=8
  • end_time:
    • type: string
    • optional
    • Note: If specify an End time, you must specify Period=8
  • count:
    • type: string
    • optional
  • orderby:
    • type: string
    • optional
  • start: Note: When using start without setting count, count will be set to 100
    • type: string
    • optional

Example Request

GET

http://domain/api/member/search

  • Response on success:
"memberid","identid","loginid","networkid","refurl_lookup_id","status","trial","joined","expired","last_login","stamp","siteid","username","password","cryptpass","ip","email","session","mailok","flat_price","first_login","third_party_partner_id","cascadeid","cascade_item_id","token","original_username","renamed","marked","token_hash","firstname","lastname","address1","address2","zip","city","country","state","shipping_firstname","shipping_lastname","shipping_address1","shipping_address2","shipping_zip","shipping_city","shipping_country","shipping_state","phone","xsell_success","xsell_message","custom1","custom2","custom3","custom4","custom5","last_modified","member_subscription_id","memberidx","billerid","statid","cost","cost_charge","spent","refunded","charges","next_rebill","optionid","rebills","active","upgradeid","expires","nats_expires","biller_expires","original_optionid","created_date","loginid_assigned","identid_assigned","gateway_token","passthrough1","passthrough2","passthrough3","passthrough4","passthrough5","campaignid","programid","tourid","adtoolid","subid1","subid2","countryid","promotionalid","loginid_nice"
"191","24","1","0","2","2","0","1406911271","0","1426369483","1426475009","1","chrometest6","bakllzasdf","eda2Maqx0IPt2","168430255","asdf@asdf.com","fb6a5cc872353766d98e4642768a1617","1","0","1426368048","0","2","16","0","chrometest6","0","0","75c00099d4c1ffba3977391e319c01e6","Test","asdfsadf","asdfsadf","asdfasd","66666","asdfasdf","US","asdfsad","","","","","","","","","","0","","","","","","","0","219","NETBILLING:112075379434","4","653dbc302e46fb","0","0","33300","0","1","1435768871","5","0","1","","0","0","0","5","1406911234","0","0","112075199231","","","","","","0","3","1","0","0","0","0","0","tmm1phrvezsbu"

This result can be imported into your spread sheet program.

Example Code

PHP

<?php
$curl = curl_init();

$data = array(
    'memberid' => '191',
);

$data_string = http_build_query($data);
$url = 'http://domain/api/member/search?'.$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
import json

url = 'http://domain/api/member/search'

payload = {
    'memberid': 191
}

headers = {
        'api-key': '44b5498dbcb481a0d00b404c0169af62',
        'api-username': 'tmm1phrvezsbu'
}

res = requests.get(url, params=payload, 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/search',
    method: 'GET',
    qs: {
        'memberid': 191
    },
    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/search?memberid=191' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: tmm1phrvezsbu"