Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

The users csv upload will be available through the .NET data api. Details to come in a future release.

...

There are three options when uploading a Flow or Form: Insert, Copy or Replace. You can use a Stream or a file path location when uploading.

Code Block
string fileName = ....;
bool isForm = ....;
ApplicationEntry appEntry = ....; 

// If an entry with the same id already exists, it will be replaced.
// Otherwise, the archive will be uploaded with the same id.
FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(filename, isForm); 

// If an entry with the same id already exists, a copy will be made.
// Otherwise, the archive will be uploaded with the same id.
FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(filename, isForm); 

// If an entry with the same id already exists, it will be replaced.
// Otherwise, the archive will be uploaded with the same id.
FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(filename, isForm); 
 
Stream appStream = ....;
bool isForm = ....;
ApplicationEntry appEntry = ....;
 
// If an entry with the same id already exists, it will be replaced.
// Otherwise, the archive will be uploaded with the same id. 
FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(appStream,isForm);

// If an entry with the same id already exists, a copy will be made. 
// Otherwise, the archive will be uploaded with the same id. 
FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(appStream, isForm);


// If an entry with the same id already exists, it will be replaced. 
// Otherwise, the archive will be uploaded with the same id. 
FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(appStream, isForm);  

...

Note

The updates listed here are only available in .net client API version 6.1.2 or later.

 

...

How do I batch upload users from the api?

 

Note

The format of the users csv file is the same as that used through the UI users load feature.

...

Users csv upload is through HTTP.  

...

The users csv upload is available directly through HTTP. One way to do this is using cURL, but other ways are possible. Here are the steps: 

  1. Log in:  

 


Code Block
curl http://host:port/frevvo/web/login -d username=admin@tenant -d password=admin_password -d lAction=Login  -X POST  -c cookies -H Content-Type:application/x-www-form-urlencoded  

...

      2. Replace host, port, username and password above as correct for your implementation. For Live forms online, host=app.frevvo.com and the port is optional. Change http to https. 

      3. Upload the users csv file: 

Code Block
curl http://host:port/frevvo/web/tn/tenant.id/allUsers  -F notificationEmailAddress=some_email_address -F usersFile=@users_file.csv  -X POST  -b cookies -H Content-Type:multipart/form-data

...

      4. Replace host, port, tenant.id, some_email_address and users_file.csv above as correct for your implementation. If users_file.csv is not in the current directory, adjust the path accordingly. For Live forms online, host=app.frevvo.com and port is optional. Change http to https. 

      5. Check the some_email_address for incoming email with the results of the load.

 

      6. (Optional) Get the user csv back from frevvo. It will have all users, including all that were loaded: 

Code Block
curl http://host:port/frevvo/web/tn/tenant.id/allUsers  -X GET  -b cookies

...

      7. The response will be the users csv data.

 

Users csv upload through the .net client apiapi 

 

The users csv upload is available through the .net client api in Live Forms v6.1.5. Here is the code snippet:

 

Code Block
InputStreamStream userCsvData = // Obtain an inputa stream to your user csv file – ex: FileStream. 		
		 
    
       FormsService service = // Obtain form service logged in as tenant admin user 		
		UserFeed userFeed     
       UserQuery userFeedQuery = service.getFeed(
				service.getFeedURL(UserFeed.class),
				UserFeed.class);
		
		String notificationEmailAddressCreateUserQuery(null);
       UserFeed userFeed = service.Query(userFeedQuery);

        stringnotificationEmailAddress = // some email address 		
		userFeed.uploadUsersCsv        
        userFeed.UploadUsersCsv(userCsvData, notificationEmailAddress);

                // now check for the email with results

 

To get the users csv data from frevvo:  

Code Block
InputStreamStream is = userFeed.getUsersCsvGetUsersCsv();

 

You  You can specify who receives an email reporting the upload status when it is done through the API. The email is sent to the "notificationEmailAddress" that is passed in the API. The email may say something like this if there are errors during the upload:

 

Code Block
Validation occurred with errors. Users data NOT loaded. Refer to attached CSV data file for validation and/or loading result details.

...

The attached file, results.csv, will contain the details.

...