Execute a GraphQL query over the webhooks API
curl --request POST \
--url https://api.ebury.io/webhooks/graphql \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "mutation { createSubscription(input: { subscription: { active: true url: \"<your-inbox-url>\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }",
"variables": {}
}
'import requests
url = "https://api.ebury.io/webhooks/graphql"
payload = {
"query": "mutation { createSubscription(input: { subscription: { active: true url: \"<your-inbox-url>\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }",
"variables": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'mutation { createSubscription(input: { subscription: { active: true url: "<your-inbox-url>" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }',
variables: {}
})
};
fetch('https://api.ebury.io/webhooks/graphql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ebury.io/webhooks/graphql",
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([
'query' => 'mutation { createSubscription(input: { subscription: { active: true url: "<your-inbox-url>" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ebury.io/webhooks/graphql"
payload := strings.NewReader("{\n \"query\": \"mutation { createSubscription(input: { subscription: { active: true url: \\\"<your-inbox-url>\\\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ebury.io/webhooks/graphql")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"mutation { createSubscription(input: { subscription: { active: true url: \\\"<your-inbox-url>\\\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }\",\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ebury.io/webhooks/graphql")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"mutation { createSubscription(input: { subscription: { active: true url: \\\"<your-inbox-url>\\\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": "<string>"
}Webhooks
Execute a GraphQL query over the webhooks API
Execute a GraphQL query or mutation against the Webhooks API, used to manage webhook subscriptions and inspect their delivery history. Available operations include the subscriptions and webhookTypes queries, and the createSubscription, updateSubscription and deleteSubscription mutations. See WebhookType for the list of event types a subscription can be scoped to.
As with any GraphQL endpoint, a request that is successfully parsed and executed always returns 200, with the result under data and, if applicable, a non-empty errors array describing execution failures.
POST
/
webhooks
/
graphql
Execute a GraphQL query over the webhooks API
curl --request POST \
--url https://api.ebury.io/webhooks/graphql \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "mutation { createSubscription(input: { subscription: { active: true url: \"<your-inbox-url>\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }",
"variables": {}
}
'import requests
url = "https://api.ebury.io/webhooks/graphql"
payload = {
"query": "mutation { createSubscription(input: { subscription: { active: true url: \"<your-inbox-url>\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }",
"variables": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'mutation { createSubscription(input: { subscription: { active: true url: "<your-inbox-url>" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }',
variables: {}
})
};
fetch('https://api.ebury.io/webhooks/graphql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ebury.io/webhooks/graphql",
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([
'query' => 'mutation { createSubscription(input: { subscription: { active: true url: "<your-inbox-url>" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ebury.io/webhooks/graphql"
payload := strings.NewReader("{\n \"query\": \"mutation { createSubscription(input: { subscription: { active: true url: \\\"<your-inbox-url>\\\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }\",\n \"variables\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ebury.io/webhooks/graphql")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"mutation { createSubscription(input: { subscription: { active: true url: \\\"<your-inbox-url>\\\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }\",\n \"variables\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ebury.io/webhooks/graphql")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"mutation { createSubscription(input: { subscription: { active: true url: \\\"<your-inbox-url>\\\" types: [TRADE_STATUS_CHANGE] } }) { subscription { id } } }\",\n \"variables\": {}\n}"
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": "<string>"
}Headers
Query Parameters
Body
application/json
Request Payload
Response
Query was executed and the result is in the body