I’m a front-end developer using the Freshchat API to integrate a chat feature into a mobile app I’m creating using Appgyver.
To initialize the conversation, I’m performing the following calls:
GET /channels
POST /users
I use the data returned from these requests to get the needed channel_id and to create a user_id for use in
POST /conversations
Every time I make this POST, I receive a 500 error in response.
The issue is that the user ID that the POST /users request returns seemingly doesn’t exist. I try doing a request later to /users/${user_id} with the returned ID and it 404s. The user also does not appear in the People list in Freshchat’s admin.
I’ve tried making these same series of requests in other settings (e.g., curl, browser console) and they work correctly, showing both the user and the newly created conversation in the admin.
I’ve tried making the same set of requests in Appgyver using hardcoded user_ids and that works.
I’ve also reviewed the request object structure and headers many times and could not find any errors.
So would there be any reason that this series of requests only wouldn’t work in Appgyver? I understand that this could be an issue with Appgyver. But that doesn’t make sense to me because I’m receiving the correct response when posting to /users. It’s like I’m receiving a phantom user of sorts that isn’t actually getting put into the database. In addition, Appgyver is built on React and is using the same underlying browser methods to perform HTTP requests, making this situation even more confusing.
Any help would be appreciated.