C# for MapLarge SDK

  1. //DEFAULT CREDENTIALS
  2. string server = "<a href="http://server.maplarge.com/";
  3. string">http://server.maplarge.com/";
  4. string</a> user = "<a href="mailto:user@ml.com">user@ml.com</a>";
  5. string pass = "pw123456";
  6. int token = 123456789;
  7.  
  8. Dictionary<string, string> paramlist = new Dictionary<string, string>();
  9.  
  10. //CREATE MAPLARGE CONNECTION WITH USER / PASSWORD
  11. MapLargeConnector mlconnPassword = new MapLargeConnector(server, user, pass);
  12.  
  13. //CREATE MAPLARGE CONNECTION WITH USER / AUTH TOKEN
  14. MapLargeConnector mlconnToken = new MapLargeConnector(server, user, token);
  15.  
  16. //CREATE TABLE SYNCHRONOUS (NO WEB CALL)
  17. paramlist.Add("account", "test");
  18. paramlist.Add("tablename", "testJavaSdkTable");
  19. paramlist.Add("fileurl", "<a href="http://www.domain.com/testfile.csv"">http://www.domain.com/testfile.csv"</a>);
  20. MapLargeConnector.NO_WEB_CALLS = true;
  21. string response = mlconnPassword.InvokeAPIRequest("CreateTableSynchronous", paramlist);
  22. Console.WriteLine(response);
  23. MapLargeConnector.NO_WEB_CALLS = false;
  24.  
  25. //RETRIEVE REMOTE USER AUTH TOKEN
  26. response = mlconnPassword.GetRemoteAuthToken(user, pass, "255.255.255.255");
  27. Console.WriteLine(response);
  28.  
  29. //LIST GROUPS
  30. paramlist.Clear();
  31. paramlist.Add("account", "test");
  32. response = mlconnToken.InvokeAPIRequestPost("ListGroups", paramlist);
  33. Console.WriteLine(response);
  34.  
  35. //CREATE TABLE WITH FILES SYNCHRONOUS
  36. paramlist.Clear();
  37. paramlist.Add("account", "test");
  38. paramlist.Add("tablename", "PostedTableImport");
  39. response = mlconnToken.InvokeAPIRequestPost("CreateTableWithFilesSynchronous", paramlist,
  40. new string[] { "C:\\Data\\TestFile.csv" });
  41. Console.WriteLine(response);