System Information
- Strapi Version: v3.5.2
- Operating System: Manjaro Linux 5.10.19-1-MANJARO
- Database: MySQL (MariaDB)
- Node Version: v14.16.0
- NPM Version: 7.6.2
- Yarn Version: 1.22.10
Hi. I would like to make a POST request via REST API and provide a relation. But in my case, I cannot provide the primary key of relation which is “id” generated by Strapi. I want to use as relation another field added by me which is “code” (type of string).
Should I make a custom endpoint in that case or it’s possible somehow?
I want to POST a request with data:
{
"name": "nowosolski",
"description": "",
"code": "04",
"voivodeship": { "code": "08" } // here should be ID
}
So instead of ID in “voivodeship”, I would like to use an additional field. Is it possible to do?
Or I should provide a new endpoint to search by “code” field then after I get it make another request with POST.