Zum Hauptinhalt springen

Dry run a webhook with random or given values

POST/v2/contributors/{contributorId}/extensions/{extensionId}/extension-instances/{extensionInstanceId}/actions/dry-run/{webhookKind}
API-Version
v2
Request-Methode
POST
Operation-ID
extension-dry-run-webhook

Request​

  • contributorIdstringrequired
  • extensionIdstring (uuid)required
  • extensionInstanceIdstring (uuid)required

    The ID of an extension instance. For this route it can be made up.

  • webhookKindstring (einer von: extension-added-to-context, extension-instance-updated, extension-instance-secret-rotated, extension-instance-removed-from-context)required

Responses​

Format
application/json
Beschreibung

The webhook has been run successfully.

  • errorMessagestring

    The error message of an internal error.

  • responseBodystring
  • responseCodenumber

    The http status code that the external application responded with.

  • responseHeadersstring
  • routeCalledstringrequired
  • successfulbooleanrequired

    This shows if the response of the external application has been accepted as successful.

Content-Type: application/json

{
"errorMessage": "The url httpsecurity is not a valid protocol",
"responseBody": "string",
"responseCode": 200,
"responseHeaders": "string",
"routeCalled": "https://example.com/extension/e1a9370f-cc3c-42b9-98b4-8e3ac54c9710/instance/f567441d-2429-48fd-8fe9-6c5dc18722d8/add?dry-run=true",
"successful": true
}
{
"properties": {
"errorMessage": {
"description": "The error message of an internal error.",
"example": "The url httpsecurity is not a valid protocol",
"type": "string"
},
"responseBody": {
"type": "string"
},
"responseCode": {
"description": "The http status code that the external application responded with.",
"example": 200,
"type": "number"
},
"responseHeaders": {
"type": "string"
},
"routeCalled": {
"example": "https://example.com/extension/e1a9370f-cc3c-42b9-98b4-8e3ac54c9710/instance/f567441d-2429-48fd-8fe9-6c5dc18722d8/add?dry-run=true",
"type": "string"
},
"successful": {
"description": "This shows if the response of the external application has been accepted as successful.",
"example": true,
"type": "boolean"
}
},
"required": [
"successful",
"routeCalled"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/contributors/string/extensions/f0f86186-0a5a-45b2-aa33-502777496347/extension-instances/f0f86186-0a5a-45b2-aa33-502777496347/actions/dry-run/extension-added-to-context?contextId=string&scopes=string&instanceDisabled=true&createdAt=1985-10-26T01%3A21%3A00.000Z&secret=string
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.marketplace.extensionDryRunWebhook({
"contributorId": "string",
"extensionId": "f0f86186-0a5a-45b2-aa33-502777496347",
"extensionInstanceId": "f0f86186-0a5a-45b2-aa33-502777496347",
"webhookKind": "extension-added-to-context",
"queryParameters": {
"contextId": "string",
"scopes": [
"string"
],
"instanceDisabled": true,
"createdAt": "1985-10-26T01:21:00.000Z",
"secret": "string"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionDryRunWebhook\ExtensionDryRunWebhookRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ExtensionDryRunWebhookRequest(
contributorId: "string",
extensionId: "f0f86186-0a5a-45b2-aa33-502777496347",
extensionInstanceId: "f0f86186-0a5a-45b2-aa33-502777496347",
webhookKind: "extension-added-to-context"
))
->withContextId("string")
->withScopes(["string"])
->withInstanceDisabled(true)
->withCreatedAt("1985-10-26T01:21:00.000Z")
->withSecret("string");
$response = $client->marketplace()->extensionDryRunWebhook($request);

var_dump($response->getBody();

Auf dieser Seite