Difference between revisions of "NATS5 REST API Affiliate PATCH allsettings"
From TMM Wiki
Jump to navigationJump to search (Created page with "{{NATS4 Manual | show_api_admin_section = true }} == '''PATCH /affiliate/allsettings''' == '''Description''' * Update all affiliate settings '''Resource URL''' *<nowiki>http...") |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{NATS5 Manual |
− | | | + | | show_api_admin_affiliate_section = true |
}} | }} | ||
== '''PATCH /affiliate/allsettings''' == | == '''PATCH /affiliate/allsettings''' == | ||
+ | |||
'''Description''' | '''Description''' | ||
* Update all affiliate settings | * Update all affiliate settings | ||
Line 9: | Line 10: | ||
*Replace domain with the nats domain | *Replace domain with the nats domain | ||
− | '''[[ | + | '''[[NATS5_REST_API_Overview#Allowed_HTTP_Request_Methods|Request Method''']] |
*PATCH | *PATCH | ||
'''Response Format''' | '''Response Format''' | ||
*JSON | *JSON | ||
− | '''[[ | + | '''[[NATS5_REST_API_Overview#Authentication|Authentication]]''' |
*HTTP headers | *HTTP headers | ||
Line 37: | Line 38: | ||
* '''trust_level''' | * '''trust_level''' | ||
** type: digit | ** type: digit | ||
+ | ** optional | ||
+ | * '''payout_approval''' | ||
+ | ** type: boolean_digit (0 or 1) | ||
** optional | ** optional | ||
* '''custom1''' | * '''custom1''' | ||
Line 95: | Line 99: | ||
** optional | ** optional | ||
* '''allow_subscription_passthrough''' | * '''allow_subscription_passthrough''' | ||
− | ** type: boolean_digit | + | ** type: boolean_digit (0 or 1) |
** optional | ** optional | ||
* '''allow_option_force''' | * '''allow_option_force''' | ||
− | ** type: boolean_digit | + | ** type: boolean_digit (0 or 1) |
+ | ** optional | ||
+ | * '''remote_access''' | ||
+ | ** type: boolean_digit (0 or 1) | ||
+ | ** optional | ||
+ | * '''remote_adtool''' | ||
+ | ** type: boolean_digit (0 or 1) | ||
+ | ** optional | ||
+ | * '''remote_payment''' | ||
+ | ** type: boolean_digit (0 or 1) | ||
+ | ** optional | ||
+ | * '''language''' | ||
+ | ** type: string | ||
** optional | ** optional | ||
* '''unencoded''' | * '''unencoded''' | ||
Line 742: | Line 758: | ||
** optional | ** optional | ||
− | [[Category: | + | == '''Example Request''' == |
− | [[Category: | + | Method: '''PATCH'''<br/> |
+ | URL: <nowiki>http://domain/api/affiliate/allsettings</nowiki><br/> | ||
+ | Form Data:<br/> | ||
+ | * loginid: 3 | ||
+ | * reviewed: 0 | ||
+ | * firstname: test | ||
+ | * lastname: affiliate | ||
+ | * email: test@email.com | ||
+ | * company: TMM | ||
+ | * url: www.toomuchmedia.com | ||
+ | * tel: 666-666-6666 | ||
+ | * address1: 1 address street | ||
+ | * city: city | ||
+ | * state: NJ | ||
+ | * country: US | ||
+ | * zip_code: 66666 | ||
+ | * mailok: 1 | ||
+ | * allow_subscription_passthrough: 1 | ||
+ | * allow_option_force: 1 | ||
+ | * remote_access: 1 | ||
+ | * remote_adtool: 1 | ||
+ | * remote_payment: 1 | ||
+ | * language: en | ||
+ | |||
+ | Response: | ||
+ | <pre> | ||
+ | { | ||
+ | "result": 1, | ||
+ | "success": true | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == '''Example Code''' == | ||
+ | |||
+ | '''PHP''' | ||
+ | <pre> | ||
+ | <?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( | ||
+ | 'loginid' => '3', | ||
+ | 'reviewed' => 0, | ||
+ | 'firstname' => 'test', | ||
+ | 'lastname' => 'affiliate', | ||
+ | 'email' => 'test@email.com', | ||
+ | 'company' => 'TMM', | ||
+ | 'url' => 'www.toomuchmedia.com', | ||
+ | 'tel' => '666-666-6666', | ||
+ | 'address1' => '1 address street', | ||
+ | 'city' => 'city', | ||
+ | 'state' => 'NJ', | ||
+ | 'country' => 'US', | ||
+ | 'zip_code' => '66666', | ||
+ | 'mailok' => 1, | ||
+ | 'allow_subscription_passthrough' => 1, | ||
+ | 'allow_option_force' => 1, | ||
+ | 'remote_access' => 1, | ||
+ | 'remote_adtool' => 1, | ||
+ | 'remote_payment' => 1, | ||
+ | 'language' => 'en', | ||
+ | ); | ||
+ | |||
+ | $request = Array( | ||
+ | 'method' => 'PATCH', | ||
+ | 'path' => 'v1/affiliate/allsettings', | ||
+ | '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); | ||
+ | ?> | ||
+ | </pre> | ||
+ | |||
+ | [[Category:NATS5_REST_APIs]] | ||
+ | [[Category:NATS5_REST_affiliate_Collection]] | ||
[[Category:Autogenerated_Wiki_Article]]<!-- Remove this tag when customizing a wiki article. The article will no longer be automatically updated --> | [[Category:Autogenerated_Wiki_Article]]<!-- Remove this tag when customizing a wiki article. The article will no longer be automatically updated --> | ||
+ | [[Category:Autogenerated_Rest_Sample]]<!-- This article has a generated REST API Sample from our unit testing system. Also remove if customizing the wiki article --> |
Latest revision as of 15:58, 9 August 2019
PATCH /affiliate/allsettings
Description
- Update all affiliate settings
Resource URL
- http://domain/api/affiliate/allsettings
- Replace domain with the nats domain
- PATCH
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params
- loginid
- required
- reviewed
- type: digit
- optional
- invoicer
- type: digit
- optional
- req_docs
- type: digit
- optional
- w9
- type: digit
- optional
- trust_level
- type: digit
- optional
- payout_approval
- type: boolean_digit (0 or 1)
- optional
- custom1
- optional
- custom2
- optional
- custom3
- optional
- custom4
- optional
- custom5
- optional
- default_campaign
- type: digit
- optional
- default_program
- type: digit
- optional
- default_site
- type: digit
- optional
- inhouse
- type: digit
- optional
- firstname
- optional
- lastname
- optional
- email
- optional
- company
- optional
- url
- optional
- tel
- optional
- icq
- optional
- aim
- optional
- msn
- optional
- address1
- optional
- address2
- optional
- city
- optional
- state
- optional
- country
- optional
- zip_code
- optional
- tax_id_or_ssn
- optional
- mailok
- optional
- allow_subscription_passthrough
- type: boolean_digit (0 or 1)
- optional
- allow_option_force
- type: boolean_digit (0 or 1)
- optional
- remote_access
- type: boolean_digit (0 or 1)
- optional
- remote_adtool
- type: boolean_digit (0 or 1)
- optional
- remote_payment
- type: boolean_digit (0 or 1)
- optional
- language
- type: string
- optional
- unencoded
- type: digit
- optional
- startpage
- optional
- live_update_defaults
- type: digit
- optional
- flag1
- type: digit
- optional
- flag2
- type: digit
- optional
- flag3
- type: digit
- optional
- flag4
- type: digit
- optional
- flag5
- type: digit
- optional
- select1
- optional
- select2
- optional
- select3
- optional
- select4
- optional
- select5
- optional
- notify_password
- type: digit
- optional
- notify_payvia
- type: digit
- optional
- notify_payvia_info
- type: digit
- optional
- notify_defaults
- type: digit
- optional
- notify_details
- type: digit
- optional
- notify_settings
- type: digit
- optional
- notify_badlinkcode
- type: digit
- optional
- notify_member_change
- type: digit
- optional
- notify_member_voided
- type: digit
- optional
- notify_member_chargeback
- type: digit
- optional
- notify_member_credited
- type: digit
- optional
- notify_member_insufficient
- type: digit
- optional
- notify_member_cancelled
- type: digit
- optional
- notify_member_rebilled
- type: digit
- optional
- notify_member_joined
- type: digit
- optional
- notify_member_pre_joined
- type: digit
- optional
- notify_member_pending_joined
- type: digit
- optional
- notify_member_pre_rebilled
- type: digit
- optional
- notify_member_pending_rebilled
- type: digit
- optional
- notify_member_void_reversal
- type: digit
- optional
- notify_member_credit_reversal
- type: digit
- optional
- notify_member_chargeback_reversal
- type: digit
- optional
- notify_member_insufficient_reversal
- type: digit
- optional
- email_promotional
- type: digit
- optional
- email_on_notify
- type: digit
- optional
- email_on_member_change
- type: digit
- optional
- email_on_member_voided
- type: digit
- optional
- email_on_member_chargeback
- type: digit
- optional
- email_on_member_credited
- type: digit
- optional
- email_on_member_insufficient
- type: digit
- optional
- email_on_member_cancelled
- type: digit
- optional
- email_on_member_rebilled
- type: digit
- optional
- email_on_member_joined
- type: digit
- optional
- email_on_member_pre_joined
- type: digit
- optional
- email_on_member_pending_joined
- type: digit
- optional
- email_on_member_pre_rebilled
- type: digit
- optional
- email_on_member_pending_rebilled
- type: digit
- optional
- email_on_member_void_reversal
- type: digit
- optional
- email_on_member_credit_reversal
- type: digit
- optional
- email_on_member_chargeback_reversal
- type: digit
- optional
- email_on_member_insufficient_reversal
- type: digit
- optional
- verify_details
- type: digit
- optional
- verify_settings
- type: digit
- optional
- verify_defaults
- type: digit
- optional
- verify_payvia
- type: digit
- optional
- verify_payvia_info
- type: digit
- optional
- old_post_member_approval
- optional
- old_post_member_rebill
- optional
- old_post_member_upgrade
- optional
- old_post_member_expire
- optional
- old_post_member_insufficient_fund
- optional
- old_post_member_credit
- optional
- old_post_member_chargeback
- optional
- old_post_member_void
- optional
- old_post_member_upgradedeny
- optional
- old_post_member_change_details
- optional
- old_post_member_void_reversal
- optional
- old_post_member_credit_reversal
- optional
- old_post_member_chargeback_reversal
- optional
- old_post_member_insufficient_reversal
- optional
- old_post_member_pre_approval
- optional
- old_post_member_pre_rebill
- optional
- old_post_member_pending_approval
- optional
- old_post_member_pending_rebill
- optional
- default_stats_view
- type: digit
- optional
- default_stats_date_range
- type: digit
- optional
- default_stats_limit_site
- type: digit
- optional
- default_stats_limit_program
- type: digit
- optional
- default_stats_limit_campaign
- type: digit
- optional
- default_stats_small_map_1_data
- type: digit
- optional
- default_stats_small_map_2_data
- type: digit
- optional
- default_stats_pie_chart_1_data
- type: digit
- optional
- default_stats_pie_chart_2_data
- type: digit
- optional
- default_stats_pie_chart_3_data
- type: digit
- optional
- default_stats_pie_chart_4_data
- type: digit
- optional
- default_stats_pie_chart_5_data
- type: digit
- optional
- default_stats_pie_chart_1_break
- type: digit
- optional
- default_stats_pie_chart_2_break
- type: digit
- optional
- default_stats_pie_chart_3_break
- type: digit
- optional
- default_stats_pie_chart_4_break
- type: digit
- optional
- default_stats_pie_chart_5_break
- type: digit
- optional
- default_stats_mixed_chart_1_type
- type: digit
- optional
- default_stats_mixed_chart_2_type
- type: digit
- optional
- default_stats_mixed_chart_1_data
- type: digit
- optional
- default_stats_mixed_chart_2_data
- type: digit
- optional
- default_stats_multi_graph_data_1
- type: digit
- optional
- default_stats_multi_graph_data_2
- type: digit
- optional
- default_stats_multi_graph_data_3
- type: digit
- optional
- default_stats_large_map_data
- type: digit
- optional
- default_stats_comp_data
- type: digit
- optional
- default_stats_order
- type: digit
- optional
- default_stats_table_column1
- type: digit
- optional
- default_stats_table_column2
- type: digit
- optional
- default_stats_table_column3
- type: digit
- optional
- default_stats_table_column4
- type: digit
- optional
- default_stats_table_column5
- type: digit
- optional
- default_stats_table_column6
- type: digit
- optional
- default_stats_table_column7
- type: digit
- optional
- default_stats_table_column8
- type: digit
- optional
- default_stats_table_column9
- type: digit
- optional
- default_adtools_use_limits
- type: digit
- optional
- default_adtools_view
- type: digit
- optional
- default_adtools_cat_1_type
- type: digit
- optional
- default_adtools_cat_2_type
- type: digit
- optional
- default_adtools_cat_3_type
- type: digit
- optional
- default_adtools_cat_4_type
- type: digit
- optional
- default_adtools_cat_5_type
- type: digit
- optional
- default_adtools_publish_setting
- type: digit
- optional
- default_adtools_publish_date
- optional
- default_adtools_dump_separater
- type: digit
- optional
- default_adtools_dump_record_end
- type: digit
- optional
- default_adtools_dump_field_1
- type: digit
- optional
- default_adtools_dump_field_2
- type: digit
- optional
- default_adtools_dump_field_3
- type: digit
- optional
- default_adtools_dump_field_4
- type: digit
- optional
- default_adtools_dump_field_5
- type: digit
- optional
- default_adtools_dump_field_6
- type: digit
- optional
- default_adtools_dump_field_7
- type: digit
- optional
- default_adtools_dump_field_8
- type: digit
- optional
- default_news_announcement_section
- type: digit
- optional
- default_news_section
- type: digit
- optional
- default_news_count
- type: digit
- optional
- default_account_view
- type: digit
- optional
- default_account_changes_count
- type: digit
- optional
- default_account_changes_order
- type: digit
- optional
- default_account_campaign_count
- type: digit
- optional
- default_account_campaign_order
- type: digit
- optional
- default_adtools_dump_format
- type: digit
- optional
- email_on_message
- type: digit
- optional
- affiliate_contact1
- optional
- affiliate_contact2
- optional
- affiliate_contact3
- optional
- affiliate_contact4
- optional
- affiliate_contact5
- optional
- old_post_member_pending_ncr
- optional
- email_on_payment_stored
- type: digit
- optional
- email_on_payment_paid
- type: digit
- optional
- post_member_approval_disallow
- type: digit
- optional
- post_member_rebill_disallow
- type: digit
- optional
- post_member_upgrade_disallow
- type: digit
- optional
- post_member_expire_disallow
- type: digit
- optional
- post_member_insufficient_fund_disallow
- type: digit
- optional
- post_member_credit_disallow
- type: digit
- optional
- post_member_chargeback_disallow
- type: digit
- optional
- post_member_void_disallow
- type: digit
- optional
- post_member_upgradedeny_disallow
- type: digit
- optional
- post_member_change_details_disallow
- type: digit
- optional
- post_member_void_reversal_disallow
- type: digit
- optional
- post_member_credit_reversal_disallow
- type: digit
- optional
- post_member_chargeback_reversal_disallow
- type: digit
- optional
- post_member_insufficient_reversal_disallow
- type: digit
- optional
- post_member_pre_approval_disallow
- type: digit
- optional
- post_member_pre_rebill_disallow
- type: digit
- optional
- post_member_pending_approval_disallow
- type: digit
- optional
- post_member_pending_rebill_disallow
- type: digit
- optional
- post_member_perminute_allowed
- type: digit
- optional
- post_member_perminute_disallow
- type: digit
- optional
- post_member_seconds_allowed
- type: digit
- optional
- post_member_seconds_disallow
- type: digit
- optional
- post_member_initial_allowed
- type: digit
- optional
- post_member_initial_disallow
- type: digit
- optional
- post_member_trial_allowed
- type: digit
- optional
- post_member_trial_disallow
- type: digit
- optional
- post_member_insufficient_funds_reversal_allowed
- type: digit
- optional
- post_member_insufficient_funds_reversal_disallow
- type: digit
- optional
- post_member_pending_ncr_allowed
- type: digit
- optional
- post_member_pending_ncr_disallow
- type: digit
- optional
- post_extra_vars_campaignid_allowed
- type: digit
- optional
- post_extra_vars_programid_allowed
- type: digit
- optional
- post_extra_vars_siteid_allowed
- type: digit
- optional
- post_extra_vars_tourid_allowed
- type: digit
- optional
- post_extra_vars_optionid_allowed
- type: digit
- optional
- post_extra_vars_adtoolid_allowed
- type: digit
- optional
- post_extra_vars_subid1_allowed
- type: digit
- optional
- post_extra_vars_subid2_allowed
- type: digit
- optional
- post_extra_vars_billerid_allowed
- type: digit
- optional
- post_extra_vars_countryid_allowed
- type: digit
- optional
- post_extra_vars_promotionalid_allowed
- type: digit
- optional
- post_extra_vars_campaignid_disallow
- type: digit
- optional
- post_extra_vars_programid_disallow
- type: digit
- optional
- post_extra_vars_siteid_disallow
- type: digit
- optional
- post_extra_vars_tourid_disallow
- type: digit
- optional
- post_extra_vars_optionid_disallow
- type: digit
- optional
- post_extra_vars_adtoolid_disallow
- type: digit
- optional
- post_extra_vars_subid1_disallow
- type: digit
- optional
- post_extra_vars_subid2_disallow
- type: digit
- optional
- post_extra_vars_billerid_disallow
- type: digit
- optional
- post_extra_vars_countryid_disallow
- type: digit
- optional
- post_extra_vars_promotionalid_disallow
- type: digit
- optional
- post_member_approval_allowed
- type: digit
- optional
- post_member_rebill_allowed
- type: digit
- optional
- post_member_upgrade_allowed
- type: digit
- optional
- post_member_expire_allowed
- type: digit
- optional
- post_member_insufficient_fund_allowed
- type: digit
- optional
- post_member_credit_allowed
- type: digit
- optional
- post_member_chargeback_allowed
- type: digit
- optional
- post_member_void_allowed
- type: digit
- optional
- post_member_upgradedeny_allowed
- type: digit
- optional
- post_member_change_details_allowed
- type: digit
- optional
- post_member_void_reversal_allowed
- type: digit
- optional
- post_member_credit_reversal_allowed
- type: digit
- optional
- post_member_chargeback_reversal_allowed
- type: digit
- optional
- post_member_insufficient_reversal_allowed
- type: digit
- optional
- post_member_pre_approval_allowed
- type: digit
- optional
- post_member_pre_rebill_allowed
- type: digit
- optional
- post_member_pending_approval_allowed
- type: digit
- optional
- post_member_pending_rebill_allowed
- type: digit
- optional
- notify_member_conversion
- type: digit
- optional
- email_on_member_conversion
- type: digit
- optional
- left_sidebar_collapse
- type: digit
- optional
- default_admin_area
- type: digit
- optional
Example Request
Method: PATCH
URL: http://domain/api/affiliate/allsettings
Form Data:
- loginid: 3
- reviewed: 0
- firstname: test
- lastname: affiliate
- email: test@email.com
- company: TMM
- url: www.toomuchmedia.com
- tel: 666-666-6666
- address1: 1 address street
- city: city
- state: NJ
- country: US
- zip_code: 66666
- mailok: 1
- allow_subscription_passthrough: 1
- allow_option_force: 1
- remote_access: 1
- remote_adtool: 1
- remote_payment: 1
- language: en
Response:
{ "result": 1, "success": true }
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( 'loginid' => '3', 'reviewed' => 0, 'firstname' => 'test', 'lastname' => 'affiliate', 'email' => 'test@email.com', 'company' => 'TMM', 'url' => 'www.toomuchmedia.com', 'tel' => '666-666-6666', 'address1' => '1 address street', 'city' => 'city', 'state' => 'NJ', 'country' => 'US', 'zip_code' => '66666', 'mailok' => 1, 'allow_subscription_passthrough' => 1, 'allow_option_force' => 1, 'remote_access' => 1, 'remote_adtool' => 1, 'remote_payment' => 1, 'language' => 'en', ); $request = Array( 'method' => 'PATCH', 'path' => 'v1/affiliate/allsettings', '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); ?>