Difference between revisions of "NATS4 REST API Get Member Search Info String"
From TMM Wiki
Jump to navigationJump to searchLine 178: | Line 178: | ||
**'''''type: string''''' | **'''''type: string''''' | ||
**'''''optional''''' | **'''''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 | ||
*start_time: | *start_time: | ||
**'''''type: string''''' | **'''''type: string''''' | ||
**'''''optional''''' | **'''''optional''''' | ||
+ | **Note: If specify an Start time, you must specify Period=8 | ||
*end_time: | *end_time: | ||
**'''''type: string''''' | **'''''type: string''''' | ||
**'''''optional''''' | **'''''optional''''' | ||
+ | **Note: If specify an End time, you must specify Period=8 | ||
*count: | *count: | ||
Line 194: | Line 206: | ||
**'''''type: string''''' | **'''''type: string''''' | ||
**'''''optional''''' | **'''''optional''''' | ||
− | |||
== '''Example Request''' == | == '''Example Request''' == |
Revision as of 10:28, 29 July 2015
GET member/searchinfo
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/searchinfo
- Replace domain with the nats domain
- GET
Response Format
- JSON
- 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 CSV..
- username:
- type: string
- optional
- memberid:
- type: string
- optional
- email:
- type: string
- optional
- password:
- type: string
- optional
- status:
- type: string
- optional
- 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
- 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
- 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
Example Request
GET
http://domain/api/member/searchinfo
- 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/searchinfo?'.$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/searchinfo' 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/searchinfo', 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/searchinfo?memberid=191' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: tmm1phrvezsbu"