Difference between revisions of "NATS5 REST API Site POST tour"
From TMM Wiki
Jump to navigationJump to searchm (TMMJoe moved page NATS4 REST API Site POST tour to NATS5 REST API Site POST tour: Renaming NATS5 API pages) |
|||
Line 1: | Line 1: | ||
− | {{ | + | {{NATS5 Manual |
| show_api_admin_section = true | | show_api_admin_section = true | ||
}} | }} | ||
== '''POST /site/tour''' == | == '''POST /site/tour''' == | ||
+ | |||
'''Description''' | '''Description''' | ||
* Add new tour | * Add new tour | ||
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''']] |
*POST | *POST | ||
'''Response Format''' | '''Response Format''' | ||
*JSON | *JSON | ||
− | '''[[ | + | '''[[NATS5_REST_API_Overview#Authentication|Authentication]]''' |
*HTTP headers | *HTTP headers | ||
Line 40: | Line 41: | ||
** optional | ** optional | ||
* '''tour_type''' | * '''tour_type''' | ||
− | ** type: boolean_digit | + | ** type: boolean_digit (0 or 1) |
** optional | ** optional | ||
* '''hidden''' | * '''hidden''' | ||
− | ** type: boolean_digit | + | ** type: boolean_digit (0 or 1) |
** optional | ** optional | ||
Line 63: | Line 64: | ||
{ | { | ||
"success": true, | "success": true, | ||
− | "tourid": | + | "tourid": 4, |
"tour": { | "tour": { | ||
− | "tourid": " | + | "tourid": "4", |
"tour": "testTour2", | "tour": "testTour2", | ||
"siteid": "2", | "siteid": "2", | ||
Line 169: | Line 170: | ||
"change_detailspost": "", | "change_detailspost": "", | ||
"inherit_default_change_detailspost": "1", | "inherit_default_change_detailspost": "1", | ||
− | "created_date": " | + | "created_date": "1565382572", |
"mail_member_password": "Password Retrieval", | "mail_member_password": "Password Retrieval", | ||
"inherit_default_mail_member_password": "1", | "inherit_default_mail_member_password": "1", | ||
Line 267: | Line 268: | ||
"inherit_mail_member_joined_enabled": "1", | "inherit_mail_member_joined_enabled": "1", | ||
"inherit_default_https_tracking": "1", | "inherit_default_https_tracking": "1", | ||
− | "created_datetime": "2019- | + | "created_datetime": "2019-08-09 16:29:32", |
"default": 0, | "default": 0, | ||
"site": { | "site": { | ||
Line 400: | Line 401: | ||
"change_detailspost": "", | "change_detailspost": "", | ||
"inherit_default_change_detailspost": "1", | "inherit_default_change_detailspost": "1", | ||
− | "created_date": " | + | "created_date": "1565382572", |
"mail_member_password": "Password Retrieval", | "mail_member_password": "Password Retrieval", | ||
"inherit_default_mail_member_password": "1", | "inherit_default_mail_member_password": "1", | ||
Line 569: | Line 570: | ||
</pre> | </pre> | ||
− | [[Category: | + | [[Category:NATS5_REST_APIs]] |
− | [[Category: | + | [[Category:NATS5_REST_site_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 --> | [[Category:Autogenerated_Rest_Sample]]<!-- This article has a generated REST API Sample from our unit testing system. Also remove if customizing the wiki article --> |
Revision as of 15:47, 9 August 2019
POST /site/tour
Description
- Add new tour
Resource URL
- http://domain/api/site/tour
- Replace domain with the nats domain
- POST
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params
- siteid
- type: digit
- required
- tour
- type: string
- required
- name
- type: string
- optional
- url
- type: string
- required
- linkdomain
- type: string
- required
- description
- type: string
- optional
- tour_type
- type: boolean_digit (0 or 1)
- optional
- hidden
- type: boolean_digit (0 or 1)
- optional
Example Request
Method: POST
URL: http://domain/api/site/tour
Form Data:
- siteid: 2
- tour: testTour2
- name: test tour
- url: http://toomuchmedia.com
- linkdomain: http://democash.com
- description: this is a test tour description
- tour_type: 1
- hidden: 0
Response:
{ "success": true, "tourid": 4, "tour": { "tourid": "4", "tour": "testTour2", "siteid": "2", "networkid": "0", "name": "test tour", "url": "http:\/\/toomuchmedia.com", "linkdomain": "democash.com", "description": "this is a test tour description", "inherit_default_description": "1", "thumb": "", "thumb_ext": "", "third_party_partner_id": "0", "spartaurl": "", "denyurl": null, "inherit_default_denyurl": "1", "denypost": "", "inherit_default_denypost": "1", "approvalurl": null, "inherit_default_approvalurl": "1", "approvalpost": "", "inherit_default_approvalpost": "1", "rebillpost": "", "inherit_default_rebillpost": "1", "creditpost": "", "inherit_default_creditpost": "1", "chargebackpost": "", "inherit_default_chargebackpost": "1", "insufficient_fundpost": "", "inherit_default_insufficient_fundpost": "1", "voidpost": "", "inherit_default_voidpost": "1", "userpost": "", "inherit_default_userpost": "1", "userman": "", "inherit_default_userman": "1", "expirepost": "", "inherit_default_expirepost": "1", "custom": "", "admin_signup_email": "", "inherit_default_admin_signup_email": "1", "admin_rebill_email": "", "inherit_default_admin_rebill_email": "1", "admin_cancelled_email": "", "inherit_default_admin_cancelled_email": "1", "admin_credited_email": "", "inherit_default_admin_credited_email": "1", "admin_chargeback_email": "", "inherit_default_admin_chargeback_email": "1", "admin_voided_email": "", "inherit_default_admin_voided_email": "1", "admin_insufficient_email": "", "inherit_default_admin_insufficient_email": "1", "admin_void_reversal_email": "", "inherit_default_admin_void_reversal_email": "1", "admin_credit_reversal_email": "", "inherit_default_admin_credit_reversal_email": "1", "admin_chargeback_reversal_email": "", "inherit_default_admin_chargeback_reversal_email": "1", "admin_insufficient_reversal_email": "", "inherit_default_admin_insufficient_reversal_email": "1", "admin_change_email": "", "inherit_default_admin_change_email": "1", "upgradeurl": null, "inherit_default_upgradeurl": "1", "upgradepost": "", "inherit_default_upgradepost": "1", "allowed_lang": "", "inherit_default_allowed_lang": "1", "alternativeurl": null, "inherit_default_alternativeurl": "1", "allowed_lang_track_raw": "0", "allowed_lang_track_unq": "0", "hidden": "0", "mail_member_joined": "", "inherit_default_mail_member_joined": "1", "mail_member_cancelled": "", "inherit_default_mail_member_cancelled": "1", "mail_member_rebilled": "", "inherit_default_mail_member_rebilled": "1", "mail_member_credited": "", "inherit_default_mail_member_credited": "1", "mail_member_chargedback": "", "inherit_default_mail_member_chargedback": "1", "mail_member_insufficient": "", "inherit_default_mail_member_insufficient": "1", "mail_member_voided": "", "inherit_default_mail_member_voided": "1", "upgradedenyurl": null, "inherit_default_upgradedenyurl": "1", "upgradedenypost": "", "inherit_default_upgradedenypost": "1", "prejoinpost": "", "inherit_default_prejoinpost": "1", "byo_owner": 0, "byo_program": "0", "byo_owner_only": "0", "deleted": "0", "niche": "", "inherit_default_niche": "1", "strack_programid": "0", "mail_member_change": "", "inherit_default_mail_member_change": "1", "change_detailspost": "", "inherit_default_change_detailspost": "1", "created_date": "1565382572", "mail_member_password": "Password Retrieval", "inherit_default_mail_member_password": "1", "credit_reversal_post": "", "inherit_default_credit_reversal_post": "1", "chargeback_reversal_post": "", "inherit_default_chargeback_reversal_post": "1", "void_reversal_post": "", "inherit_default_void_reversal_post": "1", "insufficient_funds_reversal_post": "", "inherit_default_insufficient_funds_reversal_post": "1", "mail_member_insufficient_reversal": "", "inherit_default_mail_member_insufficient_reversal": "1", "mail_member_void_reversal": "", "inherit_default_mail_member_void_reversal": "1", "mail_member_credit_reversal": "", "inherit_default_mail_member_credit_reversal": "1", "mail_member_chargeback_reversal": "", "inherit_default_mail_member_chargeback_reversal": "1", "admin_threshold_email": null, "inherit_default_admin_threshold_email": "1", "mail_threshold": "", "inherit_default_mail_threshold": "1", "join_hit_threshold_hour_to_6": null, "inherit_default_join_hit_threshold_hour_to_6": "1", "join_hit_threshold_hour_to_12": null, "inherit_default_join_hit_threshold_hour_to_12": "1", "join_hit_threshold_hour_to_18": null, "inherit_default_join_hit_threshold_hour_to_18": "1", "join_hit_threshold_hour_to_24": null, "inherit_default_join_hit_threshold_hour_to_24": "1", "mail_member_pending_joined": "", "inherit_default_mail_member_pending_joined": "1", "mail_member_pre_joined": "", "inherit_default_mail_member_pre_joined": "1", "mail_member_pending_rebilled": "", "inherit_default_mail_member_pending_rebilled": "1", "mail_member_pre_rebilled": "", "inherit_default_mail_member_pre_rebilled": "1", "pre_approvalpost": "", "inherit_default_pre_approvalpost": "1", "pending_approvalpost": "", "inherit_default_pending_approvalpost": "1", "pre_rebillpost": "", "inherit_default_pre_rebillpost": "1", "pending_rebillpost": "", "inherit_default_pending_rebillpost": "1", "https_use": "0", "tour_type": "1", "mail_member_nocostjoined": "", "inherit_default_mail_member_nocostjoined": "1", "nocost_approvalpost": "", "inherit_default_nocost_approvalpost": "1", "packageurl": null, "inherit_default_packageurl": "1", "packagedenyurl": null, "inherit_default_packagedenyurl": "1", "packagedenypost": null, "inherit_default_packagedenypost": "1", "packagepost": null, "inherit_default_packagepost": "1", "gateway_join_text": null, "inherit_default_gateway_join_text": "1", "gateway_join_disclaimer": null, "inherit_default_gateway_join_disclaimer": "1", "join_disclaimer": null, "inherit_default_join_disclaimer": "1", "join_text": null, "inherit_default_join_text": "1", "tokenrebuyurl": "", "inherit_default_tokenrebuyurl": "1", "tokenrebuydenyurl": "", "inherit_default_tokenrebuydenyurl": "1", "allowed_lang_track_join": "0", "dupeurl": "", "inherit_default_dupeurl": "1", "mail_member_igm_joined": "Signup Receipt", "inherit_default_mail_member_igm_joined": "1", "mail_member_pending_ncr": "Verify Your Free Registration", "pending_ncrpost": "", "inherit_default_mail_member_pending_ncr": "1", "https_tracking": "0", "gateway_https": "", "https_display": "0", "inherit_default_https_display": "1", "mail_member_conversion": "", "inherit_default_mail_member_conversion": "", "member_captcha": "0", "userman_secret_key": "", "inherit_default_userman_secret_key": "1", "cancelpost": "", "inherit_default_cancelpost": "1", "cookie_domain": "0", "inherit_default_pending_ncrpost": "1", "inherit_default_member_captcha": "1", "mail_member_joined_enabled": "0", "inherit_mail_member_joined_enabled": "1", "inherit_default_https_tracking": "1", "created_datetime": "2019-08-09 16:29:32", "default": 0, "site": { "siteid": "2", "networkid": "0", "site": "testSite", "deleted": "0", "name": "test site name", "type": "0", "hidden": "0", "date_added": "1559932173", "date_live": "0", "network": "0", "reuse_active": "0", "no_personal_member_info": "0", "mobile_tour": "0", "site_group_id": "0", "featured": "0", "brand_id": "0", "require_atvod_verification": "0", "atvod_client_id": "", "atvod_operator_id": "", "atvod_password": "", "atvod_authenticate_profile_id": "", "atvod_passport_profile_id": "", "atvod_driving_licence_profile_id": "", "type_nice": "Membership", "site_group_nice": "None", "default_tour": { "tourid": "2", "tour": "testTour", "siteid": "2", "networkid": "0", "name": "test tour name", "url": "http:\/\/toomuchmedia.com", "linkdomain": "democash.com", "description": "test tour description", "inherit_default_description": "1", "thumb": "", "thumb_ext": "", "third_party_partner_id": "0", "spartaurl": "", "denyurl": null, "inherit_default_denyurl": "1", "denypost": "", "inherit_default_denypost": "1", "approvalurl": null, "inherit_default_approvalurl": "1", "approvalpost": "", "inherit_default_approvalpost": "1", "rebillpost": "", "inherit_default_rebillpost": "1", "creditpost": "", "inherit_default_creditpost": "1", "chargebackpost": "", "inherit_default_chargebackpost": "1", "insufficient_fundpost": "", "inherit_default_insufficient_fundpost": "1", "voidpost": "", "inherit_default_voidpost": "1", "userpost": "", "inherit_default_userpost": "1", "userman": "", "inherit_default_userman": "1", "expirepost": "", "inherit_default_expirepost": "1", "custom": "", "admin_signup_email": "", "inherit_default_admin_signup_email": "1", "admin_rebill_email": "", "inherit_default_admin_rebill_email": "1", "admin_cancelled_email": "", "inherit_default_admin_cancelled_email": "1", "admin_credited_email": "", "inherit_default_admin_credited_email": "1", "admin_chargeback_email": "", "inherit_default_admin_chargeback_email": "1", "admin_voided_email": "", "inherit_default_admin_voided_email": "1", "admin_insufficient_email": "", "inherit_default_admin_insufficient_email": "1", "admin_void_reversal_email": "", "inherit_default_admin_void_reversal_email": "1", "admin_credit_reversal_email": "", "inherit_default_admin_credit_reversal_email": "1", "admin_chargeback_reversal_email": "", "inherit_default_admin_chargeback_reversal_email": "1", "admin_insufficient_reversal_email": "", "inherit_default_admin_insufficient_reversal_email": "1", "admin_change_email": "", "inherit_default_admin_change_email": "1", "upgradeurl": null, "inherit_default_upgradeurl": "1", "upgradepost": "", "inherit_default_upgradepost": "1", "allowed_lang": "", "inherit_default_allowed_lang": "1", "alternativeurl": null, "inherit_default_alternativeurl": "1", "allowed_lang_track_raw": "0", "allowed_lang_track_unq": "0", "hidden": "0", "mail_member_joined": "", "inherit_default_mail_member_joined": "1", "mail_member_cancelled": "", "inherit_default_mail_member_cancelled": "1", "mail_member_rebilled": "", "inherit_default_mail_member_rebilled": "1", "mail_member_credited": "", "inherit_default_mail_member_credited": "1", "mail_member_chargedback": "", "inherit_default_mail_member_chargedback": "1", "mail_member_insufficient": "", "inherit_default_mail_member_insufficient": "1", "mail_member_voided": "", "inherit_default_mail_member_voided": "1", "upgradedenyurl": null, "inherit_default_upgradedenyurl": "1", "upgradedenypost": "", "inherit_default_upgradedenypost": "1", "prejoinpost": "", "inherit_default_prejoinpost": "1", "byo_owner": "0", "byo_program": "0", "byo_owner_only": "0", "deleted": "0", "niche": "", "inherit_default_niche": "1", "strack_programid": "0", "mail_member_change": "", "inherit_default_mail_member_change": "1", "change_detailspost": "", "inherit_default_change_detailspost": "1", "created_date": "1565382572", "mail_member_password": "Password Retrieval", "inherit_default_mail_member_password": "1", "credit_reversal_post": "", "inherit_default_credit_reversal_post": "1", "chargeback_reversal_post": "", "inherit_default_chargeback_reversal_post": "1", "void_reversal_post": "", "inherit_default_void_reversal_post": "1", "insufficient_funds_reversal_post": "", "inherit_default_insufficient_funds_reversal_post": "1", "mail_member_insufficient_reversal": "", "inherit_default_mail_member_insufficient_reversal": "1", "mail_member_void_reversal": "", "inherit_default_mail_member_void_reversal": "1", "mail_member_credit_reversal": "", "inherit_default_mail_member_credit_reversal": "1", "mail_member_chargeback_reversal": "", "inherit_default_mail_member_chargeback_reversal": "1", "admin_threshold_email": null, "inherit_default_admin_threshold_email": "1", "mail_threshold": "", "inherit_default_mail_threshold": "1", "join_hit_threshold_hour_to_6": null, "inherit_default_join_hit_threshold_hour_to_6": "1", "join_hit_threshold_hour_to_12": null, "inherit_default_join_hit_threshold_hour_to_12": "1", "join_hit_threshold_hour_to_18": null, "inherit_default_join_hit_threshold_hour_to_18": "1", "join_hit_threshold_hour_to_24": null, "inherit_default_join_hit_threshold_hour_to_24": "1", "mail_member_pending_joined": "", "inherit_default_mail_member_pending_joined": "1", "mail_member_pre_joined": "", "inherit_default_mail_member_pre_joined": "1", "mail_member_pending_rebilled": "", "inherit_default_mail_member_pending_rebilled": "1", "mail_member_pre_rebilled": "", "inherit_default_mail_member_pre_rebilled": "1", "pre_approvalpost": "", "inherit_default_pre_approvalpost": "1", "pending_approvalpost": "", "inherit_default_pending_approvalpost": "1", "pre_rebillpost": "", "inherit_default_pre_rebillpost": "1", "pending_rebillpost": "", "inherit_default_pending_rebillpost": "1", "https_use": "0", "tour_type": "0", "mail_member_nocostjoined": "", "inherit_default_mail_member_nocostjoined": "1", "nocost_approvalpost": "", "inherit_default_nocost_approvalpost": "1", "packageurl": null, "inherit_default_packageurl": "1", "packagedenyurl": null, "inherit_default_packagedenyurl": "1", "packagedenypost": null, "inherit_default_packagedenypost": "1", "packagepost": null, "inherit_default_packagepost": "1", "gateway_join_text": null, "inherit_default_gateway_join_text": "1", "gateway_join_disclaimer": null, "inherit_default_gateway_join_disclaimer": "1", "join_disclaimer": null, "inherit_default_join_disclaimer": "1", "join_text": null, "inherit_default_join_text": "1", "tokenrebuyurl": "", "inherit_default_tokenrebuyurl": "1", "tokenrebuydenyurl": "", "inherit_default_tokenrebuydenyurl": "1", "allowed_lang_track_join": "0", "dupeurl": "", "inherit_default_dupeurl": "1", "mail_member_igm_joined": "Signup Receipt", "inherit_default_mail_member_igm_joined": "1", "mail_member_pending_ncr": "Verify Your Free Registration", "pending_ncrpost": "", "inherit_default_mail_member_pending_ncr": "1", "https_tracking": "0", "gateway_https": "", "https_display": "0", "inherit_default_https_display": "1", "mail_member_conversion": "", "inherit_default_mail_member_conversion": "", "member_captcha": "0", "userman_secret_key": "", "inherit_default_userman_secret_key": "1", "cancelpost": "", "inherit_default_cancelpost": "1", "cookie_domain": "0", "inherit_default_pending_ncrpost": "1", "inherit_default_member_captcha": "1", "mail_member_joined_enabled": "0", "inherit_mail_member_joined_enabled": "1", "inherit_default_https_tracking": "1" } } } }
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( 'siteid' => '2', 'tour' => 'testTour2', 'name' => 'test tour', 'url' => 'http://toomuchmedia.com', 'linkdomain' => 'http://democash.com', 'description' => 'this is a test tour description', 'tour_type' => 1, 'hidden' => 0, ); $request = Array( 'method' => 'POST', 'path' => 'v1/site/tour', '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); ?>