Trello Rest API JSON Schema IDs?

In the REST API Reference docs for every ID description, I see the following pattern is used for valid return values: ^[0-9a-fA-F]{32}$

I think the regex is wrong because it validates an ID to be exactly 32 characters long, but the IDs being returned for various models (board, list, card, etc.) are 24 characters long, I’m guessing the returned hex value is the MongoDB ObjectId, which is BSON byte 12, which translates to 24 hex string.

My question is that the regex pattern tries to illustrate that the ID can be any length, but not longer than 32 characters? If so, the docs should be edited to illustrate this.

Good catch. Looks like it was just a bad regex (my fault! :woman_facepalming:). We’ll update it to be 24 characters.

You’re guessing correctly!

1 Like