Chilkat Online Tools

PHP (Extension) / Marketplacer SELLER API / Webhook Create

Back to Collection Items

<?php

include("chilkat.php");

$http->put_BasicAuth(true);$http->put_Login('{{username}}');$http->put_Password('{{password}}');$json->UpdateString('query','mutation WebhookCreate($input: WebhookCreateMutationInput!) {\n	webhookCreate(input: $input) {\n		errors {\n			field\n			messages\n		}\n		status\n		webhook {\n			id\n		}\n	}\n}');$json->UpdateString('variables','{\n	\'input\': {\n		\'attributes\': {\n			\'enabled\': true,\n			\'type\': \'INVOICE\',\n			\'eventName\': \'UPDATE\',\n			\'url\': \'https://example.com/your_post_endpoint\',\n			\'headers\': \'{ \\');
?>

Curl Command

curl -X POST
	-u '{{username}}:{{password}}'
	-H "MARKETPLACER-API-KEY: {{api_key}}"
	-H "Content-Type: application/json"
	--data-raw '{"query":"mutation WebhookCreate($input: WebhookCreateMutationInput!) {\n\twebhookCreate(input: $input) {\n\t\terrors {\n\t\t\tfield\n\t\t\tmessages\n\t\t}\n\t\tstatus\n\t\twebhook {\n\t\t\tid\n\t\t}\n\t}\n}","variables":"{\n\t\"input\": {\n\t\t\"attributes\": {\n\t\t\t\"enabled\": true,\n\t\t\t\"type\": \"INVOICE\",\n\t\t\t\"eventName\": \"UPDATE\",\n\t\t\t\"url\": \"https://example.com/your_post_endpoint\",\n\t\t\t\"headers\": \"{ \\\"environment\\\": \\\"Production\\\" }\",\n\t\t\t\"queryString\": \"query($id: ID!){node(id: $id){... on Invoice{__typename id statusFlags createdAt}}}\"\n\t\t}\n\t}\n}"}'
https://bestfriendbazaar.com/graphql

Postman Collection Item JSON

{
  "name": "Webhook Create",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "MARKETPLACER-API-KEY",
        "value": "{{api_key}}",
        "type": "text"
      },
      {
        "key": "Content-Type",
        "value": "application/json",
        "type": "text"
      }
    ],
    "body": {
      "mode": "graphql",
      "graphql": {
        "query": "mutation WebhookCreate($input: WebhookCreateMutationInput!) {\n\twebhookCreate(input: $input) {\n\t\terrors {\n\t\t\tfield\n\t\t\tmessages\n\t\t}\n\t\tstatus\n\t\twebhook {\n\t\t\tid\n\t\t}\n\t}\n}",
        "variables": "{\n\t\"input\": {\n\t\t\"attributes\": {\n\t\t\t\"enabled\": true,\n\t\t\t\"type\": \"INVOICE\",\n\t\t\t\"eventName\": \"UPDATE\",\n\t\t\t\"url\": \"https://example.com/your_post_endpoint\",\n\t\t\t\"headers\": \"{ \\\"environment\\\": \\\"Production\\\" }\",\n\t\t\t\"queryString\": \"query($id: ID!){node(id: $id){... on Invoice{__typename id statusFlags createdAt}}}\"\n\t\t}\n\t}\n}"
      }
    },
    "url": {
      "raw": "{{base_url}}",
      "host": [
        "{{base_url}}"
      ],
      "path": null
    },
    "description": null
  },
  "response": [
  ]
}