Skip to main content
Question

Connecting to idealista API through Oauth2


I am new using Oauth2 authorization protocol, so please, don't blame on me if I make sillyquestions.

I am triying to access the API of Idealista (a real state company) to get information about the offer they have about offices, warehouses, etc. I got from Idealista an Apikey and a secret and I used this information to get a token making an http request like this:

 

POST https://api.idealista.com/oauth/token?grant_type=client_credentials&scope;=read HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/mixed; boundary="----=_Part_7_1090412765.1526401548680" MIME-Version: 1.0 Content-Length: 45 Host: api.idealista.com Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Cookie: APIPUBID=3d5ed4374026f476|WvsKD|WvsKD Cookie2: $Version=1 Authorization: Basic anFndmhtaGRxNmZmazBtNWY1cjZuNG1hNGYzdTNncG86bmw3VHhqQ2cybWU3

Once I get the token as a result of the previos http request, I can make a new request in order to obtain the information I am looking for. Here you have an example:

POST https://api.idealista.com/3.5/es/search?locale=es&maxItems;=20&numPage;=1&operation;=saleℴ=publicationDate&propertyType;=garages&sort;=desc&apikey;=jqgvhmhdq6ffk0m5f5r6n4ma4f3u3gpo&t;=1&language;=es&bankOffer;=true&locationId;=0-EU-ES-28 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: application/json Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIl0sImV4cCI6MTUyNjQ0NDY5MSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9QVUJMSUMiXSwianRpIjoiMDJhNzdhODQtODlhYi00MzAyLWI5Y2QtODFkNDc4OWJjMGIwIiwiY2xpZW50X2lkIjoianFndmhtaGRxNmZmazBtNWY1cjZuNG1hNGYzdTNncG8ifQ.CZulxxvMXZvuIt_UDMeXiKC9wsnTgZw-y__7-DSaHQc Content-Length: 0 Host: api.idealista.com Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

I have tested the previous process in SoapIUI successfully and now I am trying to reproduce this in FME Desktop. I tried to make a new "Web connection" with the information included in the attached image. When I test the connection I get this message:

{"message":"not found","httpStatus":404}

Idealista has not provided me any information about the "refresh token" url, so I put the same as for the "retrieve token". On the other hand, the "grant_type" parameter I have to specify when making the "retrieve token" request (as stated by Idealista) has to be "client_credentials", meanwhile in the FME form, this parameter is fixed as "authorization_code".

Any help will be more than welcome. Many thanks.

2 replies

fgiron
Supporter
Forum|alt.badge.img+20
  • Supporter
  • June 8, 2018

Hi @jcglez2

 

It looks like the requirements of the Idealista API are not supported by the current OAuth 2.0 Web Conecctions template. The Token service requires both headers and parameters, and on top of that the credentials have to be base64-encoded.

However, you can easily use this API using 2 HTTPCallers, one for the Token service and another one for the Property Search service. I tried it using the following workflow and it worked


fgiron
Supporter
Forum|alt.badge.img+20
  • Supporter
  • June 8, 2018
fgiron wrote:

Hi @jcglez2

 

It looks like the requirements of the Idealista API are not supported by the current OAuth 2.0 Web Conecctions template. The Token service requires both headers and parameters, and on top of that the credentials have to be base64-encoded.

However, you can easily use this API using 2 HTTPCallers, one for the Token service and another one for the Property Search service. I tried it using the following workflow and it worked

Thanks a lot @NathanAtSafe for your support with this issue!

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings