Answered

Setting Color through REST API

  • 11 July 2020
  • 3 replies
  • 967 views

Userlevel 2

I’m trying to set the color of a sticker using the REST API, but not having much luck.  When I set style.backgroundColor to any value other than “#fff9b1” I get an result of error code 400 (Bad Request).  Are there only certain allowed values?  Could these be specified in the documentation?

icon

Best answer by Steve Appling 12 July 2020, 19:51

View original

3 replies

Userlevel 2

Okay - I think I have figured this out and am posting here for other’s reference.

If you are creating a sticker, you can only set the color value to one of 12 specific values:

  1. GREY =         "#f5f6f8"
  2. YELLOW =       "#fff9b1"
  3. LIGHT_ORANGE = "#f5d128"
  4. OLIVE =        "#d0e17a"
  5. GREEN =        "#d5f692"
  6. PASTEL_BLUE =  "#a6ccf5"
  7. AQUA =         "#67c6c0"
  8. BLUE =         "#23bfe7"
  9. ORANGE =       "#ff9d48"
  10. PINK =         "#ea94bb"
  11. RED =          "#f16c7f"
  12. PURPLE =       "#b384bb"

This really should be documented.  Other widgets (like Cards) seem to be able to take a wider range of colors.

Userlevel 2

Thanks a lot @Steve Appling. You are right, it was missed and we will add to our documentation.

Hey guys, regarding this topic I have an additional question.

Why there are only 12 values available, even if we can set 16 colors from UI?

EDIT:
I checked colors available from UI and in REST API and it seems 7 out of 16 UI colors don’t work through API:

```

  Grey = '#f5f6f8',

  Yellow = '#fff9b1',

  Orange = '#f5d128',

  IntenseOrange = '#ff9d48',

  Lime = '#d5f692',

  // Green = '#c9df56', // Not working

  // BottleGreen = '#93d275', // Not working

  Turquoise = '#67c6c0',

  Pink = '#ffcee0',

  IntensePink = '#ea94bb',

  // Purple = '#be88c7', // Not working

  Red = '#f16c7f',

  // Blue = '#a6ccf5', // Not working

  // Aqua = '#6cd8fa', // Not working

  // Violet = '#7b92ff', // Not working

  // Black = '#000000', // Not working
```

It feels like a bug...

Reply