Gowit API
  • Gowit API (1.0.1)
  • Webhooks
  • API Key
  • API reference
    • 🔵Retrieve user webhooks
    • 🟢Add a webhook subscription
    • 🔴Delete webhook
Powered by GitBook
On this page
  1. API reference

Add a webhook subscription

Add a webhook subscription for an user.

PreviousRetrieve user webhooksNextDelete webhook

Last updated 1 year ago

curl -i -X POST \
  'https://api.gowit.us/v1/webhook?user=INSERT_USER&key=INSERT_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://www.web.com/api/",
    "name": "Name of subscription"
  }'
const query = new URLSearchParams({
  user: 'INSERT_USER',
  key: 'INSERT_KEY'
}).toString();

const resp = await fetch(
  `https://api.gowit.us/v1/webhook?${query}`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://www.web.com/api/',
      name: 'Name of subscription'
    })
  }
);

const data = await resp.json();
console.log(data);
import fetch from 'node-fetch';

async function run() {
  const query = new URLSearchParams({
    user: 'INSERT_USER',
    key: 'INSERT_KEY'
  }).toString();

  const resp = await fetch(
    `https://api.gowit.us/v1/webhook?${query}`,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        url: 'https://www.web.com/api/',
        name: 'Name of subscription'
      })
    }
  );

  const data = await resp.json();
  console.log(data);
}

run();
import requests

url = "https://api.gowit.us/v1/webhook"

query = {
  "user": "INSERT_USER",
  "key": "INSERT_KEY"
}

payload = {
  "url": "https://www.web.com/api/",
  "name": "Name of subscription"
}

headers = {"Content-Type": "application/json"}

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

data = response.json()
print(data)
🟢
post
Authorizations
Query parameters
keystringRequired

The API key is a unique identifier provided by our support team for accessing the API.

userstringRequired

The 'user' parameter is a unique identifier provided by the API support team to identify authorized users in the requests.

Body
urlstringRequiredExample: https://www.web.com/api/
namestringRequiredExample: Name of subscription
Responses
200
Subscription add
400
Bad Request
post
POST /v1/webhook HTTP/1.1
Host: api.gowit.us
Content-Type: application/json
Accept: */*
Content-Length: 64

{
  "url": "https://www.web.com/api/",
  "name": "Name of subscription"
}

No content