/api/webhooksAfter successfull authorization your client app can get your webhook info. Basic auth credentials and signature key are not part of the response. If you lost the signature key and you need a new one just recreate the webhook (destroy + create).
URL returning webhook info (you have to be authorized, otherwise you’ll receive error 401).
Headers
| Name | Example | Description |
|---|---|---|
Authorization |
Bearer demo_access_token | - |
Code examples
cURL
curl --request GET 'https://app.datamolino.com/api/webhooks' \
--header 'Authorization: Bearer demo_access_token'HTTP
GET /api/webhooks HTTP/1.1
Host: app.datamolino.com
Authorization: Bearer demo_access_tokenJavaScript Fetch
const response = await fetch("https://app.datamolino.com/api/webhooks", {
method: "GET",
headers: {
"Authorization": "Bearer demo_access_token"
},
});
const data = await response.json();Node.js Axios
import axios from "axios";
const response = await axios({
method: "get",
url: "https://app.datamolino.com/api/webhooks",
headers: {
"Authorization": "Bearer demo_access_token"
}
});
console.log(response.data);Python Requests
import requests
url = "https://app.datamolino.com/api/webhooks"
headers = {
"Authorization": "Bearer demo_access_token"
}
response = requests.request("GET", url, headers=headers)
response.raise_for_status()
print(response.json())Ruby Net::HTTP
require 'json'
require 'net/http'
uri = URI("https://app.datamolino.com/api/webhooks")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer demo_access_token"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts JSON.parse(response.body)Ruby on Rails
# app/services/datamolino_client.rb
require 'json'
require 'net/http'
class DatamolinoClient
BASE_URL = "https://app.datamolino.com"
def initialize(access_token: Rails.application.credentials.dig(:datamolino, :access_token))
@access_token = access_token
end
def request_list_webhooks
uri = URI("#{BASE_URL}/api/webhooks")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{@access_token}"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
JSON.parse(response.body)
end
endPHP Guzzle
<?php
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://app.datamolino.com/api/webhooks', [
'headers' => json_decode('{"Authorization":"Bearer demo_access_token"}', true)
]);
echo $response->getBody();Java OkHttp
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://app.datamolino.com/api/webhooks")
.addHeader("Authorization", "Bearer demo_access_token")
.method("GET", null)
.build();
Response response = client.newCall(request).execute();C# HttpClient
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://app.datamolino.com/api/webhooks");
request.Headers.Add("Authorization", "Bearer demo_access_token");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());Go Native
client := &http.Client{}
req, err := http.NewRequest("GET", "https://app.datamolino.com/api/webhooks", nil)
if err != nil { panic(err) }
req.Header.Add("Authorization", "Bearer demo_access_token")
res, err := client.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil { panic(err) }
fmt.Println(string(body))Swift URLSession
import Foundation
var request = URLRequest(url: URL(string: "https://app.datamolino.com/api/webhooks")!)
request.httpMethod = "GET"
request.setValue("Bearer demo_access_token", forHTTPHeaderField: "Authorization")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!)Responses
200 OK
Content type: application/json; charset=utf-8
https://example.com/webhooks/datamolino