Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

dicebear api returns a 400 error code when trying to specify a skinColor

im using the miniavs style in my app and im trying to specify a custom skin color

The url i tried:
https://avatars.dicebear.com/api/miniavs/:carim.svg?head=normal&body=tShirt&hair=balndess&mouth=default&eyes=normal&glassesProbability=0&mustacheProbability=0&blushesProbability=0&skinColor=#E3BEBE

The message i got:
"querystring.skinColor[0] should be equal to one of the allowed values, querystring.skinColor[0] should match pattern "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$", querystring.skinColor[0] should match some schema in anyOf"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to encode the # symbol.

Try this instead:

https://avatars.dicebear.com/api/miniavs/:carim.svg?head=normal&body=tShirt&hair=balndess&mouth=default&eyes=normal&glassesProbability=0&mustacheProbability=0&blushesProbability=0&skinColor=%23E3BEBE

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading