Creating a webhook through the api does not return the creation id but null

When doing a mutation create_webhook

mutation {
  create_webhook(board_id: 123123123123, 
      url: "https://some.domain.com/api/v1/webhooks/dapulse/receive", 
      event: change_column_value){
    id board_id
  }
}

I always get the response null.

{
  "data": {
    "create_webhook": null
  },
  "account_id": 123123123
}

Is this a bug?

2 Likes

+1
I experience the same problem.

solved the issue.

So it will return null if it cant create a webhook because the challenge that was posted to your url was not returned.

So when doing a the call

mutation {
  create_webhook(board_id: 123123123123, 
      url: "https://some.domain.com/api/v1/webhooks/dapulse/receive", 
      event: change_column_value){
    id board_id
  }
}

this endpoint will receive a POST request with

{
   "challenge":"RANDOM_CODE"
} 

if you dont return the same json, you will see null as seen above.
But if you do return the same json the request will succeed.

{
  "data": {
    "create_webhook": {
      "id": "123123123123",
      "board_id": 123123
    }
  },
  "account_id": 123123
}```

I think they fixed it in the last 2 days ± because I did returned the same json but still got null.
Now it works :slight_smile: