Zum Hauptinhalt springen

Authenticate your external application using a session token and an extension secret

POST/v2/authenticate-session-token
API-Version
v2
Request-Methode
POST
Operation-ID
extension-authenticate-with-session-token

Request​

Responses​

Format
application/json
Beschreibung

You received a public token with a short expiry. You can now perform domain actions.

  • expirystring (date-time)required
  • publicTokenstringrequired

    Set this in the 'x-access-token' header when performing domain actions.

Content-Type: application/json

{
"expiry": "1985-10-26T01:21:00.000Z",
"publicToken": "string"
}
{
"properties": {
"expiry": {
"format": "date-time",
"type": "string"
},
"publicToken": {
"description": "Set this in the 'x-access-token' header when performing domain actions.",
"type": "string"
}
},
"required": [
"publicToken",
"expiry"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{"extensionSecret":"string","sessionToken":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/authenticate-session-token
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.extensionAuthenticateWithSessionToken({
"data": {
"extensionSecret": "string",
"sessionToken": "string"
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionAuthenticateWithSessionToken\ExtensionAuthenticateWithSessionTokenRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionAuthenticateWithSessionToken\ExtensionAuthenticateWithSessionTokenRequestBody;

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

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

$request = (new ExtensionAuthenticateWithSessionTokenRequest(
body: $body
));
$response = $client->marketplace()->extensionAuthenticateWithSessionToken($request);

var_dump($response->getBody();

Auf dieser Seite