Zum Hauptinhalt springen

Store new or update poll settings

POST/v2/poll-settings/{userId}
API-Version
v2
Request-Methode
POST
Operation-ID
user-post-poll-status

Request​

  • userIdstringrequired

Responses​

Format
application/json
Beschreibung

The updated poll settings.

  • completedAtstring (date-time)
  • dontShowUntilstring (date-time)
  • ignoredAtstring (date-time)
  • shouldShowbooleanrequired
  • statusstring (einer von: completed, muted, ignored, new)required
  • userIdstringrequired
Content-Type: application/json

{
"completedAt": "1985-10-26T01:21:00.000Z",
"dontShowUntil": "1985-10-26T01:21:00.000Z",
"ignoredAt": "1985-10-26T01:21:00.000Z",
"shouldShow": true,
"status": "completed",
"userId": "string"
}
{
"properties": {
"completedAt": {
"format": "date-time",
"type": "string"
},
"dontShowUntil": {
"format": "date-time",
"type": "string"
},
"ignoredAt": {
"format": "date-time",
"type": "string"
},
"shouldShow": {
"type": "boolean"
},
"status": {
"enum": [
"completed",
"muted",
"ignored",
"new"
],
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"userId",
"shouldShow",
"status"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{"status":"completed","userId":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/poll-settings/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.user.postPollStatus({
"userId": "string",
"data": {
"status": "completed",
"userId": "string"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\PostPollStatus\PostPollStatusRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\User\PostPollStatus\PostPollStatusRequestBody;

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

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

$request = (new PostPollStatusRequest(
userId: "string",
body: $body
));
$response = $client->user()->postPollStatus($request);

var_dump($response->getBody();

Auf dieser Seite