reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

API only returns Sales properties #9816

Closed janchimugica closed 11 months ago

janchimugica commented 11 months ago

I can successfully connect to the API and retrieve property data. However, I only seem to be able to see properties for sale.

I have tried passing no statuses at all, as well as all the statuses, and even only toLet but no luck.

My client has confirmed they have Lettings properties. Not sure if I should post here their client ID?

I have contacted their account manager asking to check if they have additional office IDs for lettings but they keep on sending me here.

Thanks

plittlewood-rpt commented 11 months ago

Hi @janchimugica please can you provide the client id - it's fine to post this here. Thanks

janchimugica commented 11 months ago

Sure, it's XLE

plittlewood-rpt commented 11 months ago

Hi @janchimugica are you able to provide a curl request (or similar) that shows how you are calling the API please? I've just called the API for this customer and the first property returned is a lettings property, so I suspect this is something simple.

There are 448 (non-archived) sales properties in this customer's system, which you should be able to retrieve using

GET https://platform.reapit.cloud/properties?marketingMode=selling

As an example, property id SAL230161 is an example

janchimugica commented 11 months ago

Hi @plittlewood-rpt, thanks for the quick reply.

The code is part of a big PHP class with many methods, so it's difficult to decouple and share. However, I've just tried in Postman and still get no lettings. I'm also sure I must be missing something really stupid that's literally in front of me, but I just can't see it 🫣

This is how the request looks:

https://platform.reapit.cloud/properties/?pageSize=100&embed=images&sellingStatus[0]=toLet&internetAdvertising=true

I'm obviously generating the token and passing it to the request above :)

If change sellingStatus[0] to forSale or underOffer, I do get sales properties.

Could you please share the ID of a lettings property?

plittlewood-rpt commented 11 months ago

Hi there Thanks. Your problem is that toLet is a lettingStatus not a sellingStatus which I suspect is the reason you're not getting any data back with that filter

Thanks

janchimugica commented 11 months ago

Hi @plittlewood-rpt, see? It was something really stupid 🤦🏻‍♂️ Bit weird though because when I was not including any sellingStatus I still had no lettings.

Anyway, I can see them now and I also now know there are two different params for statuses!

Thank you 🙏

janchimugica commented 11 months ago

Hi @plittlewood-rpt,

Apologies, one last thing. I am now trying to pass:

I want to be able to retrieve both sales and lettings properties but only of certain statuses. Does that not work?

Thank you

plittlewood-rpt commented 11 months ago

HI @janchimugica the filters are currently additive, so unless you have a dual marketed property (marketingMode of sellingAndLetting) with a sellingStatus of forSale AND a lettingStatus of toLet, you'll get no results. There are no plans to provide a mechanism for defining how you wish filters to be applied (ie AND or OR) at this time, but you are welcome to log a feature request if you have a strong need for it and we can review it in line with our development processes.