Difference between revisions of "Offerit REST API Check Orderid Exists"
From Offerit
OfferitRob (talk | contribs) |
OfferitRob (talk | contribs) |
||
Line 2: | Line 2: | ||
| show_api_admin_section = true | | show_api_admin_section = true | ||
}} | }} | ||
− | + | == '''POST /affiliate/affiliate_login_ips''' == | |
− | == ''' | ||
'''Description''' | '''Description''' | ||
− | *Offerit | + | *This [[Offerit]] API function allows you to pull a list of ips that affiliates have logged in from. |
− | |||
'''Resource URL''' | '''Resource URL''' | ||
− | *<nowiki>http://domain/api/ | + | *<nowiki>http://domain/api//affiliate/affiliate_login_ips</nowiki> |
*Replace domain with the Offerit domain | *Replace domain with the Offerit domain | ||
'''[[Offerit_REST_API_Overview#Allowed_HTTP_Request_Methods|Request Method''']] | '''[[Offerit_REST_API_Overview#Allowed_HTTP_Request_Methods|Request Method''']] | ||
− | * | + | *POST |
'''Response Format''' | '''Response Format''' | ||
Line 22: | Line 20: | ||
== '''Parameters''' == | == '''Parameters''' == | ||
− | |||
− | == ''' | + | '''''Paremeters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded''' |
− | * | + | * all parameters are optional for this call |
− | + | ||
− | + | *loginid | |
− | + | **'''''type: integer''''' | |
+ | *loginid_list | ||
+ | **'''''type: array''''' | ||
+ | *username | ||
+ | **'''''type: string''''' | ||
+ | *username_list | ||
+ | **'''''type: array''''' | ||
+ | *return_type | ||
+ | **'''''type: string''''' | ||
+ | **''''' loginid or username, determines the key index that is returned from the function ''''' | ||
+ | |||
+ | |||
+ | == '''Example Request''' == | ||
+ | |||
+ | '''POST''' | ||
+ | |||
+ | <nowiki>http://domain/api/affiliate/affiliate_login_ips</nowiki> | ||
+ | |||
+ | *Response: | ||
+ | <pre> | ||
+ | [ | ||
+ | {"result":"success","message":{"3":{"74.105.95.43":["2015-08-06 03:35:41"],"75.99.182.234":["2016-06-06 15:46:31","2016-06-06 10:40:49","2016-06-01 12:11:09","2016-05-12 11:56:31","2016-01-25 16:01:03","2016-01-07 11:43:31","2015-10-12 10:58:31","2015-07-31 23:09:43","2015-07-29 12:16:10","2015-04-02 13:03:05","2015-03-09 17:14:44","2015-03-06 13:08:51","2015-02-23 17:13:12","2015-02-10 16:14:33","2015-02-10 16:10:25","2015-02-10 16:00:08"],"74.102.35.46":["2015-03-13 23:25:57","2015-03-13 23:22:40"],"98.109.57.8":["2012-08-12 21:23:06"]}}} | ||
+ | ] | ||
+ | </pre> | ||
== '''Example Code''' == | == '''Example Code''' == | ||
+ | |||
'''PHP''' | '''PHP''' | ||
<pre> | <pre> | ||
Line 37: | Line 58: | ||
$data = array( | $data = array( | ||
− | ' | + | 'username' => 'productsupport', |
+ | 'return_type' => 'loginid' | ||
); | ); | ||
− | + | $url = 'http://domain/api/affiliate/affiliate_login_ips'; | |
− | $url = 'http://domain/api/ | ||
$headers = array( | $headers = array( | ||
Line 47: | Line 68: | ||
'api-username: productsupport' | 'api-username: productsupport' | ||
); | ); | ||
+ | |||
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); | curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); | ||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | ||
curl_setopt($curl, CURLOPT_URL, $url); | curl_setopt($curl, CURLOPT_URL, $url); | ||
+ | curl_setopt($curl, CURLOPT_POST, 1); | ||
+ | curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); | ||
$resp = curl_exec($curl); | $resp = curl_exec($curl); | ||
Line 57: | Line 81: | ||
curl_close($curl); | curl_close($curl); | ||
?> | ?> | ||
+ | |||
+ | ?> | ||
+ | |||
</pre> | </pre> | ||
− | |||
[[Category:Offerit API Articles]] | [[Category:Offerit API Articles]] |
Revision as of 14:54, 6 June 2016
POST /affiliate/affiliate_login_ips
Description
- This Offerit API function allows you to pull a list of ips that affiliates have logged in from.
Resource URL
- http://domain/api//affiliate/affiliate_login_ips
- Replace domain with the Offerit domain
- POST
Response Format
- JSON
- HTTP headers
Parameters
Paremeters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded
- all parameters are optional for this call
- loginid
- type: integer
- loginid_list
- type: array
- username
- type: string
- username_list
- type: array
- return_type
- type: string
- loginid or username, determines the key index that is returned from the function
Example Request
POST
http://domain/api/affiliate/affiliate_login_ips
- Response:
[ {"result":"success","message":{"3":{"74.105.95.43":["2015-08-06 03:35:41"],"75.99.182.234":["2016-06-06 15:46:31","2016-06-06 10:40:49","2016-06-01 12:11:09","2016-05-12 11:56:31","2016-01-25 16:01:03","2016-01-07 11:43:31","2015-10-12 10:58:31","2015-07-31 23:09:43","2015-07-29 12:16:10","2015-04-02 13:03:05","2015-03-09 17:14:44","2015-03-06 13:08:51","2015-02-23 17:13:12","2015-02-10 16:14:33","2015-02-10 16:10:25","2015-02-10 16:00:08"],"74.102.35.46":["2015-03-13 23:25:57","2015-03-13 23:22:40"],"98.109.57.8":["2012-08-12 21:23:06"]}}} ]
Example Code
PHP
<?php $curl = curl_init(); $data = array( 'username' => 'productsupport', 'return_type' => 'loginid' ); $url = 'http://domain/api/affiliate/affiliate_login_ips'; $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: productsupport' ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); $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); ?> ?>