How to create entry with included relation

System Information
  • Strapi Version: v4.0.3
  • Operating System: Win 11
  • Database:
  • Node Version: v16.13.2
  • NPM Version: v8.4.1
  • Yarn Version:

I’m trying to make a rest api request to strapi to create a post of sort:

{
	"data":{
		"Title":"Bro Code",
		"Desc":"Very Important Subject",
		"Subject":"English",
		"Grade":"12",
		"Type_of_material":"Paper", 
		"Student": "1", 
		"Material":"3"
	}
}

Example json of the request.
it resolves with 200 but the student doesn’t make the relation to student with id : 1 it leaves it blank
I though it would work with id like it works with media to make connection you give the id
I can’t figure how it should look.

2 Likes

having the exact same issue. not sure what’s wrong. are you on Strapi version 4?

I found my error it is done with an id and I had an error with the variable name it wasn’t with an uppercase S for student after changing it , it worked fine check your spellings.

1 Like