Appearance
Story Types
The main type representing a story in the Publishr API is StoryGet.
The content of a story is made up of story items, represented by the StoryItemGet type.
A story item contains various content fields, containing different data based on the type of element it represents.
A table of story items content based on element can be found here: StoryItem Element Content
ApiResponse
typescript
ApiResponse<T> {
status: 'success' | 'error' | 'noData';
errorcode?: string;
/** amount of total records, with no take/offset vals */
foundCount?: number;
data: T | null;
}StoryGet
typescript
StoryGet {
id: number;
title: string | null;
fkInput: number | null;
fkMediahouse: number | null;
fkLanguage: string | null;
fkOrganisation: number;
creationTimestamp: Date;
storyItem?: StoryItemGet[];
storyAuthor?: StoryAuthorGet[];
storyTag?: StoryTagGet[];
storyStatus?: StoryStatusGet[];
contenthubStory?: ContenthubStoryGet | null;
}References: StoryItemGet, StoryAuthorGet, StoryTagGet, ContenthubStoryGet, StoryStatusGet
StoryAuthorGet
typescript
StoryAuthorGet {
fkStory: number;
fkContact: number;
isMain: boolean | null;
authorType: string | null;
contact?: ContactGet;
}References: ContactGet
StoryTagGet
typescript
StoryTagGet {
fkStory: number;
fkTag: number;
tag?: TagGet;
}References: TagGet
ContactGet
typescript
ContactGet {
id: number;
fkOrganisation: number | null;
fkMedia: number | null;
fkMediaSquare: number | null;
firstName: string | null;
lastName: string | null;
nameShort: string | null;
email: string | null;
mobile: string | null;
phone: string | null;
profession: string | null;
notes: string | null;
street: string | null;
zip: string | null;
city: string | null;
birthday: string | null;
additionalInfo: string | null;
filemakerId: string | null;
deletedAt: Date | null;
source: string | null;
type: number;
externalId: string | null;
website: string | null;
}TagGet
typescript
TagGet {
id: number;
fkOrganisation: number;
type: number | null;
deletedAt: Date | null;
tagLanguage?: TagLanguage[];
}References: TagLanguage
TagLanguage
typescript
TagLanguage {
fkTag: number;
fkLanguage: string;
label: string;
}ContenthubStoryGet
typescript
ContenthubStoryGet {
fkStory: number;
publishTimestamp: Date | null;
canonicalUrl: string | null; // source url of social-media posts
slug: string | null;
ribbonText: string | null;
likes: number;
}StoryItemGet
typescript
StoryItemGet {
id: number;
fkStory: number | null;
fkElement: ElementType | null;
contentA: string;
contentB: string;
contentC: string;
contentD: string;
html: string;
orderElements: number | null; // order of elements within the story
orderSub: number | null; // order of sub-elements, e.g., within a media gallery (same orderElements as the parent element)
creationTimestamp: Date | null;
modificationTimestamp: Date | null;
}References: ElementType
Table of story item content based on element: StoryItem Element Content
StoryStatusGet
typescript
StoryStatusGet {
type: 'upload';
timestamp: Date;
}ElementType
typescript
enum ElementType {
'Titel 1' = 1, // Hauptitel
'Titel 3' = 3, // Zwischentitel
'Lead' = 6,
'Textblock' = 7,
'Zitat' = 8,
'Bild' = 13,
'Audio' = 15,
'Dokument' = 16,
'Youtube' = 17,
'Medienstrecke' = 20, // wrapper element, followed by 'Bild' or 'Video' items
'Catchword' = 30, // Schlagwort
'Tabelle' = 51,
'EmbeddedCode' = 61,
'Video' = 64,
}StoryItem Element Content
Table of content fields based on ElementType. All content fields are of type string.
They can contain text, HTML, JSON, or URLs depending on the element type.
| ElementType | contentA | contentB | contentC | contentD | html |
|---|---|---|---|---|---|
| Titel 1 | text | ||||
| Titel 3 | text | ||||
| Lead | text | ||||
| Textblock | plaintext | html | |||
| Zitat | text (quote) | text (autor) | |||
| Bild | url | html (description) | html (source) | ||
| Audio | url | html (description) | html (source) | duration | |
| Dokument | url | html (description) | html (source) | ||
| Youtube | id | html (description) | |||
| Medienstrecke | |||||
| Catchword | text | ||||
| Tabelle | json | html | |||
| EmbeddedCode 'embed' | html | "embed" | |||
| EmbeddedCode 'iframe' | url | "iframe" | desktop height (px) | mobile height (px) | |
| Video | url | html (description) | html (source) | duration |