Skip to content

Commit

Permalink
Add documentation on the get-entry-by-url endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Dec 12, 2024
1 parent 4b84164 commit edeb848
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
56 changes: 56 additions & 0 deletions docs/content/api-server/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,59 @@ title = "Endpoints"
type = "default"
description = "An overview of all the API endpoints"
+++

## Get entry by URL

`/api/v1/get-entry-by-url`

### Parameters

- `url` ^(required)^
- The full URL of the entry. This includes the path parts from the parent pages
- `locale` ^(required)^
- The locale of the entry to fetch

### 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
}
```
11 changes: 11 additions & 0 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ title = 'Contentstack Bridge'
contentDir = 'content'
disableHugoGeneratorInject = true

[markup]
[markup.goldmark]
[markup.goldmark.extensions]
[markup.goldmark.extensions.extras]
[markup.goldmark.extensions.extras.delete]
enable = true
[markup.goldmark.extensions.extras.superscript]
enable = true
[markup.goldmark.extensions.extras.subscript]
enable = true

[params]
linkTitle = 'CSB Docs'
themeVariant = 'zen-dark'
Expand Down

0 comments on commit edeb848

Please sign in to comment.