Scout24 / restapi-php-sdk

SDK für PHP-Entwickler um die Arbeit mit der API von ImmobilienScout24 zu vereinfachen. Über die API erhält man Ergebnislisten, Objektdaten, uvm. von ImmobilienScout und kann diese Daten inhherhalb seines Webservice integrieren. Die Dokumentation zum SDK findet man unter https://github.com/Immocaster/php-sdk/wiki.
65 stars 45 forks source link

Add support for real estate projects #45

Open No5251 opened 7 years ago

No5251 commented 7 years ago

Please add support for the elements "realEstateProject" and "realEstateProjectEntry": https://api.immobilienscout24.de/our-apis/import-export/realestateproject.html

chris-blues commented 3 years ago

I second that request.

It seems, in the last 4 years this didn't happen. Are there any known workarounds? Or do you simply generate the XML "by hand"?

Thanks and take care everybody!

chris-blues commented 3 years ago

Working on a possible update. Need your insights! What do you people think about this? Would it even work like this?

https://github.com/chris-blues/restapi-php-sdk/commit/75e0641621bf0080f62e121422d4e488a02bb7c3

chris-blues commented 3 years ago

Seems to work, somewhat...

Request: https://rest.immobilienscout24.de/restapi/api/offer/v1.0/user/me/realestateproject/97450/realestateprojectentry

<realestateproject:realEstateProjectEntries xmlns:realestateproject="http://rest.immobilienscout24.de/schema/offer/realestateproject/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns4="http://rest.immobilienscout24.de/schema/platform/gis/1.0">
   <realEstateProjectEntry>
      <realEstateExternalId>71461</realEstateExternalId>
   </realEstateProjectEntry>
</realestateproject:realEstateProjectEntries>

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<common:messages xmlns:common="http://rest.immobilienscout24.de/schema/common/1.0" xmlns:gis="http://rest.immobilienscout24.de/schema/platform/gis/1.0">
    <message>
        <messageCode>ERROR_COMMON_ACCESS_DENIED</messageCode>
        <message>Internal Authorization Error</message>
    </message>
</common:messages>

:-/ any help appreciated!

chris-blues commented 3 years ago

The error was about missing permissions on Immoscout's side. Now, this code seems to work:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:realEstateProjectEntries xmlns:ns2="http://rest.immobilienscout24.de/schema/offer/realestateproject/1.0" xmlns:ns3="http://www.w3.org/1999/xlink">
    <realEstateProjectEntry>
        <messageCode>MESSAGE_RESOURCE_CREATED</messageCode>
        <message>real estate with external id 73207 was added to project 97450</message>
        <realEstateExternalId>73207</realEstateExternalId>
    </realEstateProjectEntry>
</ns2:realEstateProjectEntries>

The only thing missing is a good response on the side of Immocaster. Now it returns (bool) false Though the response looks like a success. Any comments on that?

chris-blues commented 3 years ago

Opened a pull request here: https://github.com/Scout24/restapi-php-sdk/pull/54

Here: https://github.com/Scout24/restapi-php-sdk/pull/55

chris-blues commented 3 years ago

It's finally done! Now it only needs to be merged...

chris-blues commented 3 years ago

It's finally done! Now it only needs to be merged...