Skip to content

Commit

Permalink
Move the response type to a separate page
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Dec 13, 2024
1 parent edeb848 commit cf452d2
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 42 deletions.
43 changes: 1 addition & 42 deletions docs/content/api-server/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,4 @@ description = "An overview of all the API endpoints"

### Response type

```typescript
{
data: {
// An array of alternative locales will always
// be returned alongside the entry itself.
alt_locales: {
uid: string,
content_type: string,
locale: string,
slug: string,
url: string,
}[],

// The entry is directly queried from Contentstack.
entry: {
ACL: unknown,
_in_progress: boolean,
_version: number,
created_at: string, // Timestamp string
created_by: string, // UID of the creator
locale: string,
parent: {
_content_type_uid: string,
uid: string,
}[],
publish_details: {
environment: string, // The environment UID
locale: string,
time: string, // Timestamp string
user: string, // The user UID
},
tags: string[],
title: string,
uid: string,
updated_at: string, // Timestamp string
updated_by: string, // The user UID
url: string,
},
},
error?: string // Will be null unless there's an error
}
```
[++RoutableEntryResponse++](response-types#routableentryresponse)
50 changes: 50 additions & 0 deletions docs/content/api-server/response-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
+++
title = "Response types"
type = "default"
description = "A list of possible response types"
+++

## RoutableEntryResponse

```typescript
{
data: { // Will be null if there's an error
// An array of alternative locales will always
// be returned alongside the entry itself.
alt_locales: {
uid: string,
content_type: string,
locale: string,
slug: string,
url: string,
}[],

// The entry is directly queried from Contentstack.
entry: {
ACL: unknown,
_in_progress: boolean,
_version: number,
created_at: string, // Timestamp string
created_by: string, // UID of the creator
locale: string,
parent: {
_content_type_uid: string,
uid: string,
}[],
publish_details: {
environment: string, // The environment UID
locale: string,
time: string, // Timestamp string
user: string, // The user UID
},
tags: string[],
title: string,
uid: string,
updated_at: string, // Timestamp string
updated_by: string, // The user UID
url: string,
},
},
error?: string // Will be null unless there's an error
}
```
2 changes: 2 additions & 0 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ disableHugoGeneratorInject = true
[markup.goldmark.extensions.extras]
[markup.goldmark.extensions.extras.delete]
enable = true
[markup.goldmark.extensions.extras.insert]
enable = true
[markup.goldmark.extensions.extras.superscript]
enable = true
[markup.goldmark.extensions.extras.subscript]
Expand Down

0 comments on commit cf452d2

Please sign in to comment.