99acre - Pull API
99acre - Pull API
99acre - Pull API
The My99 Queries and Responses can be pulled out using the data exchange xmls. User's
username and password are used to authenticate requests.
Request xml, Response xml, Error xmland API doc shared with users are attached with this
page.
Tags Info
Request XML
The Request xml will contain client's username & password used to login on 99acres. It
should also contain a start date and end date only in format YY-MM-DD hh:mm:ss format,
the queries received on the site between these dates will be provided in the response xml in
the format described in the sample response xml.
1. user_name
2. pwd
3. start_date
4. end_date
Response XML
1) Resp-- The main tag that would repeat for each response of Customer
I)QryDtl -- Details wrt query received Attributes [TblId --For Internal Use ie we can track
with this our corresponding table entry; ResType -- S2M/LEAD/SIMPLE QUERY]
The error cases that we have identified till now are as:-
* In case of 0 responses for customer the Resp tag would be empty with ActionStatus =
true
Restrictions:
1. There will be limit on the difference in start date & end dates between which data can be
pulled from My99 (2 days).
3. Date till which data has been pulled will be tracked at client side.
Note:
https://www.99acres.com/99api/postData2.php?api=getmy99Response
PHP CODE:
<?php
$url = "https://www.99acres.com/99api/v1/getmy99Response/OeAuXClO43hwseaXEQ/uid/";
$request = "<?xml
version='1.0'?><query><user_name>XXXXX</user_name><pswd>YYYYYYY</pswd><start_date>2015-
05-22 00:00:00</start_date><end_date>2015-05-23 00:00:00</end_date></query>";
// echo $request;
$allParams = array('xml'=>$request);
$leads = get99AcresLeads($allParams,$url);
print_r($leads);
function get99AcresLeads($allParams,$url){
$crl = curl_init($url);
curl_setopt ($crl, CURLOPT_POST, 1);
curl_setopt ($crl, CURLOPT_POSTFIELDS, $allParams);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER,1);
return curl_exec ($crl);
}
Sample Code
using System.IO;
using System;
using System.Net;
using System.Text;
using System.Collections.Specialized;
class Program
{
static void Main()
{
ERROR XML:
1 <?xml version="1.0"?>
2 <Xml ActionStatus = "false">
3 <ErrorDetail>
4 <Code>ERROR-123</Code>
5 <Message>Sorry the authentication does not succeed</Message>
6 </ErrorDetail>
7 </Xml>
Request XML:
1 <?xml version="1.0"?>
2 <query>
3 <user_name>Bob</user_name>
4 <pswd>[email protected] </pswd>
5 <start_date>2013-02-20 00:00:00</start_date>
6 <end_date>2013-02-20 00:00:00</end_date>
7 </query>
Response XML:
1 <?xml version="1.0"?>
2 <Xml ActionStatus = "true">
3 <Resp>
4 <QryDtl TblId='Q-1234' ResType='S2M'>
5 <ProdId Status='Active' Type='LP-B'>X3763167</ProdId>
6 <CmpctLabl>Residential apartment available on sale in aaa-9, noida for rs.5 crore</CmpctLabl>
7 <QryInfo>I am interested in this Property. first</QryInfo>
8 <RcvdOn>2013/02/20 11:24:00</RcvdOn>
9 </QryDtl>
10 <CntctDtl>
11 <Name>Priyanka</Name>
12 <Email>[email protected]</Email>
13 <Phone>8765456787</Phone>
14 </CntctDtl>
15 </Resp>
16 </Xml>
Updated Code:
1 <?php
2 $url = "http://www.99acres.com/99api/v1/getmy99Response/OeAuXClO43hwseaXEQ/uid/";
3 $request = "<?xml version='1.0'?><query><user_name>XXXXXX</user_name><pswd>YYYYY</pswd><start_date>20
4 $allParams = array('xml'=>$request);
5 $leads = get99AcresLeads($allParams,$url);
6 print_r($leads);
7
8
9
10 function get99AcresLeads($allParams,$url){
11 $crl = curl_init($url);
12 curl_setopt ($crl, CURLOPT_POST, 1);
13 curl_setopt ($crl, CURLOPT_POSTFIELDS, $allParams);
14 return curl_exec ($crl);
15 }
Get 99 response:
1 <?php
2
3 $url = "http://www.99acres.com/99api/v1/getmy99Response/OeAuXClO43hwseaXEQ/uid/";
4 $request = "<?xml version='1.0'?><query><user_name>XXXXXX</user_name><pswd>123456</pswd><star
5 // echo $request;
6 $allParams = array('xml'=>$request);
7 $leads = get99AcresLeads($allParams,$url);
8 print_r($leads);
9
10
11 function get99AcresLeads($allParams,$url){
12 $crl = curl_init($url);
13 curl_setopt ($crl, CURLOPT_POST, 1);
14 curl_setopt ($crl, CURLOPT_POSTFIELDS, $allParams);
15 curl_setopt ($crl, CURLOPT_RETURNTRANSFER,1);
16 return curl_exec ($crl);
17 }