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);
}
}
}
}
}