Skip to content

Access the Immobilienscout24 Import/Export REST API using C#

License

Notifications You must be signed in to change notification settings

robiwahn/IS24RestApi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IS24RestApi

A small library that accesses the Immobilienscout24 Import/Export REST API using RestSharp.

Getting Started

IS24RestApi is available as a NuGet package.

The IS24Client class has CRUD methods for all resource types and the SampleConsole project shows a few uses. You need to acquire OAuth credentials beforehand (e.g. by carrying out these steps) and put them in the config.json file that's read from the current working directory at runtime (see the included config.example.json file).

All API calls are carried out asynchronously and the paging call GetRealEstatesAsync() uses Reactive Extensions to return the real estate objects both lazily and asynchronously.

Regenerating API Types

The classes in the Types.generated.cs file were generated from the XSD files provided by IS24. Unfortunately to regenerate them there is currently some massaging necessary:

  1. Generate file: xsd alterationdate-1.0.xsd attachmentsorder-1.0.xsd ... /c /n:IS24RestApi from a Visual Studio command prompt (xsd *.xsd doesn't work :(
  2. Replace Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Namespace="http://rest.immobilienscout24.de/schema/common/1.0" with Form=System.Xml.Schema.XmlSchemaForm.Unqualified
  3. Remove abstract from RealEstate, Attachment classes (RestSharp limitation)
  4. Add #pragma warning disable 1591 and #pragma warning restore 1591 at the top and bottom resp.

There are two PowerShell scripts in the xsd folder to automate this process. Open a Visual Studio command prompt and execute them with powershell .... If you get a permissions error, open a PowerShell and type Set-ExecutionPolicy Unrestricted (more about this here).

  1. DownloadSchemaFiles.ps1 downloads all .xsd files from here and moves messages*.xsd to the includes folder.
  2. GenerateClasses.ps1 calls xsd.exe and modifies the resulting .cs file as described above, resulting in a file called Types.generated.cs. Move it to the project folder if everything went well.

Contributing

Pull requests to improve are welcome :)

About

Access the Immobilienscout24 Import/Export REST API using C#

Resources

License

Stars

Watchers

Forks

Packages

No packages published