Card numbers on API
Asked by Ashley_Abell:

For example we have this power up **Card Numbers by Reenhanced**

It shows when I call **/boards/{id}/boardPlugins** and **/boards/{id}/plugins**

Is there any way to get the prefix that has been set for this power up?

Thanks

Ashley


Answers:
author: bentley
body: [@Ashley_Abell](/t5/user/viewprofilepage/user-id/1311535)Can you go into more detail what you mean by *prefix*?

The card number that they are using is returned as the **idShort** in the API. For instance, using a public board, you can retrieve the field with the following call: [https://api.trello.com/1/boards/ALJlJokP/cards/?limit=1\&fields=idShort](https://api.trello.com/1/boards/ALJlJokP/cards/?limit=1&fields=idShort)

comments: author: Ashley_Abell
body: idShort is what we're getting but we want the prefix from the powerup in the screenshot attached so we can put them both together like it shows on the card itself.

![prefix.png](https://community.atlassian.com/t5/image/serverpage/image-id/21988i0BBA454A65F898F1/image-size/large?v=v2&px=999 "prefix.png")


author: Ashley_Abell
body: ![card.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/21990iEB415F506F7880DA/image-size/large?v=v2&px=999 "card.PNG")


author: bentley
body: Ah, yeah - I see!

It looks like they are storing that at the board-level in *pluginData.* You can get at this data with the following API request:

<https://api.trello.com/1/boards/{idBoard}/pluginData/5af9c282a659e51fde5aef26>

This works because the Card Numbers Power-Up's ID is: 5af9c282a659e51fde5aef26. When you make this request you will get a response similar to:

```
{
 "id": "5af9c282a659e51fde5aef26",
 "idPlugin": "59c3d177178a761767b49278",
 "scope": "board",
 "idModel": "586e8f681d4fe9b06a928307",
 "value": "{\"prefix\":\"ohLookThePrefix\"}",
 "access": "shared"
}
```

And you can see in the *value* key the prefix is there.


author: Ashley_Abell
body: I keep getting **pluginData not found**errors.

Below is the result from this request: **/boards/{boardId}/boardPlugins**

I've tried every combination of but still getting 404's. Anything you can do on your end to see if I've got the right details

array (size=2)  
0 =\>  
object(stdClass)\[408\]  
public 'id' =\> string '5aec6afde0e2cb5e58e3b283' (length=24)  
public 'idBoard' =\> string '5aec47bb0623fa833993acf1' (length=24)  
public 'idPlugin' =\> string '56d5e249a98895a9797bebb9' (length=24)  
1 =\>  
object(stdClass)\[407\]  
public 'id' =\> string '5aec6b0577b3ea8f3ed52a54' (length=24)  
public 'idBoard' =\> string '5aec47bb0623fa833993acf1' (length=24)  
public 'idPlugin' =\> string '59c3d177178a761767b49278' (length=24)


author: bentley
body: Looks like I misspoke. You need to get all of the *pluginData* for the board first:

<https://api.trello.com/1/boards/{idBoard}/pluginData/>

This will return all of the pluginData that has been set on the board, including the data set by Card Numbers. You can parse through it to find the Card Numbers plugin ID (*59c3d177178a761767b49278*):

```
{
 "id": "5af9c282a659e51fde5aef26",
 "idPlugin": "59c3d177178a761767b49278",
 "scope": "board",
 "idModel": "586e8f681d4fe9b06a928307",
 "value": "{\"prefix\":\"ohLookThePrefix\"}",
 "access": "shared"
}
```

And then you can access that specific set of *pluginData* via the ID:

<https://api.trello.com/1/boards/{idBoard}/pluginData/{id>}

Using the example response from above, we'd use:

<https://api.trello.com/1/boards/586e8f681d4fe9b06a928307/pluginData/5af9c282a659e51fde5aef26>


author: Ashley_Abell
body: Thanks, I got it now.


Tags: api

card

number

power-up