POST Create webhook subscription
{{baseUrl}}/webhook/webhooks
HEADERS

x-apideck-app-id
Authorization
{{apiKey}}
BODY json

{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/webhook/webhooks" {:headers {:x-apideck-app-id ""
                                                                       :authorization "{{apiKey}}"}
                                                             :content-type :json
                                                             :form-params {:delivery_url ""
                                                                           :description ""
                                                                           :events []
                                                                           :status ""
                                                                           :unified_api ""}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks"
headers = HTTP::Headers{
  "x-apideck-app-id" => ""
  "authorization" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}"

response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks"),
    Headers =
    {
        { "x-apideck-app-id", "" },
        { "authorization", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks"

	payload := strings.NewReader("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-apideck-app-id", "")
	req.Header.Add("authorization", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/webhook/webhooks HTTP/1.1
X-Apideck-App-Id: 
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 98

{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/webhooks")
  .setHeader("x-apideck-app-id", "")
  .setHeader("authorization", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks"))
    .header("x-apideck-app-id", "")
    .header("authorization", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}"))
    .build();
HttpResponse 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, "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks")
  .post(body)
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/webhooks")
  .header("x-apideck-app-id", "")
  .header("authorization", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  delivery_url: '',
  description: '',
  events: [],
  status: '',
  unified_api: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/webhook/webhooks');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  data: {delivery_url: '', description: '', events: [], status: '', unified_api: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks';
const options = {
  method: 'POST',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  body: '{"delivery_url":"","description":"","events":[],"status":"","unified_api":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks',
  method: 'POST',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "delivery_url": "",\n  "description": "",\n  "events": [],\n  "status": "",\n  "unified_api": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks")
  .post(body)
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({delivery_url: '', description: '', events: [], status: '', unified_api: ''}));
req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  body: {delivery_url: '', description: '', events: [], status: '', unified_api: ''},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/webhook/webhooks');

req.headers({
  'x-apideck-app-id': '',
  authorization: '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  delivery_url: '',
  description: '',
  events: [],
  status: '',
  unified_api: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  data: {delivery_url: '', description: '', events: [], status: '', unified_api: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks';
const options = {
  method: 'POST',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  body: '{"delivery_url":"","description":"","events":[],"status":"","unified_api":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-apideck-app-id": @"",
                           @"authorization": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"delivery_url": @"",
                              @"description": @"",
                              @"events": @[  ],
                              @"status": @"",
                              @"unified_api": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks" in
let headers = Header.add_list (Header.init ()) [
  ("x-apideck-app-id", "");
  ("authorization", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'delivery_url' => '',
    'description' => '',
    'events' => [
        
    ],
    'status' => '',
    'unified_api' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}",
    "content-type: application/json",
    "x-apideck-app-id: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/webhook/webhooks', [
  'body' => '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}',
  'headers' => [
    'authorization' => '{{apiKey}}',
    'content-type' => 'application/json',
    'x-apideck-app-id' => '',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'delivery_url' => '',
  'description' => '',
  'events' => [
    
  ],
  'status' => '',
  'unified_api' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'delivery_url' => '',
  'description' => '',
  'events' => [
    
  ],
  'status' => '',
  'unified_api' => ''
]));
$request->setRequestUrl('{{baseUrl}}/webhook/webhooks');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}'
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}"

headers = {
    'x-apideck-app-id': "",
    'authorization': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("POST", "/baseUrl/webhook/webhooks", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks"

payload = {
    "delivery_url": "",
    "description": "",
    "events": [],
    "status": "",
    "unified_api": ""
}
headers = {
    "x-apideck-app-id": "",
    "authorization": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks"

payload <- "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}"

encode <- "json"

response <- VERB("POST", url, body = payload, add_headers('x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.post('/baseUrl/webhook/webhooks') do |req|
  req.headers['x-apideck-app-id'] = ''
  req.headers['authorization'] = '{{apiKey}}'
  req.body = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\",\n  \"unified_api\": \"\"\n}"
end

puts response.status
puts response.body
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks";

    let payload = json!({
        "delivery_url": "",
        "description": "",
        "events": (),
        "status": "",
        "unified_api": ""
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-apideck-app-id", "".parse().unwrap());
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/webhook/webhooks \
  --header 'authorization: {{apiKey}}' \
  --header 'content-type: application/json' \
  --header 'x-apideck-app-id: ' \
  --data '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}'
echo '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
}' |  \
  http POST {{baseUrl}}/webhook/webhooks \
  authorization:'{{apiKey}}' \
  content-type:application/json \
  x-apideck-app-id:''
wget --quiet \
  --method POST \
  --header 'x-apideck-app-id: ' \
  --header 'authorization: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "delivery_url": "",\n  "description": "",\n  "events": [],\n  "status": "",\n  "unified_api": ""\n}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks
import Foundation

let headers = [
  "x-apideck-app-id": "",
  "authorization": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": "",
  "unified_api": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "data": {
    "created_at": "2020-09-30T07:43:32.000Z",
    "delivery_url": "https://example.com/my/webhook/endpoint",
    "description": "A description",
    "disabled_reason": "retry_limit",
    "events": [
      "vault.connection.created",
      "vault.connection.updated"
    ],
    "execute_base_url": "https://unify.apideck.com/webhook/webhooks/1234/execute",
    "id": "1234",
    "status": "enabled",
    "unified_api": "crm",
    "updated_at": "2020-09-30T07:43:32.000Z"
  },
  "status": "OK",
  "status_code": 200
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
DELETE Delete webhook subscription
{{baseUrl}}/webhook/webhooks/:id
HEADERS

x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS

id
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks/:id");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/delete "{{baseUrl}}/webhook/webhooks/:id" {:headers {:x-apideck-app-id ""
                                                                             :authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks/:id"
headers = HTTP::Headers{
  "x-apideck-app-id" => ""
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Delete,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks/:id"),
    Headers =
    {
        { "x-apideck-app-id", "" },
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks/:id");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks/:id"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("x-apideck-app-id", "")
	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
DELETE /baseUrl/webhook/webhooks/:id HTTP/1.1
X-Apideck-App-Id: 
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/webhook/webhooks/:id")
  .setHeader("x-apideck-app-id", "")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks/:id"))
    .header("x-apideck-app-id", "")
    .header("authorization", "{{apiKey}}")
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id")
  .delete(null)
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/webhook/webhooks/:id")
  .header("x-apideck-app-id", "")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('DELETE', '{{baseUrl}}/webhook/webhooks/:id');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks/:id';
const options = {
  method: 'DELETE',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks/:id',
  method: 'DELETE',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id")
  .delete(null)
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'DELETE',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks/:id',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('DELETE', '{{baseUrl}}/webhook/webhooks/:id');

req.headers({
  'x-apideck-app-id': '',
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'DELETE',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks/:id';
const options = {
  method: 'DELETE',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-apideck-app-id": @"",
                           @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks/:id"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks/:id" in
let headers = Header.add_list (Header.init ()) [
  ("x-apideck-app-id", "");
  ("authorization", "{{apiKey}}");
] in

Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks/:id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}",
    "x-apideck-app-id: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('DELETE', '{{baseUrl}}/webhook/webhooks/:id', [
  'headers' => [
    'authorization' => '{{apiKey}}',
    'x-apideck-app-id' => '',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks/:id');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/webhooks/:id');
$request->setRequestMethod('DELETE');
$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks/:id' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks/:id' -Method DELETE -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'x-apideck-app-id': "",
    'authorization': "{{apiKey}}"
}

conn.request("DELETE", "/baseUrl/webhook/webhooks/:id", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks/:id"

headers = {
    "x-apideck-app-id": "",
    "authorization": "{{apiKey}}"
}

response = requests.delete(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks/:id"

response <- VERB("DELETE", url, add_headers('x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks/:id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.delete('/baseUrl/webhook/webhooks/:id') do |req|
  req.headers['x-apideck-app-id'] = ''
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use std::str::FromStr;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks/:id";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-apideck-app-id", "".parse().unwrap());
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request DELETE \
  --url {{baseUrl}}/webhook/webhooks/:id \
  --header 'authorization: {{apiKey}}' \
  --header 'x-apideck-app-id: '
http DELETE {{baseUrl}}/webhook/webhooks/:id \
  authorization:'{{apiKey}}' \
  x-apideck-app-id:''
wget --quiet \
  --method DELETE \
  --header 'x-apideck-app-id: ' \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks/:id
import Foundation

let headers = [
  "x-apideck-app-id": "",
  "authorization": "{{apiKey}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks/:id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "data": {
    "created_at": "2020-09-30T07:43:32.000Z",
    "delivery_url": "https://example.com/my/webhook/endpoint",
    "description": "A description",
    "disabled_reason": "retry_limit",
    "events": [
      "vault.connection.created",
      "vault.connection.updated"
    ],
    "execute_base_url": "https://unify.apideck.com/webhook/webhooks/1234/execute",
    "id": "1234",
    "status": "enabled",
    "unified_api": "crm",
    "updated_at": "2020-09-30T07:43:32.000Z"
  },
  "status": "OK",
  "status_code": 200
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
POST Execute a webhook (POST)
{{baseUrl}}/webhook/webhooks/:id/x/:serviceId
HEADERS

Authorization
{{apiKey}}
QUERY PARAMS

id
serviceId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId" {:headers {:authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"
headers = HTTP::Headers{
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"),
    Headers =
    {
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/webhook/webhooks/:id/x/:serviceId HTTP/1.1
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"))
    .header("authorization", "{{apiKey}}")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId")
  .post(null)
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId';
const options = {method: 'POST', headers: {authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId',
  method: 'POST',
  headers: {
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId")
  .post(null)
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks/:id/x/:serviceId',
  headers: {
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId');

req.headers({
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId';
const options = {method: 'POST', headers: {authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in

Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId', [
  'headers' => [
    'authorization' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks/:id/x/:serviceId');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/webhooks/:id/x/:serviceId');
$request->setRequestMethod('POST');
$request->setHeaders([
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId' -Method POST -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks/:id/x/:serviceId' -Method POST -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = ""

headers = { 'authorization': "{{apiKey}}" }

conn.request("POST", "/baseUrl/webhook/webhooks/:id/x/:serviceId", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"

payload = ""
headers = {"authorization": "{{apiKey}}"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId"

payload <- ""

response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type(""))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks/:id/x/:serviceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.post('/baseUrl/webhook/webhooks/:id/x/:serviceId') do |req|
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/webhook/webhooks/:id/x/:serviceId \
  --header 'authorization: {{apiKey}}'
http POST {{baseUrl}}/webhook/webhooks/:id/x/:serviceId \
  authorization:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks/:id/x/:serviceId
import Foundation

let headers = ["authorization": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks/:id/x/:serviceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "request_id": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
  "status": "OK",
  "status_code": 200,
  "timestamp": "2021-10-01T08:26:28.039Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
POST Execute a webhook
{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId
HEADERS

Authorization
{{apiKey}}
QUERY PARAMS

id
serviceId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId" {:headers {:authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"
headers = HTTP::Headers{
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"),
    Headers =
    {
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/webhook/webhooks/:id/execute/:serviceId HTTP/1.1
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"))
    .header("authorization", "{{apiKey}}")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId")
  .post(null)
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId';
const options = {method: 'POST', headers: {authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId',
  method: 'POST',
  headers: {
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId")
  .post(null)
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks/:id/execute/:serviceId',
  headers: {
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId');

req.headers({
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId';
const options = {method: 'POST', headers: {authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in

Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId', [
  'headers' => [
    'authorization' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId');
$request->setRequestMethod('POST');
$request->setHeaders([
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId' -Method POST -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId' -Method POST -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = ""

headers = { 'authorization': "{{apiKey}}" }

conn.request("POST", "/baseUrl/webhook/webhooks/:id/execute/:serviceId", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"

payload = ""
headers = {"authorization": "{{apiKey}}"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId"

payload <- ""

response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type(""))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.post('/baseUrl/webhook/webhooks/:id/execute/:serviceId') do |req|
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/webhook/webhooks/:id/execute/:serviceId \
  --header 'authorization: {{apiKey}}'
http POST {{baseUrl}}/webhook/webhooks/:id/execute/:serviceId \
  authorization:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks/:id/execute/:serviceId
import Foundation

let headers = ["authorization": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks/:id/execute/:serviceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "request_id": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
  "status": "OK",
  "status_code": 200,
  "timestamp": "2021-10-01T08:26:28.039Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
GET Get webhook subscription
{{baseUrl}}/webhook/webhooks/:id
HEADERS

x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS

id
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks/:id");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/webhook/webhooks/:id" {:headers {:x-apideck-app-id ""
                                                                          :authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks/:id"
headers = HTTP::Headers{
  "x-apideck-app-id" => ""
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks/:id"),
    Headers =
    {
        { "x-apideck-app-id", "" },
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks/:id");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks/:id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-apideck-app-id", "")
	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/webhook/webhooks/:id HTTP/1.1
X-Apideck-App-Id: 
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhook/webhooks/:id")
  .setHeader("x-apideck-app-id", "")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks/:id"))
    .header("x-apideck-app-id", "")
    .header("authorization", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id")
  .get()
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhook/webhooks/:id")
  .header("x-apideck-app-id", "")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/webhook/webhooks/:id');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks/:id';
const options = {method: 'GET', headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks/:id',
  method: 'GET',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id")
  .get()
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks/:id',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/webhook/webhooks/:id');

req.headers({
  'x-apideck-app-id': '',
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks/:id';
const options = {method: 'GET', headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-apideck-app-id": @"",
                           @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks/:id"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks/:id" in
let headers = Header.add_list (Header.init ()) [
  ("x-apideck-app-id", "");
  ("authorization", "{{apiKey}}");
] in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks/:id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}",
    "x-apideck-app-id: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/webhook/webhooks/:id', [
  'headers' => [
    'authorization' => '{{apiKey}}',
    'x-apideck-app-id' => '',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks/:id');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/webhooks/:id');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks/:id' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks/:id' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'x-apideck-app-id': "",
    'authorization': "{{apiKey}}"
}

conn.request("GET", "/baseUrl/webhook/webhooks/:id", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks/:id"

headers = {
    "x-apideck-app-id": "",
    "authorization": "{{apiKey}}"
}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks/:id"

response <- VERB("GET", url, add_headers('x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks/:id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/webhook/webhooks/:id') do |req|
  req.headers['x-apideck-app-id'] = ''
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks/:id";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-apideck-app-id", "".parse().unwrap());
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/webhook/webhooks/:id \
  --header 'authorization: {{apiKey}}' \
  --header 'x-apideck-app-id: '
http GET {{baseUrl}}/webhook/webhooks/:id \
  authorization:'{{apiKey}}' \
  x-apideck-app-id:''
wget --quiet \
  --method GET \
  --header 'x-apideck-app-id: ' \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks/:id
import Foundation

let headers = [
  "x-apideck-app-id": "",
  "authorization": "{{apiKey}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks/:id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "data": {
    "created_at": "2020-09-30T07:43:32.000Z",
    "delivery_url": "https://example.com/my/webhook/endpoint",
    "description": "A description",
    "disabled_reason": "retry_limit",
    "events": [
      "vault.connection.created",
      "vault.connection.updated"
    ],
    "execute_base_url": "https://unify.apideck.com/webhook/webhooks/1234/execute",
    "id": "1234",
    "status": "enabled",
    "unified_api": "crm",
    "updated_at": "2020-09-30T07:43:32.000Z"
  },
  "status": "OK",
  "status_code": 200
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
GET List event logs
{{baseUrl}}/webhook/logs
HEADERS

x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/logs");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/webhook/logs" {:headers {:x-apideck-app-id ""
                                                                  :authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/logs"
headers = HTTP::Headers{
  "x-apideck-app-id" => ""
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/webhook/logs"),
    Headers =
    {
        { "x-apideck-app-id", "" },
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/logs");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/logs"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-apideck-app-id", "")
	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/webhook/logs HTTP/1.1
X-Apideck-App-Id: 
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhook/logs")
  .setHeader("x-apideck-app-id", "")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/logs"))
    .header("x-apideck-app-id", "")
    .header("authorization", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/logs")
  .get()
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhook/logs")
  .header("x-apideck-app-id", "")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/webhook/logs');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/logs',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/logs';
const options = {method: 'GET', headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/logs',
  method: 'GET',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/logs")
  .get()
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/logs',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/logs',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/webhook/logs');

req.headers({
  'x-apideck-app-id': '',
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/logs',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/logs';
const options = {method: 'GET', headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-apideck-app-id": @"",
                           @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/logs"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/logs" in
let headers = Header.add_list (Header.init ()) [
  ("x-apideck-app-id", "");
  ("authorization", "{{apiKey}}");
] in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/logs",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}",
    "x-apideck-app-id: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/webhook/logs', [
  'headers' => [
    'authorization' => '{{apiKey}}',
    'x-apideck-app-id' => '',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/logs');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/logs');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/logs' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/logs' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'x-apideck-app-id': "",
    'authorization': "{{apiKey}}"
}

conn.request("GET", "/baseUrl/webhook/logs", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/logs"

headers = {
    "x-apideck-app-id": "",
    "authorization": "{{apiKey}}"
}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/logs"

response <- VERB("GET", url, add_headers('x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/logs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/webhook/logs') do |req|
  req.headers['x-apideck-app-id'] = ''
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/logs";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-apideck-app-id", "".parse().unwrap());
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/webhook/logs \
  --header 'authorization: {{apiKey}}' \
  --header 'x-apideck-app-id: '
http GET {{baseUrl}}/webhook/logs \
  authorization:'{{apiKey}}' \
  x-apideck-app-id:''
wget --quiet \
  --method GET \
  --header 'x-apideck-app-id: ' \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/logs
import Foundation

let headers = [
  "x-apideck-app-id": "",
  "authorization": "{{apiKey}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/logs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "links": {
    "current": "https://unify.apideck.com/crm/companies",
    "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
    "previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
  },
  "meta": {
    "items_on_page": 50
  },
  "status": "OK",
  "status_code": 200
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
GET List webhook subscriptions
{{baseUrl}}/webhook/webhooks
HEADERS

x-apideck-app-id
Authorization
{{apiKey}}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/get "{{baseUrl}}/webhook/webhooks" {:headers {:x-apideck-app-id ""
                                                                      :authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks"
headers = HTTP::Headers{
  "x-apideck-app-id" => ""
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks"),
    Headers =
    {
        { "x-apideck-app-id", "" },
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-apideck-app-id", "")
	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
GET /baseUrl/webhook/webhooks HTTP/1.1
X-Apideck-App-Id: 
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhook/webhooks")
  .setHeader("x-apideck-app-id", "")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks"))
    .header("x-apideck-app-id", "")
    .header("authorization", "{{apiKey}}")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks")
  .get()
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhook/webhooks")
  .header("x-apideck-app-id", "")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('GET', '{{baseUrl}}/webhook/webhooks');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/webhooks',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks';
const options = {method: 'GET', headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks',
  method: 'GET',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks")
  .get()
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'GET',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/webhooks',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('GET', '{{baseUrl}}/webhook/webhooks');

req.headers({
  'x-apideck-app-id': '',
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'GET',
  url: '{{baseUrl}}/webhook/webhooks',
  headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks';
const options = {method: 'GET', headers: {'x-apideck-app-id': '', authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-apideck-app-id": @"",
                           @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks" in
let headers = Header.add_list (Header.init ()) [
  ("x-apideck-app-id", "");
  ("authorization", "{{apiKey}}");
] in

Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}",
    "x-apideck-app-id: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('GET', '{{baseUrl}}/webhook/webhooks', [
  'headers' => [
    'authorization' => '{{apiKey}}',
    'x-apideck-app-id' => '',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/webhooks');
$request->setRequestMethod('GET');
$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks' -Method GET -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'x-apideck-app-id': "",
    'authorization': "{{apiKey}}"
}

conn.request("GET", "/baseUrl/webhook/webhooks", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks"

headers = {
    "x-apideck-app-id": "",
    "authorization": "{{apiKey}}"
}

response = requests.get(url, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks"

response <- VERB("GET", url, add_headers('x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/octet-stream"))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.get('/baseUrl/webhook/webhooks') do |req|
  req.headers['x-apideck-app-id'] = ''
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-apideck-app-id", "".parse().unwrap());
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.get(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request GET \
  --url {{baseUrl}}/webhook/webhooks \
  --header 'authorization: {{apiKey}}' \
  --header 'x-apideck-app-id: '
http GET {{baseUrl}}/webhook/webhooks \
  authorization:'{{apiKey}}' \
  x-apideck-app-id:''
wget --quiet \
  --method GET \
  --header 'x-apideck-app-id: ' \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks
import Foundation

let headers = [
  "x-apideck-app-id": "",
  "authorization": "{{apiKey}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "links": {
    "current": "https://unify.apideck.com/crm/companies",
    "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
    "previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D"
  },
  "meta": {
    "items_on_page": 50
  },
  "status": "OK",
  "status_code": 200
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
POST Resolve and Execute a connection webhook
{{baseUrl}}/webhook/w/:id/:serviceId
HEADERS

Authorization
{{apiKey}}
QUERY PARAMS

id
serviceId
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/w/:id/:serviceId");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/post "{{baseUrl}}/webhook/w/:id/:serviceId" {:headers {:authorization "{{apiKey}}"}})
require "http/client"

url = "{{baseUrl}}/webhook/w/:id/:serviceId"
headers = HTTP::Headers{
  "authorization" => "{{apiKey}}"
}

response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("{{baseUrl}}/webhook/w/:id/:serviceId"),
    Headers =
    {
        { "authorization", "{{apiKey}}" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/w/:id/:serviceId");
var request = new RestRequest("", Method.Post);
request.AddHeader("authorization", "{{apiKey}}");
var response = client.Execute(request);
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/w/:id/:serviceId"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("authorization", "{{apiKey}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
POST /baseUrl/webhook/w/:id/:serviceId HTTP/1.1
Authorization: {{apiKey}}
Host: example.com

AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook/w/:id/:serviceId")
  .setHeader("authorization", "{{apiKey}}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/w/:id/:serviceId"))
    .header("authorization", "{{apiKey}}")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/w/:id/:serviceId")
  .post(null)
  .addHeader("authorization", "{{apiKey}}")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook/w/:id/:serviceId")
  .header("authorization", "{{apiKey}}")
  .asString();
const data = null;

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('POST', '{{baseUrl}}/webhook/w/:id/:serviceId');
xhr.setRequestHeader('authorization', '{{apiKey}}');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/w/:id/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/w/:id/:serviceId';
const options = {method: 'POST', headers: {authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/w/:id/:serviceId',
  method: 'POST',
  headers: {
    authorization: '{{apiKey}}'
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val request = Request.Builder()
  .url("{{baseUrl}}/webhook/w/:id/:serviceId")
  .post(null)
  .addHeader("authorization", "{{apiKey}}")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'POST',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/w/:id/:serviceId',
  headers: {
    authorization: '{{apiKey}}'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
const request = require('request');

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/w/:id/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('POST', '{{baseUrl}}/webhook/w/:id/:serviceId');

req.headers({
  authorization: '{{apiKey}}'
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'POST',
  url: '{{baseUrl}}/webhook/w/:id/:serviceId',
  headers: {authorization: '{{apiKey}}'}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/w/:id/:serviceId';
const options = {method: 'POST', headers: {authorization: '{{apiKey}}'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"authorization": @"{{apiKey}}" };

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/w/:id/:serviceId"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/w/:id/:serviceId" in
let headers = Header.add (Header.init ()) "authorization" "{{apiKey}}" in

Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/w/:id/:serviceId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('POST', '{{baseUrl}}/webhook/w/:id/:serviceId', [
  'headers' => [
    'authorization' => '{{apiKey}}',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/w/:id/:serviceId');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'authorization' => '{{apiKey}}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook/w/:id/:serviceId');
$request->setRequestMethod('POST');
$request->setHeaders([
  'authorization' => '{{apiKey}}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/w/:id/:serviceId' -Method POST -Headers $headers
$headers=@{}
$headers.Add("authorization", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/w/:id/:serviceId' -Method POST -Headers $headers
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = ""

headers = { 'authorization': "{{apiKey}}" }

conn.request("POST", "/baseUrl/webhook/w/:id/:serviceId", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/w/:id/:serviceId"

payload = ""
headers = {"authorization": "{{apiKey}}"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/w/:id/:serviceId"

payload <- ""

response <- VERB("POST", url, body = payload, add_headers('authorization' = '{{apiKey}}'), content_type(""))

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/w/:id/:serviceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = '{{apiKey}}'

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
)

response = conn.post('/baseUrl/webhook/w/:id/:serviceId') do |req|
  req.headers['authorization'] = '{{apiKey}}'
end

puts response.status
puts response.body
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/w/:id/:serviceId";

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.post(url)
        .headers(headers)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request POST \
  --url {{baseUrl}}/webhook/w/:id/:serviceId \
  --header 'authorization: {{apiKey}}'
http POST {{baseUrl}}/webhook/w/:id/:serviceId \
  authorization:'{{apiKey}}'
wget --quiet \
  --method POST \
  --header 'authorization: {{apiKey}}' \
  --output-document \
  - {{baseUrl}}/webhook/w/:id/:serviceId
import Foundation

let headers = ["authorization": "{{apiKey}}"]

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/w/:id/:serviceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "request_id": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
  "status": "OK",
  "status_code": 200,
  "timestamp": "2021-10-01T08:26:28.039Z"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}
PATCH Update webhook subscription
{{baseUrl}}/webhook/webhooks/:id
HEADERS

x-apideck-app-id
Authorization
{{apiKey}}
QUERY PARAMS

id
BODY json

{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}
Examples
REQUEST

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook/webhooks/:id");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-apideck-app-id: ");
headers = curl_slist_append(headers, "authorization: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}");

CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])

(client/patch "{{baseUrl}}/webhook/webhooks/:id" {:headers {:x-apideck-app-id ""
                                                                            :authorization "{{apiKey}}"}
                                                                  :content-type :json
                                                                  :form-params {:delivery_url ""
                                                                                :description ""
                                                                                :events []
                                                                                :status ""}})
require "http/client"

url = "{{baseUrl}}/webhook/webhooks/:id"
headers = HTTP::Headers{
  "x-apideck-app-id" => ""
  "authorization" => "{{apiKey}}"
  "content-type" => "application/json"
}
reqBody = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}"

response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Patch,
    RequestUri = new Uri("{{baseUrl}}/webhook/webhooks/:id"),
    Headers =
    {
        { "x-apideck-app-id", "" },
        { "authorization", "{{apiKey}}" },
    },
    Content = new StringContent("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook/webhooks/:id");
var request = new RestRequest("", Method.Patch);
request.AddHeader("x-apideck-app-id", "");
request.AddHeader("authorization", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "{{baseUrl}}/webhook/webhooks/:id"

	payload := strings.NewReader("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("x-apideck-app-id", "")
	req.Header.Add("authorization", "{{apiKey}}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
PATCH /baseUrl/webhook/webhooks/:id HTTP/1.1
X-Apideck-App-Id: 
Authorization: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 77

{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/webhook/webhooks/:id")
  .setHeader("x-apideck-app-id", "")
  .setHeader("authorization", "{{apiKey}}")
  .setHeader("content-type", "application/json")
  .setBody("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}")
  .execute()
  .toCompletableFuture()
  .thenAccept(System.out::println)
  .join();

client.close();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("{{baseUrl}}/webhook/webhooks/:id"))
    .header("x-apideck-app-id", "")
    .header("authorization", "{{apiKey}}")
    .header("content-type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}"))
    .build();
HttpResponse 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, "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}");
Request request = new Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id")
  .patch(body)
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/webhook/webhooks/:id")
  .header("x-apideck-app-id", "")
  .header("authorization", "{{apiKey}}")
  .header("content-type", "application/json")
  .body("{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}")
  .asString();
const data = JSON.stringify({
  delivery_url: '',
  description: '',
  events: [],
  status: ''
});

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open('PATCH', '{{baseUrl}}/webhook/webhooks/:id');
xhr.setRequestHeader('x-apideck-app-id', '');
xhr.setRequestHeader('authorization', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');

xhr.send(data);
import axios from 'axios';

const options = {
  method: 'PATCH',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  data: {delivery_url: '', description: '', events: [], status: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const url = '{{baseUrl}}/webhook/webhooks/:id';
const options = {
  method: 'PATCH',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  body: '{"delivery_url":"","description":"","events":[],"status":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
const settings = {
  async: true,
  crossDomain: true,
  url: '{{baseUrl}}/webhook/webhooks/:id',
  method: 'PATCH',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  processData: false,
  data: '{\n  "delivery_url": "",\n  "description": "",\n  "events": [],\n  "status": ""\n}'
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
val client = OkHttpClient()

val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}")
val request = Request.Builder()
  .url("{{baseUrl}}/webhook/webhooks/:id")
  .patch(body)
  .addHeader("x-apideck-app-id", "")
  .addHeader("authorization", "{{apiKey}}")
  .addHeader("content-type", "application/json")
  .build()

val response = client.newCall(request).execute()
const http = require('https');

const options = {
  method: 'PATCH',
  hostname: 'example.com',
  port: null,
  path: '/baseUrl/webhook/webhooks/:id',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  }
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({delivery_url: '', description: '', events: [], status: ''}));
req.end();
const request = require('request');

const options = {
  method: 'PATCH',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  body: {delivery_url: '', description: '', events: [], status: ''},
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
const unirest = require('unirest');

const req = unirest('PATCH', '{{baseUrl}}/webhook/webhooks/:id');

req.headers({
  'x-apideck-app-id': '',
  authorization: '{{apiKey}}',
  'content-type': 'application/json'
});

req.type('json');
req.send({
  delivery_url: '',
  description: '',
  events: [],
  status: ''
});

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
const axios = require('axios').default;

const options = {
  method: 'PATCH',
  url: '{{baseUrl}}/webhook/webhooks/:id',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  data: {delivery_url: '', description: '', events: [], status: ''}
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
const fetch = require('node-fetch');

const url = '{{baseUrl}}/webhook/webhooks/:id';
const options = {
  method: 'PATCH',
  headers: {
    'x-apideck-app-id': '',
    authorization: '{{apiKey}}',
    'content-type': 'application/json'
  },
  body: '{"delivery_url":"","description":"","events":[],"status":""}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
#import 

NSDictionary *headers = @{ @"x-apideck-app-id": @"",
                           @"authorization": @"{{apiKey}}",
                           @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"delivery_url": @"",
                              @"description": @"",
                              @"events": @[  ],
                              @"status": @"" };

NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook/webhooks/:id"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "{{baseUrl}}/webhook/webhooks/:id" in
let headers = Header.add_list (Header.init ()) [
  ("x-apideck-app-id", "");
  ("authorization", "{{apiKey}}");
  ("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}" in

Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
  (* Do stuff with the result *)
 "{{baseUrl}}/webhook/webhooks/:id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'delivery_url' => '',
    'description' => '',
    'events' => [
        
    ],
    'status' => ''
  ]),
  CURLOPT_HTTPHEADER => [
    "authorization: {{apiKey}}",
    "content-type: application/json",
    "x-apideck-app-id: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
request('PATCH', '{{baseUrl}}/webhook/webhooks/:id', [
  'body' => '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}',
  'headers' => [
    'authorization' => '{{apiKey}}',
    'content-type' => 'application/json',
    'x-apideck-app-id' => '',
  ],
]);

echo $response->getBody();
setUrl('{{baseUrl}}/webhook/webhooks/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$request->setContentType('application/json');
$request->setBody(json_encode([
  'delivery_url' => '',
  'description' => '',
  'events' => [
    
  ],
  'status' => ''
]));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
append(json_encode([
  'delivery_url' => '',
  'description' => '',
  'events' => [
    
  ],
  'status' => ''
]));
$request->setRequestUrl('{{baseUrl}}/webhook/webhooks/:id');
$request->setRequestMethod('PATCH');
$request->setBody($body);

$request->setHeaders([
  'x-apideck-app-id' => '',
  'authorization' => '{{apiKey}}',
  'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook/webhooks/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}'
$headers=@{}
$headers.Add("x-apideck-app-id", "")
$headers.Add("authorization", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook/webhooks/:id' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}'
import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}"

headers = {
    'x-apideck-app-id': "",
    'authorization': "{{apiKey}}",
    'content-type': "application/json"
}

conn.request("PATCH", "/baseUrl/webhook/webhooks/:id", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
import requests

url = "{{baseUrl}}/webhook/webhooks/:id"

payload = {
    "delivery_url": "",
    "description": "",
    "events": [],
    "status": ""
}
headers = {
    "x-apideck-app-id": "",
    "authorization": "{{apiKey}}",
    "content-type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
library(httr)

url <- "{{baseUrl}}/webhook/webhooks/:id"

payload <- "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}"

encode <- "json"

response <- VERB("PATCH", url, body = payload, add_headers('x-apideck-app-id' = '', 'authorization' = '{{apiKey}}'), content_type("application/json"), encode = encode)

content(response, "text")
require 'uri'
require 'net/http'

url = URI("{{baseUrl}}/webhook/webhooks/:id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-apideck-app-id"] = ''
request["authorization"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}"

response = http.request(request)
puts response.read_body
require 'faraday'

conn = Faraday.new(
  url: 'https://example.com',
  headers: {'Content-Type' => 'application/json'}
)

response = conn.patch('/baseUrl/webhook/webhooks/:id') do |req|
  req.headers['x-apideck-app-id'] = ''
  req.headers['authorization'] = '{{apiKey}}'
  req.body = "{\n  \"delivery_url\": \"\",\n  \"description\": \"\",\n  \"events\": [],\n  \"status\": \"\"\n}"
end

puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;

#[tokio::main]
pub async fn main() {
    let url = "{{baseUrl}}/webhook/webhooks/:id";

    let payload = json!({
        "delivery_url": "",
        "description": "",
        "events": (),
        "status": ""
    });

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("x-apideck-app-id", "".parse().unwrap());
    headers.insert("authorization", "{{apiKey}}".parse().unwrap());
    headers.insert("content-type", "application/json".parse().unwrap());

    let client = reqwest::Client::new();
    let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
        .headers(headers)
        .json(&payload)
        .send()
        .await;

    let results = response.unwrap()
        .json::()
        .await
        .unwrap();

    dbg!(results);
}
curl --request PATCH \
  --url {{baseUrl}}/webhook/webhooks/:id \
  --header 'authorization: {{apiKey}}' \
  --header 'content-type: application/json' \
  --header 'x-apideck-app-id: ' \
  --data '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}'
echo '{
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
}' |  \
  http PATCH {{baseUrl}}/webhook/webhooks/:id \
  authorization:'{{apiKey}}' \
  content-type:application/json \
  x-apideck-app-id:''
wget --quiet \
  --method PATCH \
  --header 'x-apideck-app-id: ' \
  --header 'authorization: {{apiKey}}' \
  --header 'content-type: application/json' \
  --body-data '{\n  "delivery_url": "",\n  "description": "",\n  "events": [],\n  "status": ""\n}' \
  --output-document \
  - {{baseUrl}}/webhook/webhooks/:id
import Foundation

let headers = [
  "x-apideck-app-id": "",
  "authorization": "{{apiKey}}",
  "content-type": "application/json"
]
let parameters = [
  "delivery_url": "",
  "description": "",
  "events": [],
  "status": ""
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook/webhooks/:id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "data": {
    "created_at": "2020-09-30T07:43:32.000Z",
    "delivery_url": "https://example.com/my/webhook/endpoint",
    "description": "A description",
    "disabled_reason": "retry_limit",
    "events": [
      "vault.connection.created",
      "vault.connection.updated"
    ],
    "execute_base_url": "https://unify.apideck.com/webhook/webhooks/1234/execute",
    "id": "1234",
    "status": "enabled",
    "unified_api": "crm",
    "updated_at": "2020-09-30T07:43:32.000Z"
  },
  "status": "OK",
  "status_code": 200
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#requestvalidationerror",
  "status_code": 400,
  "type_name": "RequestValidationError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Failed to generate valid JWT Session. Verify applicationId is correct",
  "error": "Unauthorized",
  "message": "Unauthorized Request",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 401,
  "type_name": "UnauthorizedError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "You have reached your limit of 2000",
  "error": "Payment Required",
  "message": "Request Limit Reached",
  "ref": "https://developers.apideck.com/errors#requestlimiterror",
  "status_code": 402,
  "type_name": "RequestLimitError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Not Found",
  "message": "Unknown Widget",
  "ref": "https://developers.apideck.com/errors#entitynotfounderror",
  "status_code": 404,
  "type_name": "EntityNotFoundError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "detail": "Unprocessable request, please verify your request headers and body.",
  "error": "Unprocessable Entity",
  "message": "Invalid State",
  "ref": "https://developers.apideck.com/errors#invalidstateerror",
  "status_code": 422,
  "type_name": "InvalidStateError"
}
RESPONSE HEADERS

Content-Type
application/json
RESPONSE BODY json

{
  "error": "Bad Request",
  "message": "Invalid Params",
  "ref": "https://developers.apideck.com/errors#unauthorizederror",
  "status_code": 400,
  "type_name": "RequestHeadersValidationError"
}