public int createIncompleteResponse ( int surveyId , String token ) throws LimesurveyRCException { LsApiBody . LsApiParams params = getParamsWithKey ( surveyId ) ; HashMap < String , String > responseData = new HashMap <> ( ) ; responseData . put ( "submitdate" , "" ) ; String date = ZonedDateTime . now ( ) . format ( DateTimeFormatter . ISO_LOCAL_DATE ) + " " + ZonedDateTime . now ( ) . format ( DateTimeFormatter . ISO_LOCAL_TIME ) ; responseData . put ( "startdate" , date ) ; responseData . put ( "datestamp" , date ) ; if ( StringUtils . isNotEmpty ( token ) ) { responseData . put ( "token" , token ) ; } params . setResponseData ( responseData ) ; return callRC ( new LsApiBody ( "add_response" , params ) ) . getAsInt ( ) ; }
Create an incomplete response its field completed is set to N and the response doesn t have a submitdate .