Skip to content

Commit

Permalink
GET Publish
Browse files Browse the repository at this point in the history
Possible to retrieve the publishchannels of a real estate.
  • Loading branch information
Fabian Mielke committed Mar 17, 2015
1 parent 978bb37 commit 2e4c78c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
26 changes: 26 additions & 0 deletions Immocaster/Immobilienscout/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1672,4 +1672,30 @@ private function _changeObjectAttachment($aArgs)
$req->unset_parameter('type');
return parent::getContent($req,$sSecret);
}
/**
* Publishchannels eines Objektes ermitteln
* (Hierfür müssen besondere Berechtigungen
* bei ImmobilienScout24 beantragt werden.)
*
* @param array $aArgs
* @return mixed
*/
private function _getPublish($aArgs)
{
$aRequired = array('username','realestate');
$oToken = null;
$sSecret = null;
if(!isset($aArgs['username']))
{
$aArgs['username'] = $this->_sDefaultUsername;
}
list($oToken, $sSecret) = $this->getApplicationTokenAndSecret($aArgs['username']);
if($oToken === NULL || $sSecret === NULL)
{
return IMMOCASTER_SDK_LANG_APPLICATION_NOT_CERTIFIED;
}
$req = $this->doRequest('offer/v1.0/publish',$aArgs,$aRequired,__FUNCTION__,$oToken);
$req->unset_parameter('username');
return parent::getContent($req,$sSecret);
}
}
6 changes: 5 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Immocaster PHP SDK v1.1.75
Immocaster PHP SDK v1.1.76
==========================
Author: Norman Braun (http://www.medienopfer98.de)
Copyright: Immobilien Scout GmbH
Expand All @@ -9,6 +9,10 @@ Das PHP SDK von ImmobilienScout24 steht unter der FreeBSD Lizenz zur Verfügung
History
=======

SDK Version 1.1.76
- GET Publish zum Ermitteln der Publishchannels von einem Objekt möglich. Optional kann auch der Channel mitgegeben werden.
- 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()).

SDK Version 1.1.75
- DELETE Contact möglich. Powered by amenk.

Expand Down
13 changes: 13 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,19 @@
$res = $oImmocaster->changeObjectAttachment($aParameter);
echo '<div class="codebox"><textarea>'.$res.'</textarea></div>';*/

/**
* Ermittelt die Publishchannels eines Objektes
* API Doku: http://api.immobilienscout24.de/our-apis/import-export/publish/get.html
*/
echo '<h2>Publishchannels eines Objektes:</h2><br/>Diese Funktion wurde auskommentiert, da dafür eine Zertifizierung nötig ist.<br/><br/>';
/*$aParameter = array(
'username'=>'USERNAME',
'realestate'=>'ESTATEID' // ScoutID
// 'publishchannel'=>'10000' // optional: 10000=IS24, 10001=HP
);
$res = $oImmocaster->getPublish($aParameter);
echo '<div class="codebox"><textarea>'.$res.'</textarea></div>';*/

?>
</body>
</html>

0 comments on commit 2e4c78c

Please sign in to comment.