Hello…
For the Server version, can I use Microsoft SQL Server or MySQL as database?
and are there any API I can us for integration with other systems?
thanks.
No, you cannot use any database. Yes, there’s a Json API.
where can i find the API list?
Just add api to manager url
http(s)://{your.manager.io.url}/api
It will ask for username/password
It is quit nice, because you can interrogate all variables.
What is desperately missing in API implementation is search functionality.
Thank you very much.
I just need to create GL entries.
Hello…
Can I write to the system using the API? Or just read data?
Using the web interface, you can only read from the API.
However, if you use the same endpoints and send a POST request using your own code, you can push updates to the Manager Server.
You would need to know how to write a basic application that can send GET / PUT / POST requests in order to accomplish this, or hire a professional that does know how to do that.
I’m a web developer
I was just looking for the API documentation on how to use it…
does it require a security token? what parameters it accepts? etc…
It is basic authentication.
However @lubos mentioned that he is planning to do token authentication at some point, but it is probably low on priority so don’t count on it.
What language do you use? I could share some sample code in c# if you want.
I’m using C#
would really appreciate sharing some of the code you have.
thank you.
Hello… Would you please share some code samples for the API.
I did not test if it builds, but should get you started
private static HttpClient _client = new HttpClient();
private static UriBuilder _apiBaseUri;
private static Guid businessGuid = Guid.Parse("56e8gbf3-b30r-4957-aex5-e35e32b2a1e5");
private static Guid interAccountTransferGuid = Guid.Parse("dea4f923-c498-4504-b3ef-30be3c33175e");
private static List<InterAccountTransfer> _interAccountTransfers = new List<InterAccountTransfer>();
private static JsonSerializerSettings jsonSettings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
DateFormatString = "yyyy-MM-dd",
};
static void Main(string[] args)
{
String username = "TestApiUser";
String password = "verysecretpassword";
String encodedToken = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + password));
_client.DefaultRequestHeaders.Add("Authorization", "Basic aWduYXM6bWJGU1FkU2JmM25TQlNCRDRRZUI=");
_apiBaseUri = new UriBuilder("https", "your.manager.url", 443);
_interAccountTransfers = Load<InterAccountTransfer>(interAccountTransferGuid, "InterAccountTransfers");
Console.ReadLine();
}
private static void CreateNewRecord<T>(Guid listGuid, T record) where T : class, IRecord
{
var uri = _apiBaseUri;
uri.Path = "api/" + businessGuid + "/" + listGuid;
var newRecord = JsonConvert.SerializeObject(record, jsonSettings);
//Post to create
HttpContent content = new StringContent(newRecord);
var response = _client.PostAsync(uri.ToString(), content).Result;
if (!response.IsSuccessStatusCode)
{
var responseString = response.Content.ReadAsStringAsync().Result;
Console.Write("Failed: {0} - {1}; ", record.Guid, responseString);
}
}
private static void DeleteRecord<T>(Guid listGuid, T record) where T : class, IRecord
{
var uri = _apiBaseUri;
uri.Path = "api/" + businessGuid + "/" + record.Guid + ".json";
//Post to create
HttpContent content = new StringContent("");
var response = _client.DeleteAsync(uri.ToString()).Result;
if (!response.IsSuccessStatusCode)
{
var responseString = response.Content.ReadAsStringAsync().Result;
Console.Write("Failed: {0} - {1}; ", record.Guid, responseString);
}
}
public static List<T> Load<T>(Guid listGuid, string name) where T : class, IRecord
{
var uri = _apiBaseUri;
uri.Path = "api/" + businessGuid + "/" + listGuid + "/index.json";
var data = _client.GetAsync(_apiBaseUri.Uri).Result;
var jsonResponse = data.Content.ReadAsStringAsync().Result;
if (jsonResponse != null)
{
var recordsIndex = JsonConvert.DeserializeObject<string[]>(jsonResponse);
recordsIndex.ForEach((recordGuid, i) =>
{
_apiBaseUri.Path = "api/" + businessGuid + "/" + recordGuid + ".json";
var recordData = _client.GetAsync(_apiBaseUri.Uri).Result;
var recordResponse = recordData.Content.ReadAsStringAsync().Result;
if (recordResponse != null)
{
var record = JsonConvert.DeserializeObject<T>(recordResponse);
record.Guid = Guid.Parse(recordGuid);
records.Add(record);
}
});
}
Console.WriteLine("Done. Count:{0}", _bankPayments.Count);
return records;
}
public interface IRecord
{
Guid Guid { get; set; }
}
public class BankAccount : IRecord
{
[JsonIgnore]
public Guid Guid { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public Guid Currency { get; set; }
}
public class BankTransaction : IRecord
{
[JsonIgnore]
public Guid Guid { get; set; }
public DateTime Date { get; set; }
public Guid BankAccount { get; set; }
public string Description { get; set; }
public List<BankTransactionLine> Lines { get; set; }
public string Reference { get; set; }
public string Payer { get; set; }
public string Notes { get; set; }
public DateTime BankClearDate { get; set; }
public BankTransactionClearStatus BankClearStatus { get; set; }
public bool AmountsIncludeTax { get; set; }
}
public class BankTransactionLine
{
public string Description { get; set; }
public Guid Account { get; set; }
public double Qty { get; set; }
public double Amount { get; set; }
}
public enum BankTransactionClearStatus
{
Cleared,
Pending
}
public class InterAccountTransfer : IRecord
{
[JsonIgnore]
public Guid Guid { get; set; }
public DateTime Date { get; set; }
public Guid CreditAccount { get; set; }
public Guid DebitAccount { get; set; }
public string Description { get; set; }
public string Reference { get; set; }
public double CreditAmount { get; set; }
public double DebitAmount { get; set; }
public DateTime CreditClearDate { get; set; }
public DateTime DebitClearDate { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public BankTransactionClearStatus DebitClearStatus { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public BankTransactionClearStatus CreditClearStatus { get; set; }
}
Thank you.