How to Query DataBase Table's WebHooks

  • 7 September 2021
  • 4 replies
  • 399 views

Userlevel 7
Badge +12

The GraphQL API of Pipefy provides the function of WebHooks: you can register them, so that upon a certain action, an URL you specify is called, which enables you to use the GraphQL API to develop your own integrations and automations.

 

These WebHooks can be registered for both Database Tables and Pipes. But: to query them, to check which WebHooks are registered on a pipe, the Documentation does not provide a straight-forward way: The object you are looking for is Webhook, and as you can see in Pipe, there is a field ‚webhooks‘ linking to said object; in Table or TableRecord, there is not.

 

So, what is the trick? How can I query which WebHooks are attached to a DataBase?

The trick is not obvious, but straight-forward: use the database id as a pipe id!

Like this:

query {
pipes(ids:["yourTableId"]) {
id
webhooks{
id
url
name
headers
actions
}
}
}

 


4 replies

Userlevel 6
Badge +5

Hello Tim, hope all is well! 

The webhooks object isn’t directly available within the table object at this moment unfortunately, but there is a way to query for them. 

 

In our codebase, databases and pipes use a lot of the same components, and you can look this information up by looking within the webhooks object within pipes.

To do this, you’ll need the internal_id of the table. Here’s an example:

 

{
table(id:"Abc123"){
internal_id
}
}

and then use that id that is given to find the webhooks:

{
pipe(id:123456){
name
webhooks{
id
}
}
}

Hope this helps! :smile:

Userlevel 7
Badge +12

Hi @Roberto Chavarria , I am not sure why the type of my post was changed to a question. But yes, what you are doing is pretty much what I describe in the post. Thanks for shoing how to access the internal id, but as I noticed, it is not even necessary as you can also access the table as pipe with the “public” table id (as also described in my post).

Userlevel 7
Badge +8

Hi @Roberto Chavarria , I am not sure why the type of my post was changed to a question. But yes, what you are doing is pretty much what I describe in the post. Thanks for shoing how to access the internal id, but as I noticed, it is not even necessary as you can also access the table as pipe with the “public” table id (as also described in my post).

I am not sure why it was changed to a question! But I’ve already changed it again! 

Thanks, Tim and @Roberto Chavarria 

Userlevel 6
Badge +5

Sorry about that, it was incorrectly tagged as a question here for us. :sweat_smile:

But you’re totally right, nicely done Tim! :clap: :smile:

Reply