Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

OfferDate

Matthias Rohmer edited this page Sep 30, 2021 · 1 revision

/v1/offer/:offerId/date/:offerDateId

Organizers can create additional dates for any of their offers.

Resource

Features Yes / No
Allows media No
Allows links No
Is taggable No
Is translatable Yes
interface OfferDate {
  id: number;
  type: "offerdate";
  attributes: {
    status: "scheduled" | "canceled" | "past";
    startsAt: string;
    endsAt: string;
    hasFee: boolean | null;
    needsRegistration: boolean | null;
    ticketUrl: string | null;
  };
  relations: {
    translations: [
      {
        id: number;
        type: "offerdatetranslation";
        attributes: {
          language: "de" | "en";
          name?: string;
          description?: string;
          roomDescription?: string;
        };
      }
    ];
    offer?: Offer;
  };
}

Routes

Parameters Values
sort createdAt, updatedAt, name
include *, offer
filter status=published, status=draft

GET /v1/offer

Response

{
  "data": [
    {
    "id": "ckr55j8h100b8ld52hush3u9m",
    "type": "offer",
    "attributes": {
      "status": "draft",
      "recurrenceRule": "DTSTART:20210610T181524Z\nRRULE:FREQ=DAILY;BYDAY=FR,TU,WE,SU,SA,MO,TH",
      "createdAt": "2021-05-27T10:47:17.000+02:00",
      "updatedAt": "2021-07-15T18:53:51.000+02:00"
    },
    "relations": {
      "translations": [
        {
          "id": 5,
          "type": "offertranslation",
          "attributes": {
            "language": "de",
            "name": "Wolfszeit",
            "description": null
          }
        }
      ],
      "dates": [
        {
          "id": 3,
          "type": "offerdate",
          "attributes": {
            "isManual": 1,
            "startsAt": "2021-07-16T18:39:41.000+02:00"
          },
          "relations": {
            "translations": [
              {
                "id": 3,
                "type": "offerdatetranslation",
                "attributes": {
                  "language": "de",
                  "name": "Premiere: Wolfszeit",
                  "description": null
                }
              }
            ]
          }
        }
      ]
    }
  ],
  "links": {
    "self": "http://beta.api.kulturdaten.berlin/v1/offer/",
    "first": "http://beta.api.kulturdaten.berlin/v1/offer/?page=1",
    "prev": null,
    "next": null,
    "last": "http://beta.api.kulturdaten.berlin/v1/offer/?page=1"
  },
  "meta": {
    "pages": {
      "total": 265,
      "perPage": 1000,
      "currentPage": 1,
      "lastPage": 1
    },
    "language": "de"
  }
}

POST /v1/offer

Request

{
  "attributes": {
    "name": "New offer"
  },
  "relations": {
    "links": ["http://facebook.new-offer.com"]
  }
}

Response

{
  "data": {
    "id": "ckr7icop10001ecp3cn900ujt",
    "type": "offer",
    "attributes": {
      "status": "draft",
      "recurrenceRule": null,
      "createdAt": "2021-07-17T10:28:13.000+02:00",
      "updatedAt": "2021-07-17T10:28:13.000+02:00"
    },
    "relations": {
      "translations": [
        {
          "id": 210,
          "type": "offertranslation",
          "attributes": {
            "language": "de",
            "name": "New offer",
            "description": null
          }
        }
      ],
      "dates": []
    }
  },
  "meta": {
    "language": "de"
  }
}
Clone this wiki locally