LOGO
API Integration
Be More Productive and Quicker with API Integration and Keep track of customer activities with your apps and decide how links are generated.
SUBSCRIBE CAMPAIGN
									
"POST"
“https://mtac.io/api/campaignSendApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    	=> "subscribeCampaign",
      "key"        	=> "896db6f66cffe8f04544edab4622c521",
      "name"       	=> "andrew",
      "clientRef"  	=> "10003",
      "campaign" 	=> "test campaign",
      "campaignRef" => "20989",
      "quantity" 	=> "1",
      "package"   	=> "SSP",
      "url"   		=> "https://www.mtac.io",
);
								
Parameter Type Required Description
command string YES subscribeCampaign
key string YES Api key
name string YES Client name (provided by client)
clientRef int YES Client ID (provided by client)
campaign string YES Campaign name (provided by client)
campaignRef int YES Campaign ID (provided by client)
quantity int YES Quantity of campaign package(s)
package string YES Campaign package(s)
SSP – Starter Pack
SFP - Free Account
url string OPTIONAL Original URL to be shorten (provided by client)
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode return data: E001, E004
Example
									
{"status":"error","msgCode":"E004",
"statusMsg":"This client's already have an active subscription",
"data":{"subscriptionType":"SM","subscriptionEnd":1576771140}}

{"status":"ok","msgCode":"E001","statusMsg":"Successful.",
"data":{"dashboard":"mtac.io\/cv8Vaq",
"referenceID":"c5de8eefaea549",
"campaignEnd":1576065018}}
								

CHECK CAMPAIGN STATUS
									
"POST"
“https://mtac.io/api/campaignSendApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    	=> "checkCampaignStatus",
      "key"        	=> "896db6f66cffe8f04544edab4622c521",
      "clientRef"  	=> "10003",
      "campaignRef" => "20989",
);
								
Parameter Type Required Description
command string YES checkCampaignStatus
key string YES Api key
clientRef int YES Client ID (provided by client)
campaignRef int YES Campaign ID (provided by client)
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode return data: E001
Example
									
{"status":"error","msgCode":"E011", "statusMsg":"client not found"}

{"status":"ok","msgCode":"E001","referenceID":"c5e3cd92b31b9b",
"dashboard":"mtac.io/7v9Ktd","validity":1,"campaignStatus":"active",
"campaignEnd":1576065018}
								

SUBSCRIBE SERVICE
									
"POST"
“https://mtac.io/api/subscriptionApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    	=> "newServiceSubscription",
      "key"        	=> "896db6f66cffe8f04544edab4622c521",
      "name"       	=> "andrew",
      "clientRef"  	=> "10003",
      "package"   	=> "SM"
);
								
Parameter Type Required Description
command string YES newServiceSubscription
key string YES Api key
name string YES Client name (provided by client)
clientRef int YES Client ID (provided by client)
package string YES Subscription packages
SM – Monthly Subscription
SY – Annually Subscription
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode return data: E001, E004
Example
									
{"status":"error","msgCode":"E004",
"statusMsg":"This client's already have an active subscription",
"data":{"subscriptionType":"SM","subscriptionEnd":1576771140}}

{"status":"ok",
"msgCode":"E001",
"statusMsg":"Successful.",
"data":{"subscriptionStart":1574233972,"subscriptionEnd":1576771140}}
								

RENEW SERVICE SUBSCRIPTION
									
"POST"
“https://mtac.io/api/subscriptionApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    	=> "renewServiceSubscription",
      "key"        	=> "896db6f66cffe8f04544edab4622c521",
      "clientRef"  	=> "10003",
      "package"   	=> "SM"
);
								
Parameter Type Required Description
command string YES renewServiceSubscription
key string YES Api key
clientRef int YES Client ID (provided by client)
package string YES Subscription packages
SM – Monthly Subscription
SY – Annually Subscription
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message
data msgCode with return data : E001, E023
Example
									
{"status":"error","msgCode":"E023","statusMsg":
"Subscription not found","data":{"subscriptionType":"SM","subscriptionStatus":
"expired","subscriptionEnd":1573700318}}

{"status":"ok","msgCode":"E001","statusMsg":"Successful.","data":
{"subscriptionType":"SM","subscriptionEnd":1576771140}}
								

CANCEL SERVICE SUBSCRIPTION
									
"POST"
“https://mtac.io/api/subscriptionApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    => "cancelServiceSubscription",
      "key"        => "896db6f66cffe8f04544edab4622c521",
      "clientRef"  => "10003",
);
								
Parameter Type Required Description
command string YES cancelServiceSubscription
key string YES Api key
clientRef int YES Client ID (provided by client)
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message
data msgCode with return data : E001, E023
Example
									
{"status":"error","msgCode":"E023","statusMsg":
"Subscription not found","data":{"subscriptionType":"SY","subscriptionStatus":
"expired","subscriptionEnd":1611071940}}

{"status":"ok","msgCode":"E023","statusMsg":"Successful","data":{"subscriptionType":
"SY","subscriptionStatus":"cancelled","subscriptionEnd":1611071940}}
								

CHECK SERVICE SUBSCRIPTION
									
"POST"
“https://mtac.io/api/subscriptionApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    => "checkServiceSubscription",
      "key"        => "896db6f66cffe8f04544edab4622c521",
      "clientRef"  => "10003",
);
								
Parameter Type Required Description
command string YES checkServiceSubscription
key string YES Api key
clientRef int YES Client ID (provided by client)
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message
data msgCode with return data : E001, E023
Example
									
{"status":"error","msgCode":"E023","statusMsg":
"Subscription not found","data":{"validity":0,"subscriptionType":"SY",
"subscriptionStatus":"expired","subscriptionEnd":1611071940}}

{"status":"ok","msgCode":"E023","statusMsg":"Successful","data":
{"validity":1,"subscriptionType":"SY","subscriptionStatus":
"active","subscriptionEnd":1611071940}}
								

CREATE NEW CAMPAIGN
									
"POST"
“https://mtac.io/api/campaignSendApi.php"
								
Request Body
									
$dataArray = Array (
      "command"    => "createNewCampaign",
      "key"        => "896db6f66cffe8f04544edab4622c521",
      "clientRef"  => "10003",
      "campaign"   => "test campaign 1",
      "campaignRef" => "1104",
      "url"        => "www.example.com",
);
								
Parameter Type Required Description
command string YES createNewCampaign
key string YES Api key
clientRef int YES Client ID (provided by client)
campaign string YES Campaign name (provided by client)
campaigRef string YES Campaign reference ID (provided by client)
url string YES Original URL to be shorten (provided by client)
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode with return data: E001
Example
									
{"status":"error","msgCode":"E002","statusMsg":"Missing parameters"}


{"status":"ok","msgCode":"E001","statusMsg":"Successful.","data":
{"dashboard":"mtac.io\/N2l9hc","referenceID":"c5dd4fa2084529"}}
								

GENERATE SHORT URL
									
"POST"
"https://mtac.io/api/campaignSendApi.php"
								
Request Body
									
$dataArray = Array (
      "command"	    => "memberGenerateUrl",
      "key"         => "896db6f66cffe8f04544edab4622c521",
      "clientRef"   => "10003",
      "url"         => "www.example.com",
      "campaignRef" => "1104",
      "data"        => array("recipient" => "601156001212", "refID" => "acd123");
);
								
Parameter Type Required Description
command string YES memberGenerateUrl
key string YES Api key
clientRef int YES Client reference ID (provided by client)
url string YES Original URL to be shorten (provided by client)
campaignRef string YES Campaign reference ID (provided by client)
data string recipient : YES, refID : OPTIONAL refID will be generated if not provided.
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode with return data: E001
Example
									
{"status":"error","msgCode":"E012","statusMsg":"Campaign not found"}

{"status":"ok","msgCode":"E001","statusMsg":"Successful.","data":
{"output":[{"shortURL":"mtac.io\/gr7WPt","mobile":
"601156729123","referenceID":"acd123"}],"campaignID":1182}}
								

GENERATE SHORT URL (HOMEPAGE)
									
"POST"
"https://mtac.io/api/campaignSendApi.php"
								
Request Body
									
$dataArray = Array (
      "command"	    => "generateHomepageUrl",
      "key"         => "896db6f66cffe8f04544edab4622c521",
      "clientRef"   => "10003",
      "url"         => "www.example.com",
      "cookies" 	=> "b640f189ed002dc1976a1cdca456ec9a",
);
								
Parameter Type Required Description
command string YES generateHomepageUrl
key string YES Api key
url string YES Original URL to be shorten (provided by client)
clientRef int OPTIONAL Client reference ID (provided by client)
cookies string OPTIONAL Cookies
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode with return data: E001
Example
									
{"status":"error","msgCode":"E002","statusMsg":"Missing Parameters."}

{"status":"ok","msgCode":"E001","statusMsg":"Successful.","data":
{"shortURL":"mtac.io\/gr7WPt","cookies":"b640f189ed002dc1976a1cdca456ec9a"}}
								

URL PUSH TIME (CLIENT SHARE /SEND SHORT URL TIME)
									
"POST"
"https://mtac.io/api/campaignSendApi.php"
								
Request Body
									
$dataArray = Array (
      "command"   	=> "urlPushTime",
      "clientRef"  	=> "10003",
      "campaignRef" => "1104",
      "refID"      	=> "acd123",
      "recipient" 	=> "601156729123",
      "time"      	=> "1573721156"
);
								
Parameter Type Required Description
command string YES urlPushTime
clientRef int YES Client reference ID (provided by client)
campaignRef int YES Campaign name (provided by client)
refID string YES Short URL reference ID (provided by client or mtac.io)
recipient string YES Recipient is either by email or sms.
time timestamp YES Send/ share url time
Response
Parameter Description
status Ok or Error
msgCode Return code (see Appendix I for details)
statusMsg Status message return by api
data msgCode with return data: E001
Example
									
{"status":"error","msgCode":"E011","statusMsg":"client not found"}

{"status":"ok","msgCode":"E001","statusMsg":"Successful","data":{"updateAt":1574260721}}
								

APPENDIX I
Parameter Description
E001 Successful
E002 Missing parameters
E003 Invalid api key
E004 This client's already have an active subscription
E005 URL does not have a valid format
E006 URL does not appear to exist
E007 Error
E008 Client does not have active subscription
E009 Failed to create campaign
E010 Failed to generate short URL
E011 Client not found
E012 Campaign not found
E013 Failed to renew subscription
E014 Failed to cancel subscription
E015 Generate short url failed
E016 Duplicate recipient
E017 Short URL not found
E018 Invalid date format
E019 Update push time failed
E020 Campaign existed
E021 Campaign name has already been used
E022 Invalid subscription package ID
E023 Subscription failed
E024 Subscription not found
E025 Invalid campaign name