API

Code Snippet

Select any of the web services below to view details and examples.

API » Leases » sendLeaseDocuments

sendLeaseDocuments

This API can be used to upload documents onto Entrata leases such as application, lease, policy, agreement documents. This API accepts files as a form file upload and the Content-Type should be "multipart/form-data". Please see the "Code Snippet" tab for more technical details and some sample code examples.



*propertyId [Integer] This is a required field. This field accepts single value.
leaseId [Integer] This is an optional field. This field accepts single value.
applicantId [Integer] This is an optional field. This field accepts single value.
applicationId [Integer] This is an optional field. This field accepts single value.
*fileName [String] This is a required field. This field accepts single value.
*leaseFileType [String] This is a required field. This field accepts single value. Use the system code of the leaseFileType node from the getPickLists AP I response.
isShowInResidentPortal [Boolean] This is an optional field. This field accepts single value. This controls whether the document will show up in their Resident Port al and be visible to the resident.
customerIds [String] This is an optional field. This field accepts comma seperated multiple values. If provided this file will attach to the mentioned customers. if skipp ed, this file will be attached to all the customers.
No Parameters Found.

Request URL

https://YOUR_DOMAIN.entrata.com/api/leases

Request Type

Request Copy to Clipboard

Response Copy to Clipboard



/* An Example XML Request */
string xmlRequest = '
<request>
    <auth>
        <type>basic</type>
    </auth>
    <requestId>15</requestId>
    <method>
        <name>sendLeaseDocuments</name>
        <params>
        <propertyId>xxx</propertyId> <!-- required -->
        <leaseId>xxxx</leaseId> <!-- Required -->
        <files>
           <file>
               <fileName>file1.pdf</fileName> <!-- required -->
               <leaseFileType>OTHER</leaseFileType>
               <!-- required. Use the system code of the leaseFileType node from the getPickLists API response. -->
               <isShowInResidentPortal>1</isShowInResidentPortal>
               <customerIds>xxx,xxx</customerIds>
               <!-- optional, if provided this file will attach to the mentioned customers. if skipped, this file will attached to all the customers -->
           </file>
           <file>
               <fileName>file2.pdf</fileName> <!-- required -->
               <leaseFileType>OTHER</leaseFileType>
               <!-- required. Use the system code of the leaseFileType node from the getPickLists API response. -->
               <isShowInResidentPortal>1</isShowInResidentPortal>
               <customerIds>xxx,xxx</customerIds>
               <!-- optional, if provided this file will attach to the mentioned customers. if skipped, this file will attached to all the customers -->
           </file>
        </files>
        </params>
    </method>
</request>';

/* An Example JSON Request */ string jsonRequest = '{     "auth": {       "type": "basic"     },     "requestId": "15",     "method": {         "name": "sendLeaseDocuments",         "params": {         "propertyId": "xxx",         "leaseId": "xxxx",         "files": {         "file": [             {               "fileName": "file1.pdf",               "leaseFileType": "OTHER",               "isShowInResidentPortal": "1",               "customerIds": "xxx,xxx"             },             {               "fileName": "file2.pdf",               "leaseFileType": "OTHER",               "isShowInResidentPortal": "1",               "customerIds": "xxx,xxx"             }          ]        }       }      }     }';
/* Initiate a Web Request object */ HttpWebRequest webRequest = null; webRequest = WebRequest.Create(' REPLACE THIS WITH THE WEB SERVICE URL ') as HttpWebRequest; webRequest.Method = 'POST'; webRequest.Headers.Add("Authorization", "Basic ");
/* Add Form data */
FileInfo fi = new FileInfo(@"E:\RabitMQ\Learn RabbitMQ With C.pdf"); string fileName = fi.Name; byte[] fileContents = File.ReadAllBytes(fi.FullName);
string boundary = "--AaB03x";
StringBuilder sb = new StringBuilder();
sb.AppendLine(boundary); sb.AppendLine(string.Format("Content-Disposition: form-data; name=\"{0}\"", "requestBody")); sb.AppendLine(); sb.AppendLine(xmlRequest);
sb.AppendLine(boundary); sb.AppendLine(string.Format("Content-Disposition: form-data; name=\"{0}\"", "requestContentType")); sb.AppendLine(); sb.AppendLine("application/xml; CHARSET=UTF-8");
sb.AppendLine(boundary); sb.AppendLine(string.Format("Content-Disposition: file; name=\"{0}\"; filename=\"{1}\"", "file1", fileName)); sb.AppendLine("Content-Type: application/octet-stream"); sb.AppendLine(); sb.AppendLine(Encoding.UTF8.GetString(fileContents)); sb.AppendLine(boundary);
/* Initiate the request writer */ StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream());
/* If you want to send an XML Request, use these options */ webRequest.ContentType = "multipart/form-data; boundary=AaB03x"; requestWriter.Write(xmlRequest);
/* If you want to send an XML Request, use these options */ webRequest.ContentType = 'multipart/form-data; boundary=AaB03x'; requestWriter.Write(jsonRequest);
requestWriter.Close();
/* Read the response */ StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()); string responseData = responseReader.ReadToEnd(); responseReader.Close();

/* An Example XML Request */
string xmlRequest = '
<request>
    <auth>
        <type>basic</type>
    </auth>
    <requestId>15</requestId>
    <method>
        <name>sendLeaseDocuments</name>
        <params>
        <propertyId>xxx</propertyId> <!-- required -->
        <leaseId>xxxx</leaseId> <!-- Required -->
        <files>
           <file>
               <fileName>file1.pdf</fileName> <!-- required -->
               <leaseFileType>OTHER</leaseFileType>
               <!-- required. Use the system code of the leaseFileType node from the getPickLists API response. -->
               <isShowInResidentPortal>1</isShowInResidentPortal>
               <customerIds>xxx,xxx</customerIds>
               <!-- optional, if provided this file will attach to the mentioned customers. if skipped, this file will attached to all the customers -->
           </file>
           <file>
               <fileName>file2.pdf</fileName> <!-- required -->
               <leaseFileType>OTHER</leaseFileType>
               <!-- required. Use the system code of the leaseFileType node from the getPickLists API response. -->
               <isShowInResidentPortal>1</isShowInResidentPortal>
               <customerIds>xxx,xxx</customerIds>
               <!-- optional, if provided this file will attach to the mentioned customers. if skipped, this file will attached to all the customers -->
           </file>
        </files>
        </params>
    </method>
</request>';

/* An Example JSON Request */ string jsonRequest = '{     "auth": {       "type": "basic"     },     "requestId": "15",     "method": {         "name": "sendLeaseDocuments",         "params": {         "propertyId": "xxx",         "leaseId": "xxxx",         "files": {         "file": [             {               "fileName": "file1.pdf",               "leaseFileType": "OTHER",               "isShowInResidentPortal": "1",               "customerIds": "xxx,xxx"             },             {               "fileName": "file2.pdf",               "leaseFileType": "OTHER",               "isShowInResidentPortal": "1",               "customerIds": "xxx,xxx"             }          ]        }       }      }     }';
import java.io.InputStream; import org.apache.commons.httpclient.HttpClient;
public class PostExample {
public static void main(String[] args){
HttpClient httpClient = new DefaultHttpClient();
try { HttpPost request = new HttpPost("REPLACE THIS WITH THE WEB SERVICE URL"); request.addHeader("Authorization", "Basic <BASE64 ENCODED VALUE OF USERNAME:PASSWORD>"); request.addHeader("content-type", "multipart/form-data");
File file1 = new File("[/path/to/upload]");
MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.addBinaryBody( "file1", new FileInputStream( file1 ), ContentType.APPLICATION_OCTET_STREAM, file1.getName() );
/* If you want to send an XML Request, use these options */ builder.addTextBody( "requestBody", xmlRequest ); builder.addTextBody( "requestContentType", "APPLICATION/XML; CHARSET=UTF-8" );
/* If you want to send an JSON Request, use these options */ builder.addTextBody( "requestBody", jsonRequest ); builder.addTextBody( "requestContentType", "APPLICATION/JSON; CHARSET=UTF-8" );
HttpEntity multipartFormData = builder.build(); request.setEntity( multipartFormData );
HttpResponse response = httpClient.execute(request);
// handle response here... System.out.println(response); }catch (Exception ex) { // handle exception here ex.printStackTrace(); } finally { httpClient.getConnectionManager().shutdown(); } } }

/* An Example XML Request */
string xmlRequest = '
<request>
    <auth>
        <type>basic</type>
    </auth>
    <requestId>15</requestId>
    <method>
        <name>sendLeaseDocuments</name>
        <params>
        <propertyId>xxx</propertyId> <!-- required -->
        <leaseId>xxxx</leaseId> <!-- Required -->
        <files>
           <file>
               <fileName>file1.pdf</fileName> <!-- required -->
               <leaseFileType>OTHER</leaseFileType>
               <!-- required. Use the system code of the leaseFileType node from the getPickLists API response. -->
               <isShowInResidentPortal>1</isShowInResidentPortal>
               <customerIds>xxx,xxx</customerIds>
               <!-- optional, if provided this file will attach to the mentioned customers. if skipped, this file will attached to all the customers -->
           </file>
           <file>
               <fileName>file2.pdf</fileName> <!-- required -->
               <leaseFileType>OTHER</leaseFileType>
               <!-- required. Use the system code of the leaseFileType node from the getPickLists API response. -->
               <isShowInResidentPortal>1</isShowInResidentPortal>
               <customerIds>xxx,xxx</customerIds>
               <!-- optional, if provided this file will attach to the mentioned customers. if skipped, this file will attached to all the customers -->
           </file>
        </files>
        </params>
    </method>
</request>' ;

/* An Example JSON Request */ $jsonRequest = '{     "auth": {       "type": "basic"     },     "requestId": "15",     "method": {         "name": "sendLeaseDocuments",         "params": {         "propertyId": "xxx",         "leaseId": "xxxx",         "files": {         "file": [             {               "fileName": "file1.pdf",               "leaseFileType": "OTHER",               "isShowInResidentPortal": "1",               "customerIds": "xxx,xxx"             },             {               "fileName": "file2.pdf",               "leaseFileType": "OTHER",               "isShowInResidentPortal": "1",               "customerIds": "xxx,xxx"             }          ]        }       }      }     }' ;
$resCurl = curl_init();
curl_setopt( $resCurl, CURLOPT_POST, true ); curl_setopt( $resCurl, CURLOPT_URL, REPLACE THIS WITH THE WEB SERVICE URL ); curl_setopt( $resCurl, CURLOPT_RETURNTRANSFER, 1 );
$strFirstFileName = '<filename with path>'; $strSecondFileName = '<filename with path>'; if( true == function_exists( 'curl_file_create' ) ) { $strFirsFilePath = curl_file_create( $strFirstFileName ); $strSecondFilePath = curl_file_create( $strSecondFileName ); } else { $strFirsFilePath = '@' . realpath( $strFirstFileName ); $strSecondFilePath = '@' . realpath( $strSecondFileName ); }
/* If you want to send an XML Request, use these options */ $arrmixPost = [ 'requestContentType' => 'APPLICATION/XML; CHARSET=UTF-8', 'requestBody' => $xmlRequest, 'file1' => $strFirsFilePath, 'file2' => $strSecondFilePath ]; /* If you want to send a JSON Request, use these options */ $arrmixPost = [ 'requestContentType' => 'APPLICATION/JSON; CHARSET=UTF-8', 'requestBody' => $jsonRequest, 'file1' => $strFirsFilePath, 'file2' => $strSecondFilePath ];
curl_setopt( $resCurl, CURLOPT_HTTPHEADER, array( 'Content-type: multipart/form-data', 'Authorization: Basic <BASE64 ENCODED VALUE OF USERNAME:PASSWORD>' ) ); curl_setopt( $resCurl, CURLOPT_POSTFIELDS, $arrmixPost ); $result = curl_exec( $resCurl ); if( false === $result ) { echo 'Curl error: ' . curl_error( $resCurl ); curl_close( $resCurl ); } else { curl_close( $resCurl ); echo $result; }

Your life is about to
get a whole lot easier

Sign in
to Entrata