createWebhookSubscription

GraphQL Mutation: createWebhook

Parameter Type Required
subscription_type SubscriptionType! true
url String! true
header_key String false
header_value String false
mutation createWebhook(
    $subscription_type: SubscriptionType!,
    $url: String!,
    $header_key: String,
    $header_value: String
) {
    createWebhook(
        subscription_type: $subscription_type,
        url: $url,
        header_key: $header_key,
        header_value: $header_value
    ) {
        id
        subscription_type
        url
        header_key
        header_value
    }
}
enum SubscriptionType {
  entity
  transfer
  incoming_transfer
  wallet
}

var axios = require('axios');

var data = JSON.stringify({ query: `mutation createWebhookSubscription (

$subscription_type: SubscriptionType!,

$url: String!,

$header_key: String,

$header_value: String

) {

createWebhookSubscription (

subscription_type: $subscription_type,

url: $url,

header_key: $header_key,

header_value: $header_value

)

}`,
variables: {"subscription_type":"transfer","url":"https://myurl.com","header_key":"my-key","header_value":"key-value"} });

var config = { method: 'post', url: 'https://sandbox.external.routefusion.com/graphql', headers: { 'Authorization': 'Bearer ', 'Content-Type': 'application/json' }, data : data };

axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });

{ "data": { "createWebhookSubscription": "18ea46e5-2c36-4862-9eac-adc44364df7b" } }