Docs menu

Send a test event

Beta POST /v1/monitors/{monitor_id}/test

POST /v1/monitors/{monitor_id}/test

Send a signed test event ("type": "test") to the monitor's webhook now and report what the receiver answered. Free; nothing is stored.

  • Cost: Free
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Not cached.

Parameters#

NameTypeRequiredDescriptionIn
monitor_idstringyesMonitor id.path

Example request#

Set your key in the environment first (see Authentication).

curl
curl -X POST "https://api.socialscrape.io/v1/monitors/mon_0123456789abcdef/test" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY"
Python
import os
import requests

res = requests.post(
    "https://api.socialscrape.io/v1/monitors/mon_0123456789abcdef/test",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const res = await fetch("https://api.socialscrape.io/v1/monitors/mon_0123456789abcdef/test", {
  method: "POST",
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}

Example response#

This is a sample with illustrative values. Status 200.

{
  "ok": true,
  "credits_charged": 0,
  "credits_remaining": 5000,
  "cached": false,
  "cached_at": null,
  "request_id": "req_125748a7f0deee6f71dc2c2a",
  "data": {
    "object": "webhook_test",
    "monitor_id": "mon_0123456789abcdef",
    "delivered": true,
    "status_code": 200,
    "error": null
  },
  "cursor": null,
  "has_more": null
}

Response#

A WebhookTest object in data.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.

Every request can also fail with the account and platform errors listed on the Errors page.