Difference between revisions of "NATS5 REST API Config GET section"
From TMM Wiki
Jump to navigationJump to search (Created page with "{{NATS4 Manual | show_api_admin_section = true }} == '''GET /config/section''' == '''Description''' * Get config section details '''Resource URL''' *<nowiki>http://domain/ap...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{NATS5 Manual |
− | | | + | | show_api_admin_config_section = true |
}} | }} | ||
== '''GET /config/section''' == | == '''GET /config/section''' == | ||
+ | |||
'''Description''' | '''Description''' | ||
* Get config section details | * Get config section details | ||
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''']] |
*GET | *GET | ||
'''Response Format''' | '''Response Format''' | ||
*JSON | *JSON | ||
− | '''[[ | + | '''[[NATS5_REST_API_Overview#Authentication|Authentication]]''' |
*HTTP headers | *HTTP headers | ||
Line 25: | Line 26: | ||
** required | ** required | ||
− | [[Category: | + | == '''Example Request''' == |
− | [[Category: | + | Method: '''GET'''<br/> |
+ | URL: <nowiki>http://domain/api/config/section</nowiki><br/> | ||
+ | Query String: <nowiki>section=affiliates</nowiki><br/> | ||
+ | |||
+ | Response: | ||
+ | <pre> | ||
+ | { | ||
+ | "success": true, | ||
+ | "section": "affiliates", | ||
+ | "headers": [ | ||
+ | { | ||
+ | "key": "Signup", | ||
+ | "name": "Signup", | ||
+ | "desc": null, | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Require affiliate to verify signup with e-mail.", | ||
+ | "type": "checkbox", | ||
+ | "key": "RESELLER_VERIFY", | ||
+ | "name": "Reseller Verify", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require affiliate accounts to be manually activated.", | ||
+ | "type": "checkbox", | ||
+ | "key": "RESELLER_MANUAL_ACTIVATION", | ||
+ | "name": "Reseller Manual Activation", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require new affiliates to fill in a password (set here) in order to sign up.", | ||
+ | "type": "text", | ||
+ | "size": 40, | ||
+ | "key": "CLOSED_AFFILIATE_SIGNUP", | ||
+ | "name": "Closed Affiliate Signup", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Pull the account rep from the natscode.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ACCOUNT_REP_NATSCODE", | ||
+ | "name": "Account Rep Natscode", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow the account rep to also be the referring affiliate.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ACCOUNT_REP_NATSCODE_AS_REF", | ||
+ | "name": "Account Rep Natscode As Ref", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Assign a random account rep.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ASSIGN_RANDOM_ACCOUNT_REPS", | ||
+ | "name": "Assign Random Account Reps", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Comma delimited list of email accounts that can be used for multiple affiliate accounts", | ||
+ | "implode_array": 1, | ||
+ | "size": "40", | ||
+ | "key": "AFFILIATE_NON_UNIQUE_EMAILS", | ||
+ | "name": "Affiliate Non Unique Emails", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Disable Affiliates from contacting and viewing the affiliates they referred.", | ||
+ | "type": "checkbox", | ||
+ | "key": "DISABLE_REFERRAL_USERNAME_DISPLAY", | ||
+ | "name": "Disable Referral Username Display", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Enable Affiliate Signup CAPTCHA Image.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_SIGNUP_CAPTCHA", | ||
+ | "name": "Affiliate Signup Captcha", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Number of tries an affilaite can make to login before a Google CAPTCHA is used", | ||
+ | "type": "number", | ||
+ | "key": "GOOGLE_RECAPTCHA", | ||
+ | "name": "Google Recaptcha", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Key will get use in the HTML code for your affiliate site to users (required when GOOGLE_RECAPTCHA is on)", | ||
+ | "key": "GOOGLE_RECAPTCHA_KEY", | ||
+ | "name": "Google Recaptcha Key", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Secret use for communication between your affiliate site and Google (required when GOOGLE_RECAPTCHA is on)", | ||
+ | "key": "GOOGLE_RECAPTCHA_SECRET", | ||
+ | "name": "Google Recaptcha Secret", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Account Changes", | ||
+ | "name": "Account Changes", | ||
+ | "desc": null, | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Verify action for when an affiliate changes their account details.", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "0", | ||
+ | "name": "No Verification" | ||
+ | }, | ||
+ | { | ||
+ | "value": "1", | ||
+ | "name": "Verification Required" | ||
+ | }, | ||
+ | { | ||
+ | "value": "2", | ||
+ | "name": "Verification Set by Affiliate" | ||
+ | } | ||
+ | ], | ||
+ | "key": "AFFILIATE_VERIFY_DETAILS", | ||
+ | "name": "Affiliate Verify Details", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Verify action for when an affiliate changes their defaults.", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "0", | ||
+ | "name": "No Verification" | ||
+ | }, | ||
+ | { | ||
+ | "value": "1", | ||
+ | "name": "Verification Required" | ||
+ | }, | ||
+ | { | ||
+ | "value": "2", | ||
+ | "name": "Verification Set by Affiliate" | ||
+ | } | ||
+ | ], | ||
+ | "key": "AFFILIATE_VERIFY_DEFAULTS", | ||
+ | "name": "Affiliate Verify Defaults", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Verify action for when an affiliate changes their settings.", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "0", | ||
+ | "name": "No Verification" | ||
+ | }, | ||
+ | { | ||
+ | "value": "1", | ||
+ | "name": "Verification Required" | ||
+ | }, | ||
+ | { | ||
+ | "value": "2", | ||
+ | "name": "Verification Set by Affiliate" | ||
+ | } | ||
+ | ], | ||
+ | "key": "AFFILIATE_VERIFY_SETTINGS", | ||
+ | "name": "Affiliate Verify Settings", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Verify action for when an affiliate changes their payvia type.", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "0", | ||
+ | "name": "No Verification" | ||
+ | }, | ||
+ | { | ||
+ | "value": "1", | ||
+ | "name": "Verification Required" | ||
+ | }, | ||
+ | { | ||
+ | "value": "2", | ||
+ | "name": "Verification Set by Affiliate" | ||
+ | } | ||
+ | ], | ||
+ | "key": "AFFILIATE_VERIFY_PAYVIA", | ||
+ | "name": "Affiliate Verify Payvia", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Verify action for when an affiliate changes payvia information.", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "0", | ||
+ | "name": "No Verification" | ||
+ | }, | ||
+ | { | ||
+ | "value": "1", | ||
+ | "name": "Verification Required" | ||
+ | }, | ||
+ | { | ||
+ | "value": "2", | ||
+ | "name": "Verification Set by Affiliate" | ||
+ | } | ||
+ | ], | ||
+ | "key": "AFFILIATE_VERIFY_PAYVIA_INFO", | ||
+ | "name": "Affiliate Verify Payvia Info", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require admin approval when an affiliate changes their account details.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ADMIN_VERIFY_DETAILS", | ||
+ | "name": "Admin Verify Details", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require admin approval when an affiliate changes their payvia type.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ADMIN_VERIFY_PAYVIA", | ||
+ | "name": "Admin Verify Payvia", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require admin approval when an affiliate changes payvia information.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ADMIN_VERIFY_PAYVIA_INFO", | ||
+ | "name": "Admin Verify Payvia Info", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "A link will be sent for the affiliate's email address to reset their password instead of the plaintext password.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_FORGOT_PASSWORD_NO_PLAINTEXT", | ||
+ | "name": "Affiliate Forgot Password No Plaintext", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Number of seconds the affiliate password reset link will be active for. Used only when AFFILIATE_FORGOT_PASSWORD_NO_PLAINTEXT is enabled.", | ||
+ | "key": "AFFILIATE_FORGOT_PASSWORD_NO_PLAINTEXT_LENGTH", | ||
+ | "name": "Affiliate Forgot Password No Plaintext Length", | ||
+ | "value": 3600, | ||
+ | "default": "", | ||
+ | "custom": 1 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "If on, reset password page will only require email when setting new password", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_FORGOT_PASSWORD_NO_USERNAME_VERIFICATION_ON_RESET", | ||
+ | "name": "Affiliate Forgot Password No Username Verification On Reset", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Payment Settings", | ||
+ | "name": "Payment Settings", | ||
+ | "desc": null, | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Force affiliates to use a lowest payvia minimum payout.", | ||
+ | "type": "checkbox", | ||
+ | "key": "FORCE_PV_MIN", | ||
+ | "name": "Force Pv Min", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Update affiliates to use a lowest payvia minimum payout.", | ||
+ | "type": "checkbox", | ||
+ | "key": "UPDATE_PV_MIN", | ||
+ | "name": "Update Pv Min", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require manual approval before allowing payout.", | ||
+ | "type": "checkbox", | ||
+ | "key": "REQUIRE_PAYOUT_APPROVAL", | ||
+ | "name": "Require Payout Approval", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Require US affiliates submit W9 before allowing payout.", | ||
+ | "type": "checkbox", | ||
+ | "key": "RESELLER_US_W9", | ||
+ | "name": "Reseller Us W9", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "The Level an Affiliate must Agree to the Terms of Service before recieving payout.", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "0", | ||
+ | "name": "Affiliate does not need to agree" | ||
+ | }, | ||
+ | { | ||
+ | "value": "1", | ||
+ | "name": "Affiliate can view Statistics and Links but Payout will not be Stored" | ||
+ | }, | ||
+ | { | ||
+ | "value": "2", | ||
+ | "name": "Afffiliate MUST agree before viewing Statistics,Links, or Receiving payout " | ||
+ | } | ||
+ | ], | ||
+ | "key": "AFFILIATE_TOS_AGREE", | ||
+ | "name": "Affiliate Tos Agree", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Notify admins when a reseller submits a W9 form.", | ||
+ | "type": "checkbox", | ||
+ | "key": "ADMIN_NOTIFY_W9", | ||
+ | "name": "Admin Notify W9", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Id of the default payvia method.", | ||
+ | "size": "3", | ||
+ | "key": "DEFAULT_PAYVIA", | ||
+ | "name": "Default Payvia", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Bonus amount given to affiliates when they signup.", | ||
+ | "size": "5", | ||
+ | "key": "AFFILIATE_JOIN_PAYMENT", | ||
+ | "name": "Affiliate Join Payment", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Unstore all stored, unpaid payments of the affiliate when banning the affiliate", | ||
+ | "type": "checkbox", | ||
+ | "key": "UNSTORE_BANNED_AFFILIATE_PAYMENTS", | ||
+ | "name": "Unstore Banned Affiliate Payments", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Tiers", | ||
+ | "name": "Tiers", | ||
+ | "desc": "Payout tiers related configuration options.", | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Include conversion and rebill transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_INCLUDE_REBILLS", | ||
+ | "name": "Tiers Include Rebills", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Include dialer transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_INCLUDE_DIALERS", | ||
+ | "name": "Tiers Include Dialers", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Include manual transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_INCLUDE_MANUALS", | ||
+ | "name": "Tiers Include Manuals", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Include No Cost Registration transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_INCLUDE_NO_COST_REGISTRATION", | ||
+ | "name": "Tiers Include No Cost Registration", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Include Third Party Registration transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_INCLUDE_THIRD_PARTY_REGISTRATION", | ||
+ | "name": "Tiers Include Third Party Registration", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Exclude full initial transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_EXCLUDE_INITIAL", | ||
+ | "name": "Tiers Exclude Initial", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Exclude trial initial transactions when counting tier sales.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_EXCLUDE_TRIAL", | ||
+ | "name": "Tiers Exclude Trial", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Exclude $0 transactions when counting tier sales. If TIERS_INCLUDE_NO_COST_REGISTRATION or TIERS_INCLUDE_THIRD_PARTY_REGISTRATION is enabled, they will not be excluded.", | ||
+ | "type": "checkbox", | ||
+ | "key": "TIERS_EXCLUDE_FREE_SALES", | ||
+ | "name": "Tiers Exclude Free Sales", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Adtools", | ||
+ | "name": "Adtools", | ||
+ | "desc": "Adtool related configuration options.", | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Check this to disable date limitations for adtools and to always show all ad tools.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_DISABLE_ADTOOL_DATE_LIMITATIONS", | ||
+ | "name": "Affiliate Disable Adtool Date Limitations", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Show an image on video adtool affiliate preview, instead of directly loading flowplayer.", | ||
+ | "type": "checkbox", | ||
+ | "key": "VIDEO_BUFFER_IMAGE", | ||
+ | "name": "Video Buffer Image", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Link Codes", | ||
+ | "name": "Link Codes", | ||
+ | "desc": "Link code related configuration options.", | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Default program to use when none is selected", | ||
+ | "type": "dropdown", | ||
+ | "options": [ | ||
+ | { | ||
+ | "value": "", | ||
+ | "name": "Show All Programs" | ||
+ | }, | ||
+ | { | ||
+ | "value": "-1", | ||
+ | "name": "Show First Available" | ||
+ | } | ||
+ | ], | ||
+ | "key": "DEFAULT_PROGRAM_ID", | ||
+ | "name": "Default Program Id", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Custom Flags", | ||
+ | "name": "Custom Flags", | ||
+ | "desc": "Naming of Affiliate Custom Flags and Settings.", | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Flag 1 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_FLAG1", | ||
+ | "name": "Admin Reseller Flag1", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Flag 2 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_FLAG2", | ||
+ | "name": "Admin Reseller Flag2", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Flag 3 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_FLAG3", | ||
+ | "name": "Admin Reseller Flag3", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Flag 4 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_FLAG4", | ||
+ | "name": "Admin Reseller Flag4", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Flag 5 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_FLAG5", | ||
+ | "name": "Admin Reseller Flag5", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Select 1 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_SELECT1", | ||
+ | "name": "Admin Reseller Select1", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Select 2 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_SELECT2", | ||
+ | "name": "Admin Reseller Select2", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Select 3 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_SELECT3", | ||
+ | "name": "Admin Reseller Select3", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Select 4 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_SELECT4", | ||
+ | "name": "Admin Reseller Select4", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Select 5 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_SELECT5", | ||
+ | "name": "Admin Reseller Select5", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Contact 1 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_CONTACT1", | ||
+ | "name": "Admin Reseller Contact1", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Contact 2 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_CONTACT2", | ||
+ | "name": "Admin Reseller Contact2", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Contact 3 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_CONTACT3", | ||
+ | "name": "Admin Reseller Contact3", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Contact 4 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_CONTACT4", | ||
+ | "name": "Admin Reseller Contact4", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Contact 5 Name.", | ||
+ | "size": "20", | ||
+ | "key": "ADMIN_RESELLER_CONTACT5", | ||
+ | "name": "Admin Reseller Contact5", | ||
+ | "value": "", | ||
+ | "default": "", | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Site Partner", | ||
+ | "name": "Site Partner", | ||
+ | "desc": "Modifying which transactions pay site partners.", | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Site partner payout skipped for credit, chargeback, void, insufficient_funds", | ||
+ | "type": "checkbox", | ||
+ | "key": "NO_PARTNER_PAYOUT_DEDUCTIONS", | ||
+ | "name": "No Partner Payout Deductions", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Site partner payout skipped for reversals of credit, chargeback, void, insufficient_funds", | ||
+ | "type": "checkbox", | ||
+ | "key": "NO_PARTNER_PAYOUT_REVERSALS", | ||
+ | "name": "No Partner Payout Reversals", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Site partner payout skipped for pending: trial, initial, conversion, rebill", | ||
+ | "type": "checkbox", | ||
+ | "key": "NO_PARTNER_PAYOUT_PENDING", | ||
+ | "name": "No Partner Payout Pending", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Site partner payout skipped for pre: trial,initial,conversion,rebill", | ||
+ | "type": "checkbox", | ||
+ | "key": "NO_PARTNER_PAYOUT_PRE", | ||
+ | "name": "No Partner Payout Pre", | ||
+ | "value": 1, | ||
+ | "default": 0, | ||
+ | "custom": 1 | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | "key": "Postbacks", | ||
+ | "name": "Postbacks", | ||
+ | "desc": "Allowed Affiliate Postbacks.", | ||
+ | "header_settings": [ | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member approval (includes perminute, seconds, initial and trial).", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_APPROVAL", | ||
+ | "name": "Affiliate Post Member Approval", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member perminute approval.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_PERMINUTE", | ||
+ | "name": "Affiliate Post Member Perminute", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member seconds approval.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_SECONDS", | ||
+ | "name": "Affiliate Post Member Seconds", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member initial approval.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_INITIAL", | ||
+ | "name": "Affiliate Post Member Initial", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member trial approval.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_TRIAL", | ||
+ | "name": "Affiliate Post Member Trial", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member rebill.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_REBILL", | ||
+ | "name": "Affiliate Post Member Rebill", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member upgrade.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_UPGRADE", | ||
+ | "name": "Affiliate Post Member Upgrade", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member expire.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_EXPIRE", | ||
+ | "name": "Affiliate Post Member Expire", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member insufficient funds.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_INSUFFICIENT_FUND", | ||
+ | "name": "Affiliate Post Member Insufficient Fund", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member credit.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_CREDIT", | ||
+ | "name": "Affiliate Post Member Credit", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member chargeback.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_CHARGEBACK", | ||
+ | "name": "Affiliate Post Member Chargeback", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member void.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_VOID", | ||
+ | "name": "Affiliate Post Member Void", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member upgrade denial.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_UPGRADEDENY", | ||
+ | "name": "Affiliate Post Member Upgradedeny", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member change details.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_CHANGE_DETAILS", | ||
+ | "name": "Affiliate Post Member Change Details", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member void reversal.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_VOID_REVERSAL", | ||
+ | "name": "Affiliate Post Member Void Reversal", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member credit reversal.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_CREDIT_REVERSAL", | ||
+ | "name": "Affiliate Post Member Credit Reversal", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member chargeback reversal.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_CHARGEBACK_REVERSAL", | ||
+ | "name": "Affiliate Post Member Chargeback Reversal", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member insufficient funds reversal.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_INSUFFICIENT_FUNDS_REVERSAL", | ||
+ | "name": "Affiliate Post Member Insufficient Funds Reversal", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member pre (note) approval.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_PRE_APPROVAL", | ||
+ | "name": "Affiliate Post Member Pre Approval", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member pre (note) rebill.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_PRE_REBILL", | ||
+ | "name": "Affiliate Post Member Pre Rebill", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member pending approval.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_PENDING_APPROVAL", | ||
+ | "name": "Affiliate Post Member Pending Approval", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member pending rebill.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_PENDING_REBILL", | ||
+ | "name": "Affiliate Post Member Pending Rebill", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to receive a postback on member pending NCR.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_MEMBER_PENDING_NCR", | ||
+ | "name": "Affiliate Post Member Pending Ncr", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the campaign ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_CAMPAIGNID", | ||
+ | "name": "Affiliate Post Extra Vars Campaignid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the prmgraid ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_PROGRAMID", | ||
+ | "name": "Affiliate Post Extra Vars Programid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the site ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_SITEID", | ||
+ | "name": "Affiliate Post Extra Vars Siteid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the tour ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_TOURID", | ||
+ | "name": "Affiliate Post Extra Vars Tourid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the option ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_OPTIONID", | ||
+ | "name": "Affiliate Post Extra Vars Optionid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the adtool ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_ADTOOLID", | ||
+ | "name": "Affiliate Post Extra Vars Adtoolid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the sub ID 1 used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_SUBID1", | ||
+ | "name": "Affiliate Post Extra Vars Subid1", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the sub ID 2 used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_SUBID2", | ||
+ | "name": "Affiliate Post Extra Vars Subid2", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the biller ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_BILLERID", | ||
+ | "name": "Affiliate Post Extra Vars Billerid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the country ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_COUNTRYID", | ||
+ | "name": "Affiliate Post Extra Vars Countryid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | }, | ||
+ | { | ||
+ | "desc": "Allow affiliates to post extra variables based on the promotional ID used.", | ||
+ | "type": "checkbox", | ||
+ | "key": "AFFILIATE_POST_EXTRA_VARS_PROMOTIONALID", | ||
+ | "name": "Affiliate Post Extra Vars Promotionalid", | ||
+ | "value": 0, | ||
+ | "default": 0, | ||
+ | "custom": 0 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </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( | ||
+ | 'section' => 'affiliates', | ||
+ | ); | ||
+ | |||
+ | $request = Array( | ||
+ | 'method' => 'GET', | ||
+ | 'path' => 'v1/config/section', | ||
+ | '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_config_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:59, 9 August 2019
GET /config/section
Description
- Get config section details
Resource URL
- http://domain/api/config/section
- Replace domain with the nats domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params
- section
- type: string
- required
Example Request
Method: GET
URL: http://domain/api/config/section
Query String: section=affiliates
Response:
{ "success": true, "section": "affiliates", "headers": [ { "key": "Signup", "name": "Signup", "desc": null, "header_settings": [ { "desc": "Require affiliate to verify signup with e-mail.", "type": "checkbox", "key": "RESELLER_VERIFY", "name": "Reseller Verify", "value": 0, "default": 0, "custom": 0 }, { "desc": "Require affiliate accounts to be manually activated.", "type": "checkbox", "key": "RESELLER_MANUAL_ACTIVATION", "name": "Reseller Manual Activation", "value": 0, "default": 0, "custom": 0 }, { "desc": "Require new affiliates to fill in a password (set here) in order to sign up.", "type": "text", "size": 40, "key": "CLOSED_AFFILIATE_SIGNUP", "name": "Closed Affiliate Signup", "value": "", "default": "", "custom": 0 }, { "desc": "Pull the account rep from the natscode.", "type": "checkbox", "key": "ACCOUNT_REP_NATSCODE", "name": "Account Rep Natscode", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow the account rep to also be the referring affiliate.", "type": "checkbox", "key": "ACCOUNT_REP_NATSCODE_AS_REF", "name": "Account Rep Natscode As Ref", "value": 0, "default": 0, "custom": 0 }, { "desc": "Assign a random account rep.", "type": "checkbox", "key": "ASSIGN_RANDOM_ACCOUNT_REPS", "name": "Assign Random Account Reps", "value": 0, "default": 0, "custom": 0 }, { "desc": "Comma delimited list of email accounts that can be used for multiple affiliate accounts", "implode_array": 1, "size": "40", "key": "AFFILIATE_NON_UNIQUE_EMAILS", "name": "Affiliate Non Unique Emails", "value": "", "default": "", "custom": 0 }, { "desc": "Disable Affiliates from contacting and viewing the affiliates they referred.", "type": "checkbox", "key": "DISABLE_REFERRAL_USERNAME_DISPLAY", "name": "Disable Referral Username Display", "value": 0, "default": 0, "custom": 0 }, { "desc": "Enable Affiliate Signup CAPTCHA Image.", "type": "checkbox", "key": "AFFILIATE_SIGNUP_CAPTCHA", "name": "Affiliate Signup Captcha", "value": 0, "default": 0, "custom": 0 }, { "desc": "Number of tries an affilaite can make to login before a Google CAPTCHA is used", "type": "number", "key": "GOOGLE_RECAPTCHA", "name": "Google Recaptcha", "value": "", "default": "", "custom": 0 }, { "desc": "Key will get use in the HTML code for your affiliate site to users (required when GOOGLE_RECAPTCHA is on)", "key": "GOOGLE_RECAPTCHA_KEY", "name": "Google Recaptcha Key", "value": "", "default": "", "custom": 0 }, { "desc": "Secret use for communication between your affiliate site and Google (required when GOOGLE_RECAPTCHA is on)", "key": "GOOGLE_RECAPTCHA_SECRET", "name": "Google Recaptcha Secret", "value": "", "default": "", "custom": 0 } ] }, { "key": "Account Changes", "name": "Account Changes", "desc": null, "header_settings": [ { "desc": "Verify action for when an affiliate changes their account details.", "type": "dropdown", "options": [ { "value": "0", "name": "No Verification" }, { "value": "1", "name": "Verification Required" }, { "value": "2", "name": "Verification Set by Affiliate" } ], "key": "AFFILIATE_VERIFY_DETAILS", "name": "Affiliate Verify Details", "value": 1, "default": 0, "custom": 1 }, { "desc": "Verify action for when an affiliate changes their defaults.", "type": "dropdown", "options": [ { "value": "0", "name": "No Verification" }, { "value": "1", "name": "Verification Required" }, { "value": "2", "name": "Verification Set by Affiliate" } ], "key": "AFFILIATE_VERIFY_DEFAULTS", "name": "Affiliate Verify Defaults", "value": 0, "default": 0, "custom": 0 }, { "desc": "Verify action for when an affiliate changes their settings.", "type": "dropdown", "options": [ { "value": "0", "name": "No Verification" }, { "value": "1", "name": "Verification Required" }, { "value": "2", "name": "Verification Set by Affiliate" } ], "key": "AFFILIATE_VERIFY_SETTINGS", "name": "Affiliate Verify Settings", "value": 0, "default": 0, "custom": 0 }, { "desc": "Verify action for when an affiliate changes their payvia type.", "type": "dropdown", "options": [ { "value": "0", "name": "No Verification" }, { "value": "1", "name": "Verification Required" }, { "value": "2", "name": "Verification Set by Affiliate" } ], "key": "AFFILIATE_VERIFY_PAYVIA", "name": "Affiliate Verify Payvia", "value": 1, "default": 0, "custom": 1 }, { "desc": "Verify action for when an affiliate changes payvia information.", "type": "dropdown", "options": [ { "value": "0", "name": "No Verification" }, { "value": "1", "name": "Verification Required" }, { "value": "2", "name": "Verification Set by Affiliate" } ], "key": "AFFILIATE_VERIFY_PAYVIA_INFO", "name": "Affiliate Verify Payvia Info", "value": 1, "default": 0, "custom": 1 }, { "desc": "Require admin approval when an affiliate changes their account details.", "type": "checkbox", "key": "ADMIN_VERIFY_DETAILS", "name": "Admin Verify Details", "value": 0, "default": 0, "custom": 0 }, { "desc": "Require admin approval when an affiliate changes their payvia type.", "type": "checkbox", "key": "ADMIN_VERIFY_PAYVIA", "name": "Admin Verify Payvia", "value": 0, "default": 0, "custom": 0 }, { "desc": "Require admin approval when an affiliate changes payvia information.", "type": "checkbox", "key": "ADMIN_VERIFY_PAYVIA_INFO", "name": "Admin Verify Payvia Info", "value": 0, "default": 0, "custom": 0 }, { "desc": "A link will be sent for the affiliate's email address to reset their password instead of the plaintext password.", "type": "checkbox", "key": "AFFILIATE_FORGOT_PASSWORD_NO_PLAINTEXT", "name": "Affiliate Forgot Password No Plaintext", "value": 0, "default": 0, "custom": 0 }, { "desc": "Number of seconds the affiliate password reset link will be active for. Used only when AFFILIATE_FORGOT_PASSWORD_NO_PLAINTEXT is enabled.", "key": "AFFILIATE_FORGOT_PASSWORD_NO_PLAINTEXT_LENGTH", "name": "Affiliate Forgot Password No Plaintext Length", "value": 3600, "default": "", "custom": 1 }, { "desc": "If on, reset password page will only require email when setting new password", "type": "checkbox", "key": "AFFILIATE_FORGOT_PASSWORD_NO_USERNAME_VERIFICATION_ON_RESET", "name": "Affiliate Forgot Password No Username Verification On Reset", "value": 0, "default": 0, "custom": 0 } ] }, { "key": "Payment Settings", "name": "Payment Settings", "desc": null, "header_settings": [ { "desc": "Force affiliates to use a lowest payvia minimum payout.", "type": "checkbox", "key": "FORCE_PV_MIN", "name": "Force Pv Min", "value": 1, "default": 0, "custom": 1 }, { "desc": "Update affiliates to use a lowest payvia minimum payout.", "type": "checkbox", "key": "UPDATE_PV_MIN", "name": "Update Pv Min", "value": 0, "default": 0, "custom": 0 }, { "desc": "Require manual approval before allowing payout.", "type": "checkbox", "key": "REQUIRE_PAYOUT_APPROVAL", "name": "Require Payout Approval", "value": 0, "default": 0, "custom": 0 }, { "desc": "Require US affiliates submit W9 before allowing payout.", "type": "checkbox", "key": "RESELLER_US_W9", "name": "Reseller Us W9", "value": 0, "default": 0, "custom": 0 }, { "desc": "The Level an Affiliate must Agree to the Terms of Service before recieving payout.", "type": "dropdown", "options": [ { "value": "0", "name": "Affiliate does not need to agree" }, { "value": "1", "name": "Affiliate can view Statistics and Links but Payout will not be Stored" }, { "value": "2", "name": "Afffiliate MUST agree before viewing Statistics,Links, or Receiving payout " } ], "key": "AFFILIATE_TOS_AGREE", "name": "Affiliate Tos Agree", "value": 0, "default": 0, "custom": 0 }, { "desc": "Notify admins when a reseller submits a W9 form.", "type": "checkbox", "key": "ADMIN_NOTIFY_W9", "name": "Admin Notify W9", "value": 0, "default": 0, "custom": 0 }, { "desc": "Id of the default payvia method.", "size": "3", "key": "DEFAULT_PAYVIA", "name": "Default Payvia", "value": "", "default": "", "custom": 0 }, { "desc": "Bonus amount given to affiliates when they signup.", "size": "5", "key": "AFFILIATE_JOIN_PAYMENT", "name": "Affiliate Join Payment", "value": "", "default": "", "custom": 0 }, { "desc": "Unstore all stored, unpaid payments of the affiliate when banning the affiliate", "type": "checkbox", "key": "UNSTORE_BANNED_AFFILIATE_PAYMENTS", "name": "Unstore Banned Affiliate Payments", "value": 0, "default": 0, "custom": 0 } ] }, { "key": "Tiers", "name": "Tiers", "desc": "Payout tiers related configuration options.", "header_settings": [ { "desc": "Include conversion and rebill transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_INCLUDE_REBILLS", "name": "Tiers Include Rebills", "value": 0, "default": 0, "custom": 0 }, { "desc": "Include dialer transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_INCLUDE_DIALERS", "name": "Tiers Include Dialers", "value": 0, "default": 0, "custom": 0 }, { "desc": "Include manual transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_INCLUDE_MANUALS", "name": "Tiers Include Manuals", "value": 0, "default": 0, "custom": 0 }, { "desc": "Include No Cost Registration transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_INCLUDE_NO_COST_REGISTRATION", "name": "Tiers Include No Cost Registration", "value": 0, "default": 0, "custom": 0 }, { "desc": "Include Third Party Registration transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_INCLUDE_THIRD_PARTY_REGISTRATION", "name": "Tiers Include Third Party Registration", "value": 0, "default": 0, "custom": 0 }, { "desc": "Exclude full initial transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_EXCLUDE_INITIAL", "name": "Tiers Exclude Initial", "value": 0, "default": 0, "custom": 0 }, { "desc": "Exclude trial initial transactions when counting tier sales.", "type": "checkbox", "key": "TIERS_EXCLUDE_TRIAL", "name": "Tiers Exclude Trial", "value": 0, "default": 0, "custom": 0 }, { "desc": "Exclude $0 transactions when counting tier sales. If TIERS_INCLUDE_NO_COST_REGISTRATION or TIERS_INCLUDE_THIRD_PARTY_REGISTRATION is enabled, they will not be excluded.", "type": "checkbox", "key": "TIERS_EXCLUDE_FREE_SALES", "name": "Tiers Exclude Free Sales", "value": 0, "default": 0, "custom": 0 } ] }, { "key": "Adtools", "name": "Adtools", "desc": "Adtool related configuration options.", "header_settings": [ { "desc": "Check this to disable date limitations for adtools and to always show all ad tools.", "type": "checkbox", "key": "AFFILIATE_DISABLE_ADTOOL_DATE_LIMITATIONS", "name": "Affiliate Disable Adtool Date Limitations", "value": 0, "default": 0, "custom": 0 }, { "desc": "Show an image on video adtool affiliate preview, instead of directly loading flowplayer.", "type": "checkbox", "key": "VIDEO_BUFFER_IMAGE", "name": "Video Buffer Image", "value": 1, "default": 0, "custom": 1 } ] }, { "key": "Link Codes", "name": "Link Codes", "desc": "Link code related configuration options.", "header_settings": [ { "desc": "Default program to use when none is selected", "type": "dropdown", "options": [ { "value": "", "name": "Show All Programs" }, { "value": "-1", "name": "Show First Available" } ], "key": "DEFAULT_PROGRAM_ID", "name": "Default Program Id", "value": 0, "default": 0, "custom": 0 } ] }, { "key": "Custom Flags", "name": "Custom Flags", "desc": "Naming of Affiliate Custom Flags and Settings.", "header_settings": [ { "desc": "Flag 1 Name.", "size": "20", "key": "ADMIN_RESELLER_FLAG1", "name": "Admin Reseller Flag1", "value": "", "default": "", "custom": 0 }, { "desc": "Flag 2 Name.", "size": "20", "key": "ADMIN_RESELLER_FLAG2", "name": "Admin Reseller Flag2", "value": "", "default": "", "custom": 0 }, { "desc": "Flag 3 Name.", "size": "20", "key": "ADMIN_RESELLER_FLAG3", "name": "Admin Reseller Flag3", "value": "", "default": "", "custom": 0 }, { "desc": "Flag 4 Name.", "size": "20", "key": "ADMIN_RESELLER_FLAG4", "name": "Admin Reseller Flag4", "value": "", "default": "", "custom": 0 }, { "desc": "Flag 5 Name.", "size": "20", "key": "ADMIN_RESELLER_FLAG5", "name": "Admin Reseller Flag5", "value": "", "default": "", "custom": 0 }, { "desc": "Select 1 Name.", "size": "20", "key": "ADMIN_RESELLER_SELECT1", "name": "Admin Reseller Select1", "value": "", "default": "", "custom": 0 }, { "desc": "Select 2 Name.", "size": "20", "key": "ADMIN_RESELLER_SELECT2", "name": "Admin Reseller Select2", "value": "", "default": "", "custom": 0 }, { "desc": "Select 3 Name.", "size": "20", "key": "ADMIN_RESELLER_SELECT3", "name": "Admin Reseller Select3", "value": "", "default": "", "custom": 0 }, { "desc": "Select 4 Name.", "size": "20", "key": "ADMIN_RESELLER_SELECT4", "name": "Admin Reseller Select4", "value": "", "default": "", "custom": 0 }, { "desc": "Select 5 Name.", "size": "20", "key": "ADMIN_RESELLER_SELECT5", "name": "Admin Reseller Select5", "value": "", "default": "", "custom": 0 }, { "desc": "Contact 1 Name.", "size": "20", "key": "ADMIN_RESELLER_CONTACT1", "name": "Admin Reseller Contact1", "value": "", "default": "", "custom": 0 }, { "desc": "Contact 2 Name.", "size": "20", "key": "ADMIN_RESELLER_CONTACT2", "name": "Admin Reseller Contact2", "value": "", "default": "", "custom": 0 }, { "desc": "Contact 3 Name.", "size": "20", "key": "ADMIN_RESELLER_CONTACT3", "name": "Admin Reseller Contact3", "value": "", "default": "", "custom": 0 }, { "desc": "Contact 4 Name.", "size": "20", "key": "ADMIN_RESELLER_CONTACT4", "name": "Admin Reseller Contact4", "value": "", "default": "", "custom": 0 }, { "desc": "Contact 5 Name.", "size": "20", "key": "ADMIN_RESELLER_CONTACT5", "name": "Admin Reseller Contact5", "value": "", "default": "", "custom": 0 } ] }, { "key": "Site Partner", "name": "Site Partner", "desc": "Modifying which transactions pay site partners.", "header_settings": [ { "desc": "Site partner payout skipped for credit, chargeback, void, insufficient_funds", "type": "checkbox", "key": "NO_PARTNER_PAYOUT_DEDUCTIONS", "name": "No Partner Payout Deductions", "value": 0, "default": 0, "custom": 0 }, { "desc": "Site partner payout skipped for reversals of credit, chargeback, void, insufficient_funds", "type": "checkbox", "key": "NO_PARTNER_PAYOUT_REVERSALS", "name": "No Partner Payout Reversals", "value": 0, "default": 0, "custom": 0 }, { "desc": "Site partner payout skipped for pending: trial, initial, conversion, rebill", "type": "checkbox", "key": "NO_PARTNER_PAYOUT_PENDING", "name": "No Partner Payout Pending", "value": 1, "default": 0, "custom": 1 }, { "desc": "Site partner payout skipped for pre: trial,initial,conversion,rebill", "type": "checkbox", "key": "NO_PARTNER_PAYOUT_PRE", "name": "No Partner Payout Pre", "value": 1, "default": 0, "custom": 1 } ] }, { "key": "Postbacks", "name": "Postbacks", "desc": "Allowed Affiliate Postbacks.", "header_settings": [ { "desc": "Allow affiliates to receive a postback on member approval (includes perminute, seconds, initial and trial).", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_APPROVAL", "name": "Affiliate Post Member Approval", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member perminute approval.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_PERMINUTE", "name": "Affiliate Post Member Perminute", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member seconds approval.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_SECONDS", "name": "Affiliate Post Member Seconds", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member initial approval.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_INITIAL", "name": "Affiliate Post Member Initial", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member trial approval.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_TRIAL", "name": "Affiliate Post Member Trial", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member rebill.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_REBILL", "name": "Affiliate Post Member Rebill", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member upgrade.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_UPGRADE", "name": "Affiliate Post Member Upgrade", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member expire.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_EXPIRE", "name": "Affiliate Post Member Expire", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member insufficient funds.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_INSUFFICIENT_FUND", "name": "Affiliate Post Member Insufficient Fund", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member credit.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_CREDIT", "name": "Affiliate Post Member Credit", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member chargeback.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_CHARGEBACK", "name": "Affiliate Post Member Chargeback", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member void.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_VOID", "name": "Affiliate Post Member Void", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member upgrade denial.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_UPGRADEDENY", "name": "Affiliate Post Member Upgradedeny", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member change details.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_CHANGE_DETAILS", "name": "Affiliate Post Member Change Details", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member void reversal.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_VOID_REVERSAL", "name": "Affiliate Post Member Void Reversal", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member credit reversal.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_CREDIT_REVERSAL", "name": "Affiliate Post Member Credit Reversal", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member chargeback reversal.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_CHARGEBACK_REVERSAL", "name": "Affiliate Post Member Chargeback Reversal", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member insufficient funds reversal.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_INSUFFICIENT_FUNDS_REVERSAL", "name": "Affiliate Post Member Insufficient Funds Reversal", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member pre (note) approval.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_PRE_APPROVAL", "name": "Affiliate Post Member Pre Approval", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member pre (note) rebill.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_PRE_REBILL", "name": "Affiliate Post Member Pre Rebill", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member pending approval.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_PENDING_APPROVAL", "name": "Affiliate Post Member Pending Approval", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member pending rebill.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_PENDING_REBILL", "name": "Affiliate Post Member Pending Rebill", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to receive a postback on member pending NCR.", "type": "checkbox", "key": "AFFILIATE_POST_MEMBER_PENDING_NCR", "name": "Affiliate Post Member Pending Ncr", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the campaign ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_CAMPAIGNID", "name": "Affiliate Post Extra Vars Campaignid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the prmgraid ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_PROGRAMID", "name": "Affiliate Post Extra Vars Programid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the site ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_SITEID", "name": "Affiliate Post Extra Vars Siteid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the tour ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_TOURID", "name": "Affiliate Post Extra Vars Tourid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the option ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_OPTIONID", "name": "Affiliate Post Extra Vars Optionid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the adtool ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_ADTOOLID", "name": "Affiliate Post Extra Vars Adtoolid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the sub ID 1 used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_SUBID1", "name": "Affiliate Post Extra Vars Subid1", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the sub ID 2 used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_SUBID2", "name": "Affiliate Post Extra Vars Subid2", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the biller ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_BILLERID", "name": "Affiliate Post Extra Vars Billerid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the country ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_COUNTRYID", "name": "Affiliate Post Extra Vars Countryid", "value": 0, "default": 0, "custom": 0 }, { "desc": "Allow affiliates to post extra variables based on the promotional ID used.", "type": "checkbox", "key": "AFFILIATE_POST_EXTRA_VARS_PROMOTIONALID", "name": "Affiliate Post Extra Vars Promotionalid", "value": 0, "default": 0, "custom": 0 } ] } ] }
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( 'section' => 'affiliates', ); $request = Array( 'method' => 'GET', 'path' => 'v1/config/section', '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); ?>