Skip to main content

Change the context of an Extension

PUT/v2/contributors/{contributorId}/extensions/{extensionId}/context
API version
v2
Request method
PUT
Operation ID
extension-change-context

Request​

  • contributorIdstringrequired
  • extensionIdstring (uuid)required

Responses​

Format
application/json
Description

The Extension context-change has been requested.

  • cleaningUpInstancesbooleanrequired

    If this value is true the context will change asynchronously after removing all extension-instances of this extension.

  • currentContextstring (one of: project, customer)required
  • idstring (uuid)required
Content-Type: application/json

{
"cleaningUpInstances": true,
"currentContext": "project",
"id": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"cleaningUpInstances": {
"description": "If this value is true the context will change asynchronously after removing all extension-instances of this extension.",
"example": true,
"type": "boolean"
},
"currentContext": {
"enum": [
"project",
"customer"
],
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"id",
"currentContext",
"cleaningUpInstances"
],
"type": "object"
}

Usage examples​

$ curl \
--fail \
--location \
-X PUT \
-d '{"context":"project"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/contributors/string/extensions/f0f86186-0a5a-45b2-aa33-502777496347/context
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.extensionChangeContext({
"contributorId": "string",
"extensionId": "f0f86186-0a5a-45b2-aa33-502777496347",
"data": {
"context": "project"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionChangeContext\ExtensionChangeContextRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionChangeContext\ExtensionChangeContextRequestBody;

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

// TODO: Please consult the properties and constructor signature of
// ExtensionChangeContextRequestBody to learn how to construct a valid instance
$body = new ExtensionChangeContextRequestBody(/* TODO: ... */);

$request = (new ExtensionChangeContextRequest(
contributorId: "string",
extensionId: "f0f86186-0a5a-45b2-aa33-502777496347",
body: $body
));
$response = $client->marketplace()->extensionChangeContext($request);

var_dump($response->getBody();

On this page