API

Code Snippet

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

API » Code Snippet

Use the code snippets below to generate services compatible with Entrata' API in .NET, Java, or PHP.



/* An Example XML Request */
string xmlRequest = '
<request>
    <auth>
        <type>basic</type>
    </auth>
    <method>
        <name>required_service_name</name>
        <params>
            use the parameters required for the web service here
        </params>
    </method>
</request>';

/* An Example JSON Request */ string jsonRequest = ' {     "auth": {         "type" : "basic"     },     "method": {         "name": "required_service_name",         "params": {             use the parameters required for the web service here         }     } }';
/* 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 <BASE64 ENCODED VALUE OF USERNAME:PASSWORD>");
/* Initiate the request writer */ StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream());
/* If you want to send an XML Request, use these options */ webRequest.ContentType = 'APPLICATION/XML; CHARSET=UTF-8'; requestWriter.Write(xmlRequest);
/* If you want to send an XML Request, use these options */ webRequest.ContentType = 'APPLICATION/JSON; CHARSET=UTF-8'; requestWriter.Write(jsonRequest);
requestWriter.Close();
/* Read the response */ StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()); string responseData = responseReader.ReadToEnd(); responseReader.Close();

Your life is about to
get a whole lot easier

Sign in
to Entrata