Skip to content

Commit 2e4c78c

Browse files
author
Fabian Mielke
committed
GET Publish
Possible to retrieve the publishchannels of a real estate.
1 parent 978bb37 commit 2e4c78c

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

Immocaster/Immobilienscout/Rest.php

+26
Original file line numberDiff line numberDiff line change
@@ -1672,4 +1672,30 @@ private function _changeObjectAttachment($aArgs)
16721672
$req->unset_parameter('type');
16731673
return parent::getContent($req,$sSecret);
16741674
}
1675+
/**
1676+
* Publishchannels eines Objektes ermitteln
1677+
* (Hierfür müssen besondere Berechtigungen
1678+
* bei ImmobilienScout24 beantragt werden.)
1679+
*
1680+
* @param array $aArgs
1681+
* @return mixed
1682+
*/
1683+
private function _getPublish($aArgs)
1684+
{
1685+
$aRequired = array('username','realestate');
1686+
$oToken = null;
1687+
$sSecret = null;
1688+
if(!isset($aArgs['username']))
1689+
{
1690+
$aArgs['username'] = $this->_sDefaultUsername;
1691+
}
1692+
list($oToken, $sSecret) = $this->getApplicationTokenAndSecret($aArgs['username']);
1693+
if($oToken === NULL || $sSecret === NULL)
1694+
{
1695+
return IMMOCASTER_SDK_LANG_APPLICATION_NOT_CERTIFIED;
1696+
}
1697+
$req = $this->doRequest('offer/v1.0/publish',$aArgs,$aRequired,__FUNCTION__,$oToken);
1698+
$req->unset_parameter('username');
1699+
return parent::getContent($req,$sSecret);
1700+
}
16751701
}

README.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Immocaster PHP SDK v1.1.75
1+
Immocaster PHP SDK v1.1.76
22
==========================
33
Author: Norman Braun (http://www.medienopfer98.de)
44
Copyright: Immobilien Scout GmbH
@@ -9,6 +9,10 @@ Das PHP SDK von ImmobilienScout24 steht unter der FreeBSD Lizenz zur Verfügung
99
History
1010
=======
1111

12+
SDK Version 1.1.76
13+
- GET Publish zum Ermitteln der Publishchannels von einem Objekt möglich. Optional kann auch der Channel mitgegeben werden.
14+
- WICHTIG: Ab dem 01.06.2015 werden die Publishchannels nicht mehr in der GETbyID Reealestate Response auftachen. Diese Informationen spielt IS24 demnächst nur noch via GET Publish (SDK: getPublish()).
15+
1216
SDK Version 1.1.75
1317
- DELETE Contact möglich. Powered by amenk.
1418

index.php

+13
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,19 @@
623623
$res = $oImmocaster->changeObjectAttachment($aParameter);
624624
echo '<div class="codebox"><textarea>'.$res.'</textarea></div>';*/
625625

626+
/**
627+
* Ermittelt die Publishchannels eines Objektes
628+
* API Doku: http://api.immobilienscout24.de/our-apis/import-export/publish/get.html
629+
*/
630+
echo '<h2>Publishchannels eines Objektes:</h2><br/>Diese Funktion wurde auskommentiert, da dafür eine Zertifizierung nötig ist.<br/><br/>';
631+
/*$aParameter = array(
632+
'username'=>'USERNAME',
633+
'realestate'=>'ESTATEID' // ScoutID
634+
// 'publishchannel'=>'10000' // optional: 10000=IS24, 10001=HP
635+
);
636+
$res = $oImmocaster->getPublish($aParameter);
637+
echo '<div class="codebox"><textarea>'.$res.'</textarea></div>';*/
638+
626639
?>
627640
</body>
628641
</html>

0 commit comments

Comments
 (0)