Solved

Add Label using API

  • 9 February 2021
  • 2 replies
  • 311 views

Userlevel 1

Hi,

 

I want to add a specific label to a card a using the API. 

 

I have found this: https://pipefypipe.docs.apiary.io/#reference/0/update-card and this https://api-docs.pipefy.com/reference/mutations/updateCard/.

 

The part I am unsure if if  I am required to send “all the basic information” including the new label … or … if there is a way t ouse the API to “Add X Label”?

 

Doeos it need to be:

mutation{ updateCard( input: { id: 2762646 title: "New Title" due_date: "2017-08-20T21:00:00+00:00" assignee_ids: [00000] label_ids: [890073] } ) { card { id title } } }

 

Or can it it just be 

mutation{ updateCard( input: { id: 2762646 label_ids: [890073] } ) { card { id title } } }

 

with 890073 being the ID of the new label. :)

 

Also, how can I find the ID of a label without using the API?

 

Thank you for your help

icon

Best answer by genietim 9 February 2021, 10:32

View original

2 replies

Userlevel 7
Badge +8

Hi,

 

Do not worry: your second example is sufficient, there is no need to add the other fields.

 

As for getting the label id, you can in the pipe you want to get the label id for open the browser dev tools and inspect the label element in the label edit dialog: you should see something like

<button class="pp-list-title pp-anchor pp-anchor-gray" data-testid="label-item" id="000000000" title="Hot" href="" tabindex="0" type="button">
<span color="#E64545" class="sc-qancl cvIfAsq pp-margin-right-8"></span>
<b class="pp-font-9">Hot</b></button>
<div class="sc-fzaWOq kVsUCdC pp-trigger" data-testid="trigger">
<div tabindex="0" class="sc-fgodEj jJczoG">
<button data-testid="label-dots" tabindex="0" class="pp-btn pp-btn-icon pp-btn-icon-sm" type="button">
<svg data-testid="interface-icon-DotsSm" class="pp-icon pp-icon-sm" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M9 3.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zM7.5 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM7.5 14a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"></path>
</svg>
</button>
</div>
</div>

 

Notice the `id=”000000000”` (I changed the number), that’s where you should see the id of your label.

Userlevel 7
Badge +8

And for anyone who comes here from Google: instructions on how the label could be found with using the API can be found here: https://community.pipefy.com/ask-the-community-43/updating-label-select-fields-784?postid=2455#post2455

Reply