Starter KitFumadocs

Create special events

Creates a new special event for the museum.

POST
/special-events
AuthorizationBasic <token>

In: header

eventId?string

Identifier for a special event.

Formatuuid
namestring

Name of the special event.

locationstring

Location where the special event is held.

eventDescriptionstring

Description of the special event.

datesarray<string>

List of planned dates for the special event.

pricenumber

Price of a ticket for the special event.

Formatfloat

Response Body

curl -X POST "https://redocly.com/_mock/docs/openapi/museum-api/special-events" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Mermaid Treasure Identification and Analysis",
    "location": "Under the seaaa 🦀 🎶 🌊.",
    "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": 0
  }'
const body = JSON.stringify({
  "name": "Mermaid Treasure Identification and Analysis",
  "location": "Under the seaaa 🦀 🎶 🌊.",
  "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": 0
})

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

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

func main() {
  url := "https://redocly.com/_mock/docs/openapi/museum-api/special-events"
  body := strings.NewReader(`{
    "name": "Mermaid Treasure Identification and Analysis",
    "location": "Under the seaaa 🦀 🎶 🌊.",
    "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": 0
  }`)
  req, _ := http.NewRequest("POST", 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"
body = {
  "name": "Mermaid Treasure Identification and Analysis",
  "location": "Under the seaaa 🦀 🎶 🌊.",
  "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": 0
}
response = requests.request("POST", 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("""{
  "name": "Mermaid Treasure Identification and Analysis",
  "location": "Under the seaaa 🦀 🎶 🌊.",
  "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": 0
}""");
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"))
  .header("Content-Type", "application/json")
  .POST(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("""
{
  "name": "Mermaid Treasure Identification and Analysis",
  "location": "Under the seaaa 🦀 🎶 🌊.",
  "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": 0
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PostAsync("https://redocly.com/_mock/docs/openapi/museum-api/special-events", body);
var responseBody = await response.Content.ReadAsStringAsync();

{
  "eventId": "dad4bce8-f5cb-4078-a211-995864315e39",
  "name": "Mermaid Treasure Identification and Analysis",
  "location": "Under the seaaa 🦀 🎶 🌊.",
  "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": 30
}
{
  "type": "object",
  "title": "Validation failed"
}
{
  "type": "object",
  "title": "Validation failed"
}