Images-loading

Message

Learn how to send a message via the api

This documentation assumes that you have you needed login information from the login which can be seen here. For this example we will be sending a custom message. Custom messages can have pre scripting around them or they could not.

C#

String messageId = "{YOUR MESSAGE ID}"; String toNumber = "{PHONE NUMBER}"; String messageToSend = "This is a custom message"; String MessageURI = "http://api.marlimar.com/MessageCenter/ScheduleOutboundMessage/"; String MessageParams = "loggedin_companies_id=" + companiesId + "&loggedin_id=" + loggedInId + "&token=" + loginToken + "&message-id=" + messageId + "&number=" + toNumber + "&scheduled_send_date=" + String.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.UtcNow) + "&custom=" + messageToSend; using (WebClient wc2 = new WebClient()) { wc2.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; String HtmlResult2 = wc2.UploadString(MessageURI, MessageParams); JavaScriptSerializer jss2 = new JavaScriptSerializer(); var d2 = jss2.Deserialize(HtmlResult); if (d2["status"].Equals(1) && d2["message"].Equals("success")) { //WE QUEUED THE MESSAGE TO BE SENT } }

PHP-CodeIgniter

$messageId = '{YOUR MESSAGE ID}'; $toNumber = '{PHONE NUMBER}'; $messageToSend = "This is a custom message"; $messageToSend = array( 'token'=>$token, 'loggedin_companies_id'=>$companiesId, 'message-id'=>$messageId, 'number'=>$toNumber, 'scheduled_send_date'=>gmdate('Y-m-d H:i:s'), 'custom'=>$messageToSend ); $msgResult = $this->Marlimar_MessageCenter->ScheduleOutboundMessage($messageToSend); if($msgResult['status']==1) { //WE QUEUED THE MESSAGE TO BE SENT }