Chilkat Online Tools

Delphi (ActiveX) / Marketplacer SELLER API / Webhook Create

Back to Collection Items

var

begin
http.BasicAuth := 1;http.Login := '{{username}}';http.Password := '{{password}}';json.UpdateString('query','mutation WebhookCreate($input: WebhookCreateMutationInput!) {' + #10 + '	webhookCreate(input: $input) {' + #10 + '		errors {' + #10 + '			field' + #10 + '			messages' + #10 + '		}' + #10 + '		status' + #10 + '		webhook {' + #10 + '			id' + #10 + '		}' + #10 + '	}' + #10 + '}');json.UpdateString('variables','{' + #10 + '	"input": {' + #10 + '		"attributes": {' + #10 + '			"enabled": true,' + #10 + '			"type": "INVOICE",' + #10 + '			"eventName": "UPDATE",' + #10 + '			"url": "https://example.com/your_post_endpoint",' + #10 + '			"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": [
  ]
}