zxol / airbnbapi

Unofficial airbnb.com REST API wrapper for node.js
MIT License
218 stars 52 forks source link

Co-Host Issua #35

Open abcdtree opened 5 years ago

abcdtree commented 5 years ago

While most of the functions this API provide are based on Primary Host, right? For example, the function, will only return the Listings which hosted by the token authorized user. What if there are listings that co-hosted by the user, is there any route we could use to get the limited version of information which is provided to the co-host?

antocorr commented 4 years ago

Hi, have you tried to use getOwnListings? It returns co-hosted listings too.

pbvillaflores commented 4 years ago

Does getOwnListings() actually work? I was trying it--and not sure why it has a userId argument.

antocorr commented 4 years ago

userId is the user you are querying. So the chain should be,

airbnb.getOwnUserInfo(TOKEN).then(userInfo => {
     airbnb.getOwnListings({
        token: TOKEN,
        userId: userInfo.id
    }).then()
igorzelaya commented 4 years ago

Indeed. For example

airbnb.getReservations({token: myToken,offset: 0,limit: 4});

returns an empty array. Does anybody knows how to solve this problem?