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

Time:11-06

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"

CodePudding user response:

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=#E3BEBE

  • Related