MS Rest API - Update the member using ID Answered
Hi everyone, just looking for some help using the memberstack rest api, I've been running into some issues updating members whenever they sign up.
I've setup a webhook sending new member data to my application on the member.created event, and upon receiving that member data, my application will modify some of the fields on the user, one of which is incrementing a number field relative to the newest member.
My issue comes when trying to update the member using the ID given to me, I'm making a PATCH request using the fetch api and getting a 200 from the server, but the neither the response nor the member in memberstack has the new custom fields set.
The fields already exist, but they are still empty. I may be making the request wrong, would appreciate some help
Comments
5 comments
add content-type: application/json to your fetch request.
And then don't stringify your data variable
that might fix the problem.
Ah, will try that
I got a bad request with it unstringified, which makes sense, but sending the data with the header and stringifying it worked perfectly. Thanks, can't believe I didn't catch that.
ah got it. glad you got it working!
Yep, I used the npm package for a different automation, and it worked very well. I wasn't able to use it here however since we are running this on a cloudflare worker.
very cool!
Cloudflare workers are great.
Please sign in to leave a comment.