gathertown / api-examples

documentation: https://gathertown.notion.site/Gather-HTTP-API-3bbf6c59325f40aca7ef5ce14c677444
29 stars 8 forks source link

Signed in user not recognised after loading guestlist via setEmailGuestlist API #1

Closed phil-maynard closed 3 years ago

phil-maynard commented 3 years ago

Issue summary

I've been using the guest list feature to restrict access to a Gather space. This has been working great when loaded via CSV file. However, when I attempt to load the guest list via the setEmailGuestlist API, although the list looks correct within the Gather space dashboard, the logged in user [me] isn't recognised as being on the list.

HTTP Post value

HTTP Post with the following body

{
  "apiKey": "aQ************nWEY",
  "spaceId": "I2s*********B\\Party",
  "overwrite": "True",
  "guestlist": "{\n \"philmaynard@************.org\":  {\n    \"role\" : \"admin\",\n    \"name\": \"Phil Maynard\",\n    \"affiliation\": \"***************\"\n  }\n}"
}

Background

I'm using Microsoft Power Automate to get the members of a Microsoft 365 Group and add them to the Gather space guestlist. I'm generating a JSON object within the Power Automate flow based on the group membership and using this object within the HTTP Post.

I suspect that the JSON is miss-formatted or that I'm not referencing it correctly within the HTTP Post but I've tried a numebr of things with the same result - see images 2021-01-14_17-52-01 2021-01-14_17-49-36 2021-01-14_17-50-58

Postscript

Thanks for everything you and the team have done to make Gather.Town! It's an amazing space and I'm really looking forward to promoting it more within my organisation. Thanks Again. Phil

phil-maynard commented 3 years ago

Sorry, I realised my mistake! I forgot to set the content type in the header to Content-type: application/json; charset=utf-8 This changed fixed my problem 😀 2021-01-15_09-54-09

npfoss commented 3 years ago

glad you sorted it out, sorry for the trouble!