I want to make a custom field where I input a license plate of a car, it fetches from an api some data and uses that data to fill in fields in the content entry, is this possible? if yes how
This topic has been created from a Discord post (1243924514174271488) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord
Yes, it is possible. See here for how to add a custom field in general: https://docs.strapi.io/dev-docs/custom-fields From there, ultimately, a custom field is just a react component, so oyu would do fetches like you in a normal component. Keep in mind, that you still can only use Strapi content field types. https://docs.strapi.io/user-docs/content-type-builder/configuring-fields-content-type
Been battling with this bug the entire day
I searched the entire discord, did everything
Not sure based on that error. I just recently added a semi-complicated custom field, just by following the guide I posted.
People having the same error and I did what all the answers said
That’s generally where everyone who’s doing it for first time start
<@125038622289166336> <@632956853122236457> Do you know when making a custom field how I can use the strapi’s design system in react? so the input field looks the same as the rest?
something weird is happening
In my custom field, I am doing a fetch to a content type
but its giving me unauthorized, while the Public role has find and findOne access to all
This fetch is happening from the same server
Probably this, having this exact same problem
This is VERY late, but hopefully this helps the next dev.
I got this same error, and as far as I can tell, the reason is that Strapi has two separate API services, which isn’t documented well anywhere I could find.
There is an “Internal admin API” for plugin-specific or core admin api calls. You can use fetchRequest library because these calls are expected to be used by Admin Users.
There is also a “Content API/ External API” which is the APIs that are auto-generated for each content type as …
Well, you are calling the content-api I suppose. Strapi has something called an admin API, that you probably have to use.
You mean custom made endpoints?