Create webhook
POST
https://api.catenda.com/v2/projects/{project-id}/webhooks/user
Path Parameters
- project-idstringrequiredExampleDescription
Body Parameters
- bodyobjectrequired
- eventstring<issue.created | issue.deleted | issue.modified | issue.status.changed | library.document.revision.published | model.created | revision.created>requiredExampleDescription
- target_urlstringrequiredExampleDescription
Responses
200
- webhook-subscriptionDescription
- idstringExampleDescription
- target_urlstringExampleDescription
- createdAtstringExampleDescription
- statestringDescription
- failureCountnumberDescription
- eventstringExampleDescription
curl
curl --request POST \
--url https://api.catenda.com/v2/projects/{project-id}/webhooks/user \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"event": "issue.created",
"target_url": "https://hooks.zapier.com/hooks/catch/1028857/a8w0or/"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"event": "issue.created",
"target_url": "https://hooks.zapier.com/hooks/catch/1028857/a8w0or/"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.catenda.com/v2/projects/{project-id}/webhooks/user", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.catenda.com/v2/projects/{project-id}/webhooks/user")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"event": "issue.created",
"target_url": "https://hooks.zapier.com/hooks/catch/1028857/a8w0or/"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.catenda.com/v2/projects/{project-id}/webhooks/user"
payload = json.dumps({
"event": "issue.created",
"target_url": "https://hooks.zapier.com/hooks/catch/1028857/a8w0or/"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// OK
{
"id": "57d5457e09d64380af75da94ed96557h",
"target_url": "https://hooks.zapier.com/hooks/catch/1028857/a8w0or/",
"createdAt": "2019-02-13T14:15:18Z\"",
"state": "",
"failureCount": 0,
"event": "issue.created"
}Add a new webhook subscription.