Solved

Using Pipefy Webhooks

  • 7 March 2023
  • 3 replies
  • 299 views

Userlevel 2

I need to send a request to Pipefy via webhook whenever a certain condition is met in Zendesk. This request should change the phase of the card.

 

I was able to create a token and use the following query from this example (https://developers.pipefy.com/reference/graphql-endpoint) to accomplish this:

mutation { moveCardToPhase( input: { card_id: 629233113 destination_phase_id: 310440395}) {card {id current_phase { name } } } }

 

However, to send a request to a webhook (from Zendesk) to Pipefy, I need the request format to be JSON and sent it to an endpoint address. What endpoint address should I use to communicate with Pipefy, and how would I translate this query into JSON format?

icon

Best answer by genietim 9 March 2023, 11:01

View original

3 replies

Userlevel 7
Badge +12

Hi @alexandre-cominoti 

Your problem you describe in your most recent comment is completely separate from the first one, right?

To successfully create the comment, you are apparently lacking some comments.

This works, for example:

mutation {
createComment(input: {
card_id: "<yourId>",
text: "<Test>",
clientMutationId: "<some id>"
}) {
clientMutationId
}
}

What is the error you get?

Userlevel 2

I was able to do this using these settings:

  • endpoint: https://api.pipefy.com/graphql
  • authentication method: bearer token (my token created in the Pipefy API)
  • request method: POST
  • request format: JSON

Sending this JSON:

{ "query": "mutation { moveCardToPhase( input: { card_id: <id> destination_phase_id: <id>}) {card {id current_phase { name } } } }" }

And it worked! The phase was moved successfull. However, I can't do this with the createComment mutation... when trying this code, I get an error:

{ "query": "mutation{ createComment(input: { clientMutationId: <id> card_id: <id> text: "text"}) { clientMutationId }}" }

 

Userlevel 5

Hello Alexandre, good morning!

We don't have an endpoint to receive webhooks. When we talk about webhooks here at Pipefy, we only talk about sending wh from our platform, not the opposite.

The test you did is valid because you used our api/graphql, if you can handle it from your side so the request arrives in our api, with the credentials and the graphql payload, it will work. Otherwise, we have no other alternative at the moment.

 

Thank You!

Reply