Create webhook
POST
/api/webhook-subscriptions/
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.koibox.cloud/api/webhook-subscriptions/"), Headers = { { "X-Koibox-Key", "<X-Koibox-Key>" }, }, Content = new StringContent("{ \"created_by\": { \"value\": 1, \"text\": \"example\", \"color\": \"example\", \"username\": \"hello@example.com\", \"foto_url_absolute_path\": \"https://example.com\" }, \"url\": \"https://example.com\", \"event\": \"CITA_CREATED\", \"is_active\": true }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.koibox.cloud/api/webhook-subscriptions/")) .header("X-Koibox-Key", "<X-Koibox-Key>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{ \"created_by\": { \"value\": 1, \"text\": \"example\", \"color\": \"example\", \"username\": \"hello@example.com\", \"foto_url_absolute_path\": \"https://example.com\" }, \"url\": \"https://example.com\", \"event\": \"CITA_CREATED\", \"is_active\": true }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"created_by\": { \"value\": 1, \"text\": \"example\", \"color\": \"example\", \"username\": \"hello@example.com\", \"foto_url_absolute_path\": \"https://example.com\" }, \"url\": \"https://example.com\", \"event\": \"CITA_CREATED\", \"is_active\": true }");Request request = new Request.Builder() .url("https://api.koibox.cloud/api/webhook-subscriptions/") .post(body) .addHeader("X-Koibox-Key", "<X-Koibox-Key>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.koibox.cloud/api/webhook-subscriptions/', headers: {'X-Koibox-Key': '<X-Koibox-Key>', 'Content-Type': 'application/json'}, data: { created_by: { value: 1, text: 'example', color: 'example', username: 'hello@example.com', foto_url_absolute_path: 'https://example.com' }, url: 'https://example.com', event: 'CITA_CREATED', is_active: true }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.koibox.cloud/api/webhook-subscriptions/';const options = { method: 'POST', headers: {'X-Koibox-Key': '<X-Koibox-Key>', 'Content-Type': 'application/json'}, body: '{"created_by":{"value":1,"text":"example","color":"example","username":"hello@example.com","foto_url_absolute_path":"https://example.com"},"url":"https://example.com","event":"CITA_CREATED","is_active":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.koibox.cloud/api/webhook-subscriptions/ \ --header 'Content-Type: application/json' \ --header 'X-Koibox-Key: <X-Koibox-Key>' \ --data '{ "created_by": { "value": 1, "text": "example", "color": "example", "username": "hello@example.com", "foto_url_absolute_path": "https://example.com" }, "url": "https://example.com", "event": "CITA_CREATED", "is_active": true }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
id
Identifier of the webhook
integer
created_by
object
value
Identifier of the user
integer
text
Name of the user
string
color
string format: hex
username
string format: email
foto_url_absolute_path
string format: uri
created
string format: date-time
updated
string format: date-time
url
required
string format: uri
event
required
string
is_active
boolean
is_application_managed
boolean
managing_application
string
Responses
Section titled “Responses”The created webhook
Media typeapplication/json
object
id
Identifier of the webhook
integer
created_by
object
value
Identifier of the user
integer
text
Name of the user
string
color
string format: hex
username
string format: email
foto_url_absolute_path
string format: uri
created
string format: date-time
updated
string format: date-time
url
required
string format: uri
event
required
string
is_active
boolean
is_application_managed
boolean
managing_application
string
The request is malformed, required fields are missing.
The access key has not been provided in the X-Koibox-Key header
Headers
Section titled “Headers”WWW-Authenticate
string
Indicates the required header for authentication
No valid access key has been provided
