Starter KitFumadocs

Update special event

Update the details of a special event.

PATCH
/special-events/{eventId}
AuthorizationBasic <token>

In: header

Path Parameters

eventIdstring

Identifier for a special event.

Formatuuid
name?string

Name of the special event.

location?string

Location where the special event is held.

eventDescription?string

Description of the special event.

dates?array<string>

List of planned dates for the special event.

price?number

Price of a ticket for the special event.

Formatfloat

Response Body

curl -X PATCH "https://redocly.com/_mock/docs/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39" \
  -H "Content-Type: application/json" \
  -d '{
    "location": "On the beach.",
    "price": 15
  }'
const body = JSON.stringify({
  "location": "On the beach.",
  "price": 15
})

fetch("https://redocly.com/_mock/docs/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://redocly.com/_mock/docs/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39"
  body := strings.NewReader(`{
    "location": "On the beach.",
    "price": 15
  }`)
  req, _ := http.NewRequest("PATCH", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://redocly.com/_mock/docs/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39"
body = {
  "location": "On the beach.",
  "price": 15
}
response = requests.request("PATCH", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;

var body = BodyPublishers.ofString("""{
  "location": "On the beach.",
  "price": 15
}""");
HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://redocly.com/_mock/docs/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39"))
  .header("Content-Type", "application/json")
  .PATCH(body)
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var body = new StringContent("""
{
  "location": "On the beach.",
  "price": 15
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PatchAsync("https://redocly.com/_mock/docs/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39", body);
var responseBody = await response.Content.ReadAsStringAsync();

{
  "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",
  "name": "Mermaid Treasure Identification and Analysis",
  "location": "On the beach.",
  "eventDescription": "Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.",
  "dates": [
    "2023-09-05",
    "2023-09-08"
  ],
  "price": 15
}
{
  "type": "object",
  "title": "Validation failed"
}
{
  "type": "object",
  "title": "Validation failed"
}