Simple Membership Plugin › Forums › Simple Membership Plugin › Adding user via API not working
- This topic has 9 replies, 4 voices, and was last updated 3 years, 1 month ago by
admin.
-
AuthorPosts
-
November 1, 2022 at 10:59 am #24709
Mark
ParticipantHi
I’m using Gravity Forms to create a membership signup form (because I want to record some extra details), and using a query string to trigger the API to create the user.
Despite the URL being formatted in accordance with your documentation, I’m getting the following error message:
{"result":"failure","message":"Missing one of the mandatory fields: first_name, last_name, email"}The URL which returns this error is:
https://MYURL?swpm_api_action=create&key=MYKEY&first_name=Mark&last_name=Jones&email=MY%40EMAILAny idea what the problem might be?
November 2, 2022 at 1:55 am #24714mbrsolution
ModeratorHi,
Despite the URL being formatted in accordance with your documentation, I’m getting the following error message:
Did you follow the instructions below?
We also offer the following addon.
https://simple-membership-plugin.com/simple-membership-form-builder-addon/
Kind regards.
November 2, 2022 at 7:32 am #24726Mark
ParticipantYes, I followed the instructions at https://simple-membership-plugin.com/simple-membership-api-creating-member-account-using-http-post-request/.
It’s not really a gravity forms issue. I need to understand how to get the API working. If I just visit the URL I get the same error message.
November 2, 2022 at 11:13 am #24727Mark
Participant… having followed the instructions under heading ‘Enabling the API’, I’m then using the URL format at the bottom of that page, under ‘Create Account Using HTTP GET’. I’ve not followed the section ‘Using the API’, since the heading hierarchy suggests that is a different process from the URL approach. Apologies if that’s incorrect.
If I change the API key, I get the ‘invalid API key’ message, which is correct. Just struggling to understand the documentation, I think.
November 2, 2022 at 11:49 am #24728Mark
Participant… OK I tried the “Using the API” section, and while yes that seemed to work, when I clicked the link in the confirmation email I got an error message that the username already exists. Deleted the member, started again, same error.
Different approach: is it possible to prepopulate any of the fields in the standard registration form, by passing parameters or otherwise?
I’d rather use Gravity Forms if I can, since I already have a licence for that. I’d need to purchase two add-ons for your plugin to do what I already could with GF (the one you sent plus data exporter).
November 3, 2022 at 9:14 am #24729mbrsolution
ModeratorHi,
I got an error message that the username already exists. Deleted the member, started again, same error.
Make sure the user is not added anywhere in your site. Check for the username and or email address.
Kind regards.
November 3, 2022 at 10:04 am #24731Mark
ParticipantYeah I did that
June 27, 2023 at 10:50 am #26264NeilC
ParticipantHi, I have the same issue. If I use the GET method as per the website documentation, I can retrieve a specific member’s detail via the API. But with the post method to create a member I cannot get past the below:
—— {“result”:”failure”,”message”:”Missing one of the mandatory fields: first_name, last_name, email”} ——–
I have ensured all the parameters are named/spelled correct as per the website instructions.I’m using Postman. Any Ideas? I have ensured my WordPress is up to date and all related plugins are up to date as well.
Thanks.
June 29, 2023 at 1:13 am #26268admin
KeymasterI will try to add some extra debug logging entries to the API addon. So it can spit out more details as to what it is receiving. That might be helpful.
June 29, 2023 at 1:25 am #26269admin
KeymasterPlease download a new version of the addon from the following page and let me know if that is better:
Note that this API addon hasn’t be polished up so it may contain bugs. Only use if you are a developer.
-
AuthorPosts
- You must be logged in to reply to this topic.