Create a entry for specific user using API

By: Yogesh P | Asked: 03/24/2023
ForumsCategory: Code HelpCreate a entry for specific user using API
Yogesh P asked 2 years ago

Hi

Thanks in Advance.

I want to create entry for specific user. I am passing value of user's ID in "user_id" parameter in request body but it always creating entry under admin user. Can any one help me on this?
Below are the details:

API URL : [domain_name]/wp-json/frm/v2/entries/
Method : POST
Body: {
"form_id": 8,
"user_id": 20,
"a5kdi": "51965x",
"zha5o": "51980",
"9ka8y": "no",
"lxzea": "Pending"
}

Walter JonesWalter Jones replied 2 years ago

Does the form your populating entries too have a user_id field? If it does use the field key instead of user_id?

Yogesh P replied 2 years ago

Thank you Walter for your response.
No, I haven't added the "user_id" field in the form. I think it is by default a field like "form_id". Isn't it?

My goal is I want to create entries under a specific user id in API requests so only this user can see the entries.

1 Answers
Walter JonesWalter Jones answered 2 years ago
No you need to add the field in the builder.  If your logged in and create the form it will say it’s created by who is logged in on the entry, but that’s not the user_id field  
You want to create entries for them?  Or are you sending this data from one from to another?  

What are you trying to accomplish?
Yogesh P replied 2 years ago

Currently, I am sending data from a third party app using API. I want to create an entry for a specific user same as when logged in user create entry and it is accessible for this logged in user

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right