Data Manager Uploads.

4 posts / 0 new
Last post
Data Manager Uploads.

I am looking for a way to automate data manager data uploads.  Has anyone ventured down that road?

Sure have. You can use the
Sure have. You can use the web service directly to automate any of the Data Manager functionality. The user interface is using the same service in the background.

requesting an example

can you give an example how to upload a csv file. 

api doc a bit confusing.


There is a JavaScript example

There is a JavaScript example here. I use curl alot too.


curl --referer -F clientId=ID -F password=PW -F tableName=mqap.ID_name -F "file=@C:\Users\file.csv" ""


Here is an old java method I haven't used in a long time.


public class DataManagerUpload {
    static String ci="id"; // clientId
    static String pw="pw"; // registry password
    static String tn="name"; // table name
    static String ak="key"; // application key
    static String bs=""; // base server
    static String fu="datamanager/v2/upload-data"; // function
    static String dm=bs+fu+"?key="+ak+"&json=%7B%22clientId%22:%22"+ci+"%22,%22password%22:%22"+pw+"%22,%22tableName%22:%22mqap."+ci+"_"+tn+"%22%7D"; // data manager request url
    static String fs=File.pathSeparator;
    static String fn="C:\\path\\file.csv";
    public static void main(String[] args) throws Exception {
        HttpClient hc= new DefaultHttpClient();
        HttpPost hp=new HttpPost(dm);
        FileBody fb=new FileBody(new File(fn));
        MultipartEntity me=new MultipartEntity();
        HttpResponse hr=hc.execute(hp);