I'm having some trouble populating a custom field on a card via. the API. The URL I am using is:
https://api.trello.com/1/card/{CardID}/customField/{CustomFieldID}/item?key={Key}&token={Token}
The response I'm getting when making the request is a 400 code, and the response body is:
Invalid value for custom field type
The data that is being sent in the PUT request is:
{ "value" : { "text": "Hello, world!" }}
Is there anything obvious that I'm doing wrong here? Would you be able to point me in the right directiion? The custom field is of type: text, so I'm at a loss.
@Mikeres0What seems wrong to me is the url / path for cards, you use:
https://api.trello.com/1/card/{CardID}/ ......
whereas it should be:
https://api.trello.com/1/cards/{CardID}/ ......
i.e. cards
So there seems to be an error in the Trello docs!.
ping for @bentley and @Torben_trello
All of the endpoints accept both singular and plural nouns in the route, so I don't think that is the problem.
That error message leads me to believe that you're trying to update a Custom Field that has a type other than text (dropdown, number, etc.). Can you confirm that it is a text type Custom Field?
If it is a text Custom Field, then I'd guess that something might be up with the body. Here is a Postman collection that includes a single PUT request that works to update a Custom Field: https://www.getpostman.com/collections/e82e59d6d5ba6e41f485
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All of the endpoints accept both singular and plural nouns in the route, so I don't think that is the problem.
Is that documented somewhere? Could not find this in the API reference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added it as a callout in the API Introduction here: https://developers.trello.com/v1.0/docs/api-introduction#section--a-name-boards-boards-a-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.