How does the RowShare API work?
Updated by Antoine Driard
The main pillar of RowShare integration is its API (Application Programming Interface). Thanks to HTTP requests, this JSON API standardizes how you handle tables and content. All user actions on our web site actualy leverage our API.
This allows you to integrate RowShare with your own applications, either as a data source or data entry and retrieval interface to benefit from various features, including streamlined rights management, notifications, attachments or document generation.
Our API is documented on SwaggerHub.
Authentication is covered at the very bottom of the documentation. In a nutshell, you need to call the API, providing login/password in Authentication header. In return, you get a cookie that you will reuse in subsequent calls to the API.
// Create the client
string Host = "https://my.rowshare.com";
HttpClient _client = new HttpClient
{
BaseAddress = new Uri(Host)
};
_client.DefaultRequestHeaders.Accept.Clear();
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Login
var request = new HttpRequestMessage()
{
RequestUri = new Uri($"{Host}/api/user/login"),
Method = HttpMethod.Get
};
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", email, password))));
var resp = await _client.SendAsync(request);
//*** _client now has a '.RSAUTH' cookie ***
We have also published a sample application: RowShare Tool. Its source code is available on GitHub. This tool leverages the API's main features by letting the user log in, copy, export and import tables within a RowShare account or from one account to another.