warengonzaga / gathertown.js

Simple and lightweight community contributed unofficial JS/TS SDK for Gather Town's HTTPS and WebSocket APIs. šŸŒšŸ•¹šŸ’¬
https://gathertown.js.org
MIT License
40 stars 6 forks source link

setEmailGuestList giving 400 #44

Closed anoushk1234 closed 2 years ago

anoushk1234 commented 2 years ago

šŸ¤” Not Existing Bug?

šŸ‘€ Current Behavior

const Gather = gather(process.env.NEXT_PUBLIC_GATHER_API_KEY as string)
        Gather.setEmailGuestlist({
            spaceId: spaceId,
            guestlist: {
                [email]: {
                    name: name,
                    role: 'guest',
                    affiliation: 'Token Holder',
                },
            },
            overwrite: false,
        })

This is the code im using but its giving an error

        {
  "success": false,
  "message": "Some error occured",
  "error": {
    "message": "Request failed with status code 400",
    "name": "Error",
    "stack": "Error: Request failed with status code 400\n    at createError (/Users/anoushkkharangate/Documents/metapass-v2/node_modules/gathertown.js/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/Users/anoushkkharangate/Documents/metapass-v2/node_modules/gathertown.js/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/Users/anoushkkharangate/Documents/metapass-v2/node_modules/gathertown.js/node_modules/axios/lib/adapters/http.js:293:11)\n    at IncomingMessage.emit (node:events:549:35)\n    at IncomingMessage.emit (node:domain:482:12)\n    at endReadableNT (node:internal/streams/readable:1359:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)",
    "config": {
      "transitional": {
        "silentJSONParsing": true,
        "forcedJSONParsing": true,
        "clarifyTimeoutError": false
      },
      "transformRequest": [
        null
      ],
      "transformResponse": [
        null
      ],
      "timeout": 0,
      "xsrfCookieName": "XSRF-TOKEN",
      "xsrfHeaderName": "X-XSRF-TOKEN",
      "maxContentLength": -1,
      "maxBodyLength": -1,
      "headers": {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Access-Control-Allow-Origin": "*",
        "User-Agent": "axios/0.24.0",
        "Content-Length": 180
      },
      "baseURL": "https://gather.town/api/",
      "responseType": "json",
      "method": "post",
      "url": "setEmailGuestlist",
      "data": "{\"apiKey\":\"apikey\",\"spaceId\":\"ev6zKLqtsrTUXck2\\\\pepeparty\",\"guestlist\":{\"hey@anoushk.xyz\":{\"name\":\"Test1\",\"role\":\"guest\",\"affiliation\":\"Token Holder\"}},\"overwrite\":false}"
    },
    "status": 400
  }
}

šŸŽÆ Expected Behavior

it should just work

šŸ“‹ Steps To Reproduce

No response

šŸ“œ Code of Conduct

warengonzaga commented 2 years ago

Thank you for the report @anoushk1234 we'll try to replicate this issue, @princejoogie can you take a look into this?

warengonzaga commented 2 years ago

@anoushk1234 still need help on this? Anything else we can help with the issue?

anoushk1234 commented 2 years ago

@anoushk1234 still need help on this? Anything else we can help with the issue?

Nope fixed the issue thanks

warengonzaga commented 2 years ago

Awesome, I'll close this now thank you again for reporting! @anoushk1234