ojengwa / airbnb-sdk

A Typescript wrapper around the Airbnb API (unofficial).
MIT License
4 stars 2 forks source link

Feat: Allow sending message to hosts #28

Open ShivamJoker opened 1 year ago

ShivamJoker commented 1 year ago

I'm submitting a ...

[ ] bug report [x] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project

Summary

I couldn't find any API here allowing sending message to guests. It would be great to get it here.

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Here is the copied fetch request query, I am not sure what I am doing wrong.

await fetch("https://www.airbnb.co.in/api/v3/ThreadCreateMessageItem?operationName=ThreadCreateMessageItem&locale=en-IN&currency=INR", {
    "credentials": "include",
    "headers": {
        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0",
        "Accept": "*/*",
        "Accept-Language": "en-US,en;q=0.5",
        "Content-Type": "application/json",
        "X-Airbnb-Supports-Airlock-V2": "true",
        "X-Airbnb-API-Key": "d306zoyjsyarp7ifhu67rjxn52tv0t20",
        "X-CSRF-Token": "V4$.airbnb.co.in$X9DM-r23c2xxxxx",
        "X-CSRF-Without-Token": "1",
        "X-Airbnb-GraphQL-Platform": "web",
        "X-Airbnb-GraphQL-Platform-Client": "minimalist-niobe",
        "X-Niobe-Short-Circuited": "true",
        "X-Client-Version": "51e85df475b0d32d053d479a30064237ae2aa14b",
        "x-client-request-id": "19taw2615a1wjr0dv41fs1rqd8yw",
        "Sec-Fetch-Dest": "empty",
        "Sec-Fetch-Mode": "cors",
        "Sec-Fetch-Site": "same-origin",
        "Sec-GPC": "1"
    },
    "referrer": "https://www.airbnb.co.in/guest/inbox/155X00X005?thread_type=home_booking&inbox_type=guest",
    "body": "{\"operationName\":\"ThreadCreateMessageItem\",\"variables\":{\"threadId\":\"1556009005\",\"contentType\":\"text\",\"content\":{\"body\":\"testing\"},\"uniqueIdentifier\":\"e768f467-eb99-49a4-9c9a-525bab9d007b\"},\"extensions\":{\"persistedQuery\":{\"version\":1,\"sha256Hash\":\"657f2cf7cea65a789f6d6e1270003f93fa8c177598cbb706d11a06576891d860\"}}}",
    "method": "POST",
    "mode": "cors"
});
r3v3r3seEntropy commented 8 months ago

Were you able to make this work?