Skip to content

PATCH /api/quiz/{quizId}/questions/{questionId}

PATCH
/api/quiz/{quizId}/questions/{questionId}

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Parameters

Path Parameters

quizId*
Typestring
Required
questionId*
Typestring
Required

Request Body

JSON
{
"id": 1,
"text": "You are at a store for a pickup. What should you do?",
"durationInSeconds": 60,
"wikilink": "https://wiki.foodsharing.de/some_page",
"failurePoints": 2,
"answers": [
{
"id": 1,
"text": "Take every thing I see with me.",
"explanation": "You should not do that. Obviously.",
"answerRating": null
}
],
"commentCount": 0
}

Responses

Success
Authorization
api_key
Variables
Key
Value
quizId*
questionId*
cURL
curl -X PATCH \
'http://localhost/api/quiz/{quizId}/questions/{questionId}' \
 --data '{
  "id": 1,
  "text": "You are at a store for a pickup. What should you do?",
  "durationInSeconds": 60,
  "wikilink": "https://wiki.foodsharing.de/some_page",
  "failurePoints": 2,
  "answers": [
    {
      "id": 1,
      "text": "Take every thing I see with me.",
      "explanation": "You should not do that. Obviously.",
      "answerRating": null
    }
  ],
  "commentCount": 0
}'

Samples

cURL
curl -X PATCH http://localhost/api/quiz/{quizId}/questions/{questionId}
JavaScript
fetch("http://localhost/api/quiz/{quizId}/questions/{questionId}", { method: "PATCH" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/quiz/{quizId}/questions/{questionId}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.patch("http://localhost/api/quiz/{quizId}/questions/{questionId}")
print(response.json())