NATS5 REST API Affiliate GET current-permissions
From TMM Wiki
Jump to navigationJump to searchGET /affiliate/current-permissions
Description
- Get the permissions for your user account
Resource URL
- http://domain/api/affiliate/current-permissions
- Replace domain with the nats domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
None
Example Request
Method: GET
URL: http://domain/api/affiliate/current-permissions
Response:
{ "success": true, "permissions": { "overview": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "default": true, "mobile_affiliates": true, "mobile_all": true, "mobile_new_affiliates": true, "mobile_new_members": true, "mobile_programs": true, "mobile_sites": true, "mobile_summary": true, "original": true } }, "adtools": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "bulk": true, "bulk_update": true, "adtools": true, "edit": true, "edit_rule": true, "edit_type": true, "group": true, "search": true, "set_cotd_content": true, "set_gbcontent": true, "set_gbtemplates": true, "stop_bulk": true }, "some_actions": true, "action": { "add_cotd_content": true, "add_category": true, "add_assoc": true, "add_type_field_mc_option": true, "add_new_group": true, "add_rule": true, "add_type": true, "add_type_field": true, "bulk_import": true, "bulk_update": true, "move": true, "delete_cotd_content": true, "delete_category": true, "delete_group": true, "delete_mc_option": true, "delete_type": true, "delete_type_field": true, "disable_adtool": true, "disable_cotd_content": true, "disable_rule": true, "edit_adtool": true, "edit_category": true, "edit_group": true, "edit_mc_option": true, "edit_rule": true, "edit_type": true, "edit_type_field": true, "enable_adtool": true, "enable_cotd_content": true, "new_adtool": true, "remove_assoc": true, "set_cotd_current_content": true, "set_gbmatches": true, "sort": true, "undelete_category": true, "undelete_mc_option": true, "undelete_type": true, "undelete_type_field": true } }, "affiliates": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "add_sale": true, "account_access": true, "account_changes": true, "affiliate_documents": true, "affiliate_overview": true, "affiliate_payout_period": true, "affiliate_twofactor": true, "loginlog": true, "affiliate_approve": true, "change_pass": true, "affiliate_edit": true, "manual_invoices": true, "affiliate_status": true, "email_csv_dump": true }, "some_actions": true, "action": { "document_add": true, "invoice_add": true, "add_sale": true, "note_new": true, "add_affiliate": true, "access_custom": true, "affiliate_twofactor": true, "account_changes": true, "approve_deny": true, "access_save": true, "affiliate_change_api_key": true, "change_pass": true, "affiliate_delete": true, "document_delete": true, "invoice_delete": true, "document_get": true, "edit_save": true, "invoice_edit": true, "payout_period_enable": true, "affiliate_clear_rep": true, "affiliate_clear_referrer": true, "affiliate_restore": true, "affiliate_assign_rep": true, "set_payout_period": true, "update_status": true, "affiliate_assign_ref": true } }, "billers": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "add_cascade": true, "biller_charges": true, "tax": true, "cascade_rules": true, "poll_status": true }, "some_actions": true, "action": { "add_biller": true, "add_cascade": true, "add_cascade_rule": true, "set_tax": true, "delete_biller": true, "delete_biller_charge": true, "delete_cascade": true, "delete_cascade_step": true, "delete_tax": true, "disable_cascade_rule": true, "edit_biller": true, "edit_cascade": true, "edit_cascade_rule": true, "edit_cascade_step": true, "down_cascade_step": true, "up_cascade_step": true, "new_cascade_step": true, "set_biller_charge": true, "restore_biller": true, "restore_cascade": true } }, "commissions": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "add": true, "edit_change": true, "changes": true }, "some_actions": true, "action": { "add": true, "add_tier": true, "delete_change": true, "delete_tier": true, "edit": true, "move": true, "save_change": true, "save_tier": true } }, "config": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "affiliate_default_settings": true, "affiliates": true, "currency - all": true, "billers": true, "cronjobs": true, "display": true, "emails": true, "external programs": true, "fraud": true, "logging": true, "home": true, "misc": true, "notifications": true, "postback": true, "security": true, "surfer": true, "third party": true, "currency - used": true }, "some_actions": true, "action": { "revert": true, "save": true, "update_affiliates": true } }, "global": { "editable": true, "some_actions": true, "action": { "edit_affiliate": true, "restrict_member_view": false }, "setting": { "affiliate_override": { "disabled": false, "all_affiliates": true, "my_affiliates": false, "my_network": false } } }, "includes": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "edit_chain": true, "edit_rule": true, "edit_step": true, "rules": true, "steps": true }, "some_actions": true, "action": { "add": true, "add_rule": true, "add_step": true, "delete": true, "delete_rule": true, "delete_step": true, "edit": true, "edit_rule": true, "edit_step": true, "undelete": true, "undelete_step": true } }, "codes": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "links": true, "strack": true }, "some_actions": false }, "logging": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "admin_actions": true, "view_log": true }, "some_actions": true, "action": { "search_log": true } }, "mails": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "queue": true, "remove": true, "mail": true }, "some_actions": true, "action": { "add": true, "add_rule": true, "delete": true, "delete_queue_mail": true, "disable_rule": true, "edit": true, "edit_rule": true, "removelist_save": true, "reset": true, "undelete_queue_mail": true, "retry_queue_mail": true, "send": true, "send_test": true } }, "cleanup": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "clean_log": true, "clean_table": true, "cron": true, "errors": true, "fix_error": true, "logs": true, "status": true, "reports": true, "build_report": true, "view_table": true }, "some_actions": true, "action": { "build_report": true, "clean_log": true, "remove_log": true, "clean_table": true, "clear_cache": true, "remove_error": true, "resolve_error": true } }, "members": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "add": true, "edit": true, "member": true, "email_csv_dump": true, "full_csv_dump": true }, "some_actions": true, "action": { "add": true, "new_note": true, "delete": true, "delete_note": true, "edit": true, "lock_member": true, "mark": true, "unlock_member": true } }, "network": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": false, "some_actions": true, "action": { "add_network": true, "save_changes": true } }, "news": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "new_news": true, "edit": true, "notifications": true, "reply_message": true, "send_message": true, "send_note": true, "messages": true, "view": true, "view_note": true }, "some_actions": true, "action": { "add": true, "add_section": true, "delete_all": true, "delete": true, "delete_note": true, "del_section": true, "edit": true, "mark_all_read": true, "mark_all_unread": true, "unviewed": true, "viewed": true, "reply_message": true, "undelete_all": true, "send_message": true, "send_note": true, "undelete_note": true } }, "payments": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "edit_dump": true, "edit_payvia_field_mc": true, "edit_open_payments": true, "edit_payout_period": true, "edit_payvia": true, "edit_payvia_field": true, "edit_payvia_field_mc_details": true, "edit_payvia_rule": true, "edit_payvia_setup": true, "dumps": true, "payout_periods": true, "payout_periods_set_affiliates": true, "payvia_rules": true, "auto": true, "view_dump": true, "view_payment_dump": true, "payvia": true }, "some_actions": true, "action": { "add_dump": true, "add_payvia_field_mc": true, "add_payout_period": true, "add_payvia": true, "add_payvia_field": true, "add_payvia_rule": true, "bulk_changes": true, "copy_dump": true, "delete_payout_period": true, "payvia_field_mc_disable": true, "disable_payvia": true, "payvia_field_disable": true, "disable_payvia_rule": true, "edit_dump": true, "edit_payvia_field_mc": true, "edit_payment": true, "edit_payout_period": true, "edit_payvia": true, "edit_payvia_field": true, "edit_payvia_rule": true, "payvia_field_mc_enable": true, "enable_payvia": true, "payvia_field_enable": true, "mark_as_paid": true, "payvia_field_mc_move_down": true, "payvia_field_move_down": true, "payvia_field_mc_move_up": true, "payvia_field_move_up": true, "payout_period_default": true, "payout_periods_set_affiliates": true, "restore_payout_period": true, "store_open_payments": true, "store_open_payment": true, "unstore_stored_payment": true, "unstore_payments": true } }, "programs": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "add": true, "edit": true, "set_affiliates": true, "list_disabled": true, "list_enabled": true }, "some_actions": true, "action": { "add_tour_all": true, "add": true, "add_tour": true, "change_disabled": true, "change_enabled": true, "delete": true, "disable": true, "edit_payout": true, "edit": true, "enable": true, "remove_tour_all": true, "remove_tour": true } }, "promotionals": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "edit_promotional": true, "promotional_link": true, "promotional_rules": true }, "some_actions": true, "action": { "add_promotional": true, "add_rule": true, "delete_promotional": true, "disable_rule": true, "edit_promotional": true, "edit_rule": true, "restore_promotional": true } }, "reporting": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "acct_rep": true, "actual_affiliate_payments": true, "misc": true, "affiliate_ratios": true, "wm_join": true, "referral": true, "cascade": true, "detail_trial": true, "fraud": true, "graphical_affiliate_comparison": true, "payments_withheld": true, "pending_transaction": true, "profit_loss": true, "related_transaction": true, "retention": true, "single_day_comparison": true, "subscription": true, "surfer": true, "transaction": true }, "some_actions": true, "action": { "edit_focus": true, "edit_report": true } }, "rewards": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "points": true, "shipped": true, "unshipped": true }, "some_actions": true, "action": { "add_cat": true, "add_point_change": true, "add": true, "delete_cat": true, "delete": true, "delete_change": true, "edit_points": true, "edit": true, "move": true, "refund": true, "ship": true, "undelete_cat": true, "undelete": true, "unship": true } }, "sites_templates": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "edit": true, "preview": true }, "some_actions": true, "action": { "copy": true, "customize_edit": true, "revert": true, "save": true } }, "sites": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "add": true, "add_group": true, "coupon_revisions": true, "edit_coupon": true, "edit": true, "edit_group": true, "edit_tour": true, "options": true, "partners": true, "programs": true, "redirects": true, "special_options": true, "css_colors": true, "coupons": true, "groups": true }, "some_actions": true, "action": { "add_color": true, "add_coupon": true, "add_group": true, "add_option": true, "add_option_rule": true, "add_redirect": true, "add_redirect_rule": true, "add": true, "add_partner": true, "add_tour": true, "delete_group": true, "delete_option": true, "delete_redirect": true, "delete": true, "delete_partner": true, "delete_tour": true, "disable_option_rule": true, "disable_redirect_rule": true, "edit_coupon": true, "edit_programs": true, "edit_group": true, "edit_option": true, "edit_option_rule": true, "edit_redirect": true, "edit_redirect_rule": true, "edit": true, "edit_partner": true, "edit_tour": true, "edit_tour_options": true, "move": true, "undelete_group": true, "revert_field": true, "revert_tour_option": true, "set_colors": true, "undelete_option": true, "undelete_redirect": true, "undelete": true, "undelete_partner": true, "undelete_tour": true } }, "skins_templates": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "css_colors": true, "edit": true, "templates": true, "export": true, "import": true, "preview_recovery": true, "preview": true, "read": true, "special_templates": true, "themes": true }, "some_actions": true, "action": { "add_color": true, "add_skin": true, "add": true, "copy": true, "create_palette": true, "customize": true, "del_skin": true, "edit_skin": true, "export_run": true, "flush": true, "import_add": true, "recover": true, "revert": true, "save_defaults": true, "save": true, "set_colors": true, "set_palette": true } }, "support": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "admin_areas": true, "change_log": true }, "some_actions": true, "action": { "delete_link": true, "edit_link": true, "new_link": true } }, "third_party": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "biller_charges": true, "poll_status": true }, "some_actions": true, "action": { "add_biller": true, "delete_biller": true, "delete_biller_charge": true, "edit_biller": true, "set_biller_charge": true, "restore_biller": true } }, "upsells": { "display": true, "all_views": true, "all_actions": true, "editable": true, "some_views": true, "view": { "incoming_xsells": true, "incoming_upsells": true, "outgoing_xsells": true, "outgoing_upsells": true }, "some_actions": true, "action": { "add_rule": true, "add": true, "delete": true, "disable_rule": true, "edit_rule": true, "edit": true, "move": true, "undelete": true } }, "ajax": { "all_actions": 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(); $request = Array( 'method' => 'GET', 'path' => 'v1/affiliate/current-permissions', '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); ?>