Images-loading

Login

Learn how to login into the marlimar system via our api calls

Logging into the marlimar system will generate a login token that you will use for all your future calls. After you have completed your transactions logging out to keep you account secure is the best way to go.

C#

using System; using System.Collections.Generic; using System.Net; using System.Web.Script.Serialization; namespace MarlimarCSharpExample { class Program { static void Main(string[] args) { string URI = "http://api.marlimar.com/Login/"; string myParameters = "username={YOUR USERNAME}"+ "&password={YOUR PASSWORD}"; using (WebClient wc = new WebClient()) { wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; string HtmlResult = wc.UploadString(URI, myParameters); JavaScriptSerializer jss = new JavaScriptSerializer(); var response = jss.Deserialize(HtmlResult); var status = response["status"]; if (status.Equals(1)) { String loginToken = response["token"].ToString(); String companiesId = response["companies"][0]["companies_id"].ToString(); String loggedInId = response["id"].ToString(); String logoutUri = "http://api.marlimar.com/Login/Logout/"; String logoutParams = "&loggedin_id=" + loggedInId + "&token=" + loginToken; wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; HtmlResult = wc.UploadString(logoutUri, logoutParams); } } } } }

PHP-CodeIgniter

$this->load->model('integrations/Marlimar_Login'); $result = $this->Marlimar_Login->Login($this->marlimarUser,$this->marlimarPass); if($result['status']==1) { //print_r($result); $loginResponse = $result['data']; $token = $result['data']['token']; $loggedInId = $result['data']['id']; $companiesId = $result['data']['companies'][0]['companies_id']; $this->Marlimar_Login->Logout($loggedInId,$token); }