curl -X POST "https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions" \
-H "Content-Type: application/json" \
-H "x-seller-id: <x-seller-id>" \
-d '{
"seller_id": "06f256c8-1bbf-42bf-93b4-ce2041bfb87e",
"callback_url": "https://myserver.com/send/callback/here",
"event": "APPROVED_TRANSACTIONS",
"authentication_type": "user_credentials",
"authentication_data": {
"user": "1cb9c739-8452-4436-816b-a833960b7680",
"password": "78ce12f6-665b-4354-8eaf-f0384413aaa8"
},
"subscription_id": "c2829224-45c1-4024-ac2c-4be8c42ff993"
}'
const response = await fetch(`https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"seller_id": "06f256c8-1bbf-42bf-93b4-ce2041bfb87e",
"callback_url": "https://myserver.com/send/callback/here",
"event": "APPROVED_TRANSACTIONS",
"authentication_type": "user_credentials",
"authentication_data": {
"user": "1cb9c739-8452-4436-816b-a833960b7680",
"password": "78ce12f6-665b-4354-8eaf-f0384413aaa8"
},
"subscription_id": "c2829224-45c1-4024-ac2c-4be8c42ff993"
})
});
const data = await response.json();
import requests
response = requests.request(
"POST",
"https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions",
json={
"seller_id": "06f256c8-1bbf-42bf-93b4-ce2041bfb87e",
"callback_url": "https://myserver.com/send/callback/here",
"event": "APPROVED_TRANSACTIONS",
"authentication_type": "user_credentials",
"authentication_data": {
"user": "1cb9c739-8452-4436-816b-a833960b7680",
"password": "78ce12f6-665b-4354-8eaf-f0384413aaa8"
},
"subscription_id": "c2829224-45c1-4024-ac2c-4be8c42ff993"
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"seller_id": "06f256c8-1bbf-42bf-93b4-ce2041bfb87e",
"callback_url": "https://myserver.com/send/callback/here",
"event": "APPROVED_TRANSACTIONS",
"authentication_type": "user_credentials",
"authentication_data": {
"user": "1cb9c739-8452-4436-816b-a833960b7680",
"password": "78ce12f6-665b-4354-8eaf-f0384413aaa8"
},
"subscription_id": "c2829224-45c1-4024-ac2c-4be8c42ff993"
}');
$response = curl_exec($ch);
curl_close($ch);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions", strings.NewReader(`{
"seller_id": "06f256c8-1bbf-42bf-93b4-ce2041bfb87e",
"callback_url": "https://myserver.com/send/callback/here",
"event": "APPROVED_TRANSACTIONS",
"authentication_type": "user_credentials",
"authentication_data": {
"user": "1cb9c739-8452-4436-816b-a833960b7680",
"password": "78ce12f6-665b-4354-8eaf-f0384413aaa8"
},
"subscription_id": "c2829224-45c1-4024-ac2c-4be8c42ff993"
}`))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"seller_id\": \"06f256c8-1bbf-42bf-93b4-ce2041bfb87e\",\n \"callback_url\": \"https://myserver.com/send/callback/here\",\n \"event\": \"APPROVED_TRANSACTIONS\",\n \"authentication_type\": \"user_credentials\",\n \"authentication_data\": {\n \"user\": \"1cb9c739-8452-4436-816b-a833960b7680\",\n \"password\": \"78ce12f6-665b-4354-8eaf-f0384413aaa8\"\n },\n \"subscription_id\": \"c2829224-45c1-4024-ac2c-4be8c42ff993\"\n}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require "net/http"
require "uri"
uri = URI("https://api.pre.globalgetnet.com/dpm/webhooks/v1/subscriptions")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = "{\n \"seller_id\": \"06f256c8-1bbf-42bf-93b4-ce2041bfb87e\",\n \"callback_url\": \"https://myserver.com/send/callback/here\",\n \"event\": \"APPROVED_TRANSACTIONS\",\n \"authentication_type\": \"user_credentials\",\n \"authentication_data\": {\n \"user\": \"1cb9c739-8452-4436-816b-a833960b7680\",\n \"password\": \"78ce12f6-665b-4354-8eaf-f0384413aaa8\"\n },\n \"subscription_id\": \"c2829224-45c1-4024-ac2c-4be8c42ff993\"\n}"
response = http.request(request)
puts response.body