Solved

How to integrate my app with pipefy webhook

  • 5 October 2020
  • 5 replies
  • 1424 views

Userlevel 5

I have a REST service that sends a customized email notification to all employees. [ With JSON

as input ]

I want to integrate this REST API with Pipefy, so when a card is created in pipefy, I want to

format card info (Data from Pipefy webhook) and do the job.

Information:

Created a webhook in pipefy using "https://app.pipefy.com/graphiql" using mutation

"createwebhook" and, webhook is created with an id

Question:

How can I use this webhook and how can I call my own REST API (or how this webhook

interacts with my REST API ?)

Please suggest

icon

Best answer by Roberto Chavarria 14 March 2022, 20:10

View original

5 replies

Userlevel 5
Badge +5

Hello Amanda!
Firstly, I would suggest you to take a look at our built-in feature called Email Template.(https://help.pipefy.com/en/articles/614616-email-templates) That might solve your problem straight up!


If you’d like to know how to create a webhook, you can log onto Pipefy and access our GraphiQL IDE (https://app.pipefy.com/graphiql), and create it through there. Here’s an example of the code:

mutation{
createWebhook(input:{
actions:"card.create"
name:"Webhook-Name"
url:"https://test.requestcatcher.com/"
email:"[email protected]"
pipe_id:1242952
}) {
clientMutationId
}
}

You can use sites like requestcatcher.com to test your webhook events.

After the webhook is configured, Pipefy will listen to events in the configured pipe, such as "card.created". From that, it will send a POST request to your specified URL containing some basic card data in JSON. After that, how to proceed is determined by your business logic.

Userlevel 2
mutation {
createWebhook(input:{
actions: ["card.done"],
name: "SAP",
url: "http://x.x.x.x:8080/v1/public/sap-integrator/invoice",
headers: {Authorization:"Basic xxx"},
pipe_id: 302174055
}){
webhook {actions, headers, id, name, url}
}
}

I’m getting error 500 when sending “headers”, could you help-me?

Userlevel 5
Badge +5

Hi there @tiago260!

 

You can try something like this:

mutation {
createWebhook(input:{
actions: ["card.done"],
name: "SAP",
url: "http://x.x.x.x:8080/v1/public/sap-integrator/invoice",
headers: ["Authorization", "Basic xxx"],
pipe_id: 11111
}){
webhook {actions, headers, id, name, url}
}
}


 

 

Userlevel 2

It works

I tried sending headers as an array, but not working as well:

{
"data": {
"createWebhook": null
},
"errors": [
{
"message": "Validation failed: invalid headers",
"locations": [
{
"line": 2,
"column": 5
}
],
"path": [
"createWebhook"
],
"code": 30003,
"type": "ResourceNotFoundError"
}
]
}

any help?

Reply