fontseca/fontseca.dev 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 133 个 Star、10 次 Fork。
仓库全名
fontseca/fontseca.dev
README 摘要
Welcome to the source code of my personal website, fontseca.dev. This site is a dedicated portal where I share my work, experience, ideas, interests, and thoughts. The project represents the culmination of four years of strong desired to have a place of my own, and one year of devoted work to make it possible. The initial design was just a single info page about myself, but it eventually turned into a more complete…
This is the source code of my website. The result of an unquenchable desire for having my own space. I enjoyed every moment of the long development process and feel joyous to share it with you. Hope it helps!
Welcome to the source code of my personal website, fontseca.dev. This site is a dedicated
portal where I share my work, experience, ideas, interests, and thoughts. The project represents the culmination of four
years of strong desired to have a place of my own, and one year of devoted work to make it possible. The initial design
was just a single info page about myself, but it eventually turned into a more complete and complex
platform.
One of my favorite sections in the site is the archive.
Before starting the web, I faced a dilemma: use an existing
platform like Hugo, or create a blog manager myself from scratch.
After some thinking, I chose to build my own blog manager—what I decided to call the archive.
Here, I address subjects I find interesting and worth sharing. As other sections of the site, the archive is fully
managed through an RPC-like API that powers the content,
and constitutes one of the core parts of my website, alongside my playground. In
this archive, I discuss certain topics that interest me.
As a back-end engineer, I encountered a problem most of us have suffered when we want to have a website to present
our work.
When we work on APIs, we often want to showcase some of our labor.
We could talk about it in a detailed article, but most of the time we want to play around with the product.
That is why
I created the second cornerstone of my website—what I call the playground; which
is, by the
way, open source and available for integration into other projects.
cheerfully celebrating the launch of my personal website built with go 1.23 — fontseca.dev
A screenshot of the fontseca.dev's archive in its final development phase.
The archive is a blog managed entirely through an API, featuring various entities like:
topics,
tags,
article drafts,
published articles,
and article patches.
Topics represent the main themes I write about, offering an organized way to group content by themes. On the other
hand, tags are keywords or labels to help categorize and locate articles related to similar discussions.
Articles are finalized pieces of writing on a particular topic, with one or more tags that are inherent to the
discussion of the articles and enhance their discoverability. Each article begins as an **article draft, or just draft
**, which is a rough and initial version of the article that outlines its main facts and points. Drafts are improved by
making revisions, and can be shared for feedback until they are ready for publishing as complete articles.
A screenshot of one article in the fontseca.dev's archive.
Once published, articles may need to be improved or amended; this is done through article patches, or just patches,
which are temporary entities pointing to the original article, where updates and enhancements are stored. Patches allow
continuous improvement without taking the article offline and can also be shared to get feedback. When the patch is
coherent and complete, it can be merged into the article, making the changes live.
Each article can have only one active patch, both referenced by the same unique identifier. However, the patch is a
completely different object that can be handled separately and privately. Since both entities share the same identifier,
it becomes easy to access any patch that an article currently has.
Articles Lifecycle
Following is the workflow diagram of the articles lifecycle; as you can see, articles start as drafts, then they become
real and published articles, once in that state, they can undergo updates or improvements through patches.
The workflow diagram the articles in the fontseca.dev's archive undergo.
The Playground
A screenshot of the initial version of the fontseca.dev's playground running with a collection exported from Postman.
Challenging in the beginning, this is the section that I find the most attractive on my website, not only because of its
UI but also because of its functionality. Before I started this module, I didn’t know how to integrate it into my
website because I wanted this project to be separate and work as a plug-in to my website. I had two essential ideas:
making it run in a different process using some sort of socket-based communication, or making it part of the same
codebase as my website. However, the solution was simpler and intuitive.
A brainstorming on how to implement the fontseca.dev's playground.
The playground is a web-based HTTP client to test APIs I’ve worked on or any other third-party public API. The very
basic idea of creating this section was to have a dedicated space to showcase my work as a back-end engineer, since most
of the time we find ourselves working far from the unwary visitor, making it hard sometimes to actually show what we do.
Another strong reason I had to build it was to experience the challenges the project presented.
My website is, at its core, fundamentally an API; however, I didn’t choose to implement a ubiquitous REST API, but
rather a more specialized RPC-like collection of methods that
provides me more flexibility in action. In essence, it is similar to APIs like Slack’s.
The API supports only two HTTP methods: GET and POST. The arguments to these actions are passed in two forms:
for GET methods, as query string,
and for POST methods, as application/x-www-form-urlencoded arguments in the request body.
So for POST requests, the Content-Type header must always be present with the application/x-www-form-urlencoded
value.
All methods are named in snake_case and organized by namespace.
The following is the set of methods the fontseca.dev API supports.
GET /me.get
POST /me.set
POST /me.set_photo
POST /me.set_resume
POST /me.set_hireable
GET /me.experience.list
GET /me.experience.hidden.list
GET /me.experience.get
POST /me.experience.create
POST /me.experience.set
POST /me.experience.hide
POST /me.experience.show
POST /me.experience.quit
POST /me.experience.remove
GET /me.projects.list
GET /me.projects.get
GET /me.projects.archived.list
POST /me.projects.create
POST /me.projects.set
POST /me.projects.archive
POST /me.projects.unarchive
POST /me.projects.finish
POST /me.projects.unfinish
POST /me.projects.remove
POST /me.projects.set_playground_url
POST /me.projects.set_first_image_url
POST /me.projects.set_second_image_url
POST /me.projects.set_github_url
POST /me.projects.set_collection_url
POST /me.projects.technologies.add
POST /me.projects.technologies.remove
GET /technologies.list
POST /technologies.create
POST /technologies.set
POST /technologies.remove
POST /archive.drafts.start
POST /archive.drafts.publish
GET /archive.drafts.list
GET /archive.drafts.get
POST /archive.drafts.share
POST /archive.drafts.revise
POST /archive.drafts.discard
POST /archive.drafts.tags.add
POST /archive.drafts.tags.remove
GET /archive.articles.list
GET /archive.articles.hidden.list
GET /archive.articles.get
POST /archive.articles.amend
POST /archive.articles.set_slug
POST /archive.articles.set_summary
POST /archive.articles.set_cover
POST /archive.articles.hide
POST /archive.articles.show
POST /archive.articles.remove
POST /archive.articles.pin
POST /archive.articles.unpin
POST /archive.articles.tags.add
POST /archive.articles.tags.remove
GET /archive.articles.patches.list
POST /archive.articles.patches.revise
POST /archive.articles.patches.share
POST /archive.articles.patches.discard
POST /archive.articles.patches.release
POST /archive.tags.create
GET /archive.tags.list
POST /archive.tags.set
POST /archive.tags.remove
POST /archive.topics.create
GET /archive.topics.list
POST /archive.topics.set
POST /archive.topics.remove
Errors
The fontseca.dev API implements error handling using the *
RFC 7807 Problem Details for HTTP APIs* standard. When an error
occurs, the API responds with a structured JSON object that includes details about the problem. This standardized format
improves interoperability and provides clients with consistent error messages, making it easier to troubleshoot and
respond to issues programmatically.
The standard application/problem+json media type is used for error responses, which provides the following fields:
type: A URI reference that identifies the problem type.
title: A short, human-readable summary of the problem.
status: The HTTP status code that is applicable to this problem.
detail: A human-readable explanation specific to this occurrence of the problem.
instance: A URI reference that identifies the specific occurrence of the problem (if applicable).
internal
Indicates a server-side error. This error does not provide detailed information about what happened in the server to the
client. Only a contact email for support is provided.
missing_argument
This error occurs when a required argument is missing in the request body of a method.
unparseable_value
This error occurs when a value provided in the request is in an incorrect format (e.g., invalid URL or improperly
formatted
boolean).
not_found
This error indicates that the requested resource could not be found in the database.
out_of_range
This error occurs when an input value is too high, too low, or otherwise falls outside the permitted limits, which may
be numeric,
or based on other boundaries. In other words, the provided value for a method argument is outside the acceptable range
defined for it.
unmet_validation
This error occurs when one or more fields in the request do not meet the expected validation rules. The response will
typically
include specific information on each field that failed validation to help identify the issue.
duplicate_key
This error occurs when the provided value to a method argument already exists in the database and must be then unique.
action_already_completed
This error occurs when an action cannot be repeated because it has already been completed for the target resource. For
example,
attempting to publish an article draft that is already published.
action_refused
This error occurs when the requested action cannot proceed because one or more required preconditions have not been met,
or a prior
step is missing. This typically means that a specific state or prerequisite action is needed before the current action
can be performed.
Me
This group of endpoints manages the user profile information.
GET /me.get
POST /me.set
POST /me.set_photo
POST /me.set_resume
POST /me.set_hireable
me.get
GET /me.get
Retrieves the current user’s profile information.
Errors
Type
Reason
internal
A server-side error occurred.
me.set
POST /me.set
Updates the user’s profile information. Only the fields provided in the request body will be updated. Fields not
included in the request remain unchanged.
Arguments
Name
Type
Required
Where
Description
summary
string
No
Body
A brief description of the user’s profile.
job_title
string
No
Body
The user’s current job title.
email
string
No
Body
The user’s email address.
company
string
No
Body
The user’s company.
location
string
No
Body
The user’s physical location.
github_url
string
No
Body
URL of the user’s GitHub profile.
linkedin_url
string
No
Body
URL of the user’s LinkedIn profile.
youtube_url
string
No
Body
URL of the user’s YouTube channel.
twitter_url
string
No
Body
URL of the user’s Twitter profile.
instagram_url
string
No
Body
URL of the user’s Instagram profile.
Errors
Type
Reason
unparseable_value
One or more provided URLs are invalid, or the email format is incorrect.
internal
A server-side error occurred.
me.set_photo
POST /me.set_photo
Updates the user’s profile photo by providing a new URL to the resource.
Arguments
Name
Type
Required
Where
Description
photo_url
string
Yes
Body
The URL of the new profile photo.
Errors
Type
Reason
missing_argument
The photo_url argument was not provided.
internal
A server-side error occurred.
me.set_resume
POST /me.set_resume
Updates the URL of the user’s résumé PDF file.
Arguments
Name
Type
Required
Where
Description
resume_url
string
Yes
Body
URL pointing to the location of the résumé file.
Errors
Type
Reason
missing_argument
The resume_url argument was not provided.
internal
A server-side error occurred.
me.set_hireable
POST /me.set_hireable
Updates whether the user is currently hireable.
Arguments
Name
Type
Required
Where
Description
hireable
bool
Yes
Body
Indicates if the user is open to work right now.
Errors
Type
Reason
missing_argument
The hireable argument was not provided.
unparseable_value
The hireable argument contains an invalid boolean value.
internal
A server-side error occurred.
Experience
This set of endpoints manages the user’s professional experience entries, allowing for the addition, updating, hiding,
and removal of experiences within the user’s profile.
GET /me.experience.list
GET /me.experience.hidden.list
GET /me.experience.get
POST /me.experience.create
POST /me.experience.set
POST /me.experience.hide
POST /me.experience.show
POST /me.experience.quit
POST /me.experience.remove
me.experience.list
GET /me.experience.list
Retrieves all experience entries for the user.
Errors
Type
Reason
internal
A server-side error occurred.
me.experience.hidden.list
GET /me.experience.hidden.list
Retrieves all experience entries that are marked as hidden from the public view. Newly created entries are hidden by
default.
Errors
Type
Reason
internal
A server-side error occurred.
me.experience.get
GET /me.experience.get
Retrieves the details of a specific experience entry.
Arguments
Name
Type
Required
Where
Description
experience_uuid
uuid
Yes
Query
The UUID of the experience to retrieve.
Errors
Type
Reason
not_found
The specified experience entry was not found.
unparseable_value
The provided experience_uuid format is invalid.
internal
A server-side error occurred.
me.experience.create
POST /me.experience.create
Creates a new experience entry for the user. This newly created entry is hidden by default.
Use me.experience.show to make it publicly available.
Arguments
Name
Type
Required
Where
Description
starts
date
Yes
Body
The start date in the format YYYY-MM-DD.
ends
date
No
Body
The end date in the format YYYY-MM-DD.
job_title
string
Yes
Body
The title held in this position.
company
string
Yes
Body
The name of the employing company.
company_homepage
string
Yes
Body
The URL of the company’s homepage.
country
string
Yes
Body
The country where this position is based.
summary
string
Yes
Body
A brief description of the role and responsibilities.
Errors
Type
Reason
unmet_validation
One or more fields do not meet validation requirements.
unparseable_value
Invalid URL format for company_homepage.
internal
A server-side error occurred.
me.experience.set
POST /me.experience.set
Updates an existing experience entry. Only fields provided in the request body will be modified.
Arguments
Name
Type
Required
Where
Description
experience_uuid
uuid
Yes
Body
The UUID of the experience to update.
starts
date
No
Body
The start date in the format YYYY-MM-DD.
ends
date
No
Body
The end date in the format YYYY-MM-DD.
job_title
string
No
Body
The title held in this position.
company
string
No
Body
The name of the employing company.
company_homepage
string
No
Body
The URL of the company’s homepage.
country
string
No
Body
The country where this position is based.
summary
string
No
Body
A brief description of the role and responsibilities.
Errors
Type
Reason
not_found
The specified experience entry was not found.
unmet_validation
One or more fields do not meet validation requirements.
unparseable_value
Invalid URL format for company_homepage.
internal
A server-side error occurred.
me.experience.hide
POST /me.experience.hide
Marks an experience entry as hidden, making it private.
Arguments
Name
Type
Required
Where
Description
experience_uuid
uuid
Yes
Body
The UUID of the experience entry to hide.
Errors
Type
Reason
not_found
The specified experience entry was not found.
unparseable_value
The argument experience_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.experience.show
POST /me.experience.show
Marks a hidden experience entry as visible, making it public.
Arguments
Name
Type
Required
Where
Description
experience_uuid
uuid
Yes
Body
The UUID of the experience entry to show.
Errors
Type
Reason
not_found
The specified experience entry was not found.
unparseable_value
The argument experience_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.experience.quit
POST /me.experience.quit
Marks the experience entry as no longer active, setting the ends field to the current date.
Arguments
Name
Type
Required
Where
Description
experience_uuid
uuid
Yes
Body
The UUID of the experience entry to quit.
Errors
Type
Reason
not_found
The specified experience entry was not found.
unparseable_value
The argument experience_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.experience.remove
POST /me.experience.remove
Permanently deletes an experience entry from the user’s profile.
Arguments
Name
Type
Required
Where
Description
experience_uuid
uuid
Yes
Body
The UUID of the experience entry to remove.
Errors
Type
Reason
not_found
The specified experience entry was not found.
unparseable_value
The argument experience_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
Projects
These endpoints manage the user’s projects, whether personal or done on behalf of a company or third-party clients.
GET /me.projects.list
GET /me.projects.get
GET /me.projects.archived.list
POST /me.projects.create
POST /me.projects.set
POST /me.projects.archive
POST /me.projects.unarchive
POST /me.projects.finish
POST /me.projects.unfinish
POST /me.projects.remove
POST /me.projects.set_playground_url
POST /me.projects.set_first_image_url
POST /me.projects.set_second_image_url
POST /me.projects.set_github_url
POST /me.projects.set_collection_url
POST /me.projects.technologies.add
POST /me.projects.technologies.remove
me.projects.list
GET /me.projects.list
Retrieves the list of all user’s projects.
Errors
Type
Reason
internal
A server-side error occurred.
me.projects.get
GET /me.projects.get
Retrieves details of a specific project by its UUID.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Query
The UUID of the project.
Errors
Type
Reason
not_found
The specified project was not found.
unparseable_value
The argument project_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.projects.archived.list
GET /me.projects.archived.list
Lists all projects marked as archived.
Errors
Type
Reason
internal
A server-side error occurred.
me.projects.create
POST /me.projects.create
Creates a new project entry.
Arguments
Name
Type
Required
Where
Description
name
string
Yes
Body
The name of the project.
homepage
string
No
Body
The project homepage URL.
company
string
No
Body
The name of the company (if any).
company_homepage
string
No
Body
The URL of the company homepage.
starts
date
No
Body
Start date in YYYY-MM-DD format.
ends
date
No
Body
End date in YYYY-MM-DD format.
language
string
No
Body
The programming language used.
summary
string
No
Body
A brief project description.
content
string
No
Body
Detailed project content or overview.
first_image_url
string
No
Body
The primary image of the project.
second_image_url
string
No
Body
The secondary image of the project.
github_url
string
No
Body
The URL of the project in GitHub.
collection_url
string
No
Body
A URL to download the JSON collection exported from Postman. (If set, the project will be playable.)
Errors
Type
Reason
unmet_validation
Required fields are missing or invalid.
internal
A server-side error occurred.
me.projects.set
POST /me.projects.set
Updates details of an existing project.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project to update.
name
string
No
Body
The name of the project.
homepage
string
No
Body
The project homepage URL.
company
string
No
Body
The name of the company (if any).
company_homepage
string
No
Body
The URL of the company homepage.
starts
date
No
Body
Start date in YYYY-MM-DD format.
ends
date
No
Body
End date in YYYY-MM-DD format.
language
string
No
Body
The programming language used.
summary
string
No
Body
A brief project description.
content
string
No
Body
Detailed project content or overview.
first_image_url
string
No
Body
The primary image of the project.
second_image_url
string
No
Body
The secondary image of the project.
github_url
string
No
Body
The URL of the project in GitHub.
collection_url
string
No
Body
A URL to download the JSON collection exported from Postman. (If set, the project will be playable.)
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
The project_uuid argument was not provided in the request.
unmet_validation
Required fields are missing or invalid.
internal
A server-side error occurred.
me.projects.archive
POST /me.projects.archive
Marks a project as archived.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
The project_uuid argument was not provided in the request.
unparseable_value
The argument project_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.projects.unarchive
POST /me.projects.unarchive
Unarchives a previously archived project.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
The project_uuid argument was not provided in the request.
unparseable_value
The argument project_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.projects.finish
POST /me.projects.finish
Marks a project as finished.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
The project_uuid argument was not provided in the request.
unparseable_value
The argument project_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.projects.unfinish
POST /me.projects.unfinish
Marks a project as unfinished.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
The project_uuid argument was not provided in the request.
unparseable_value
The argument project_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.projects.remove
POST /me.projects.remove
Permanently deletes a project.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
The project_uuid argument was not provided in the request.
unparseable_value
The argument project_uuid is either not present (empty) or has an invalid format.
internal
A server-side error occurred.
me.projects.set_playground_url
POST /me.projects.set_playground_url
If the project is technically an HTTP/1.1 API, sets the URL to the Postman collection in the Playground.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
url
string
Yes
Body
The URL of the Postman collection in the Playground.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
Either the argument project_uuid or url was not provided in the request.
unparseable_value
Any of the arguments have an invalid format.
internal
A server-side error occurred.
me.projects.set_first_image_url
POST /me.projects.set_first_image_url
Sets the primary image of the project.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
url
string
Yes
Body
The URL of the image.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
Either the argument project_uuid or url was not provided in the request.
unparseable_value
Any of the arguments have an invalid format.
internal
A server-side error occurred.
me.projects.set_second_image_url
POST /me.projects.set_second_image_url
Sets the secondary image of the project.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
url
string
Yes
Body
The URL of the image.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
Either the argument project_uuid or url was not provided in the request.
unparseable_value
Any of the arguments have an invalid format.
internal
A server-side error occurred.
me.projects.set_github_url
POST /me.projects.set_github_url
Sets the URL of the GitHub repository for the project.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
url
string
Yes
Body
The URL of the repository.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
Either the argument project_uuid or url was not provided in the request.
unparseable_value
Any of the arguments have an invalid format.
internal
A server-side error occurred.
me.projects.set_collection_url
POST /me.projects.set_collection_url
The URL to the exported Postman collection.
Arguments
Name
Type
Required
Where
Description
project_uuid
uuid
Yes
Body
The UUID of the project.
url
string
Yes
Body
The URL of the Postman collection.
Errors
Type
Reason
not_found
The specified project was not found.
missing_argument
Either the argument project_uuid or url was not provided in the request.
Either the argument project_uuid or technology_id was not provided in the request.
unparseable_value
Any of the arguments have an invalid format.
internal
A server-side error occurred.
Project Technology Tags
These endpoints manage the technology tags that can be associated with the user’s projects. Originally, these tags were
intended to represent languages or tools, but now they have evolved to represent other kinds of concepts, such as tools,
social skills, frameworks, and related matters.
GET /technologies.list
POST /technologies.create
POST /technologies.set
POST /technologies.remove
technologies.list
GET /technologies.list
Retrieves a list of all available technology tags.
Errors
Type
Reason
internal
A server-side error occurred.
technologies.create
POST /technologies.create
Creates a new technology tag.
Arguments
Name
Type
Required
Where
Description
name
string
Yes
Body
The name of the technology tag.
Errors
Type
Reason
unmet_validation
The technology tag name is missing or invalid.
duplicate_key
The technology tag name is already registered.
internal
A server-side error occurred.
technologies.set
POST /technologies.set
Updates the name of an existing technology tag.
Arguments
Name
Type
Required
Where
Description
id
uuid
Yes
Body
The UUID of the technology tag.
name
string
Yes
Body
The name of the tag.
Errors
Type
Reason
not_found
The specified technology tag was not found.
missing_argument
The id argument was not provided in the request.
unmet_validation
The technology tag name is missing or invalid.
duplicate_key
The technology tag name is already registered.
internal
A server-side error occurred.
technologies.remove
POST /technologies.remove
Removes a technology tag.
Arguments
Name
Type
Required
Where
Description
id
uuid
Yes
Body
The UUID of the technology tag.
Errors
Type
Reason
not_found
The specified technology tag was not found.
missing_argument
The id argument was not provided in the request.
internal
A server-side error occurred.
Archive Article Drafts
The following endpoints help to manage article drafts in the archive. An article draft, or simply draft, is an early
version of an article that has not yet been finalized or published. A draft serves as a space to outline the main ideas,
facts, or arguments of a subject. It can be revised and refined before being shared for feedback, helping to improve
clarity and appeal. Once the draft meets the desired standards for completeness and engagement, it can be published.
Object
{
"uuid": "5ed25d57-219d-4617-b709-36cc358bfaee",
"title": "At autem impedit dolor maxime quae beatae adipisci.",
"slug": "at-autem-impedit-dolor-maxime-quae-beatae-adipisci",
"author": "fontseca.dev",
"read_time": 1,
"is_draft": true,
"is_pinned": false,
"published_at": null,
"modified_at": null,
"drafted_at": "2024-07-11T16:43:49.80269Z",
"updated_at": "2024-07-11T16:43:49.80269Z",
"topic": {
"id": "thinking",
"name": "Thinking",
"created_at": "2024-07-09T20:28:18.564315Z",
"updated_at": "2024-07-09T20:28:18.564315Z"
},
"tags": null,
"content": "Molestias ut sapiente nihil error iure ea necessitatibus maxime aliquam."
}
Methods
POST /archive.drafts.start
POST /archive.drafts.publish
GET /archive.drafts.list
GET /archive.drafts.get
POST /archive.drafts.share
POST /archive.drafts.revise
POST /archive.drafts.discard
POST /archive.drafts.tags.add
POST /archive.drafts.tags.remove
archive.drafts.start
POST /archive.drafts.start
Initiates the creation of a new article draft and returns its UUID. Only the title is required to start a draft; other
fields can be added or modified in subsequent revisions. A unique slug is automatically generated based from the title,
and it will get automatically updated if the title ever changes.
Arguments
Name
Type
Required
Where
Description
title
string
Yes
Body
The name of the article draft.
content
string
No
Body
Initial content of the article draft.
Errors
Type
Reason
unmet_validation
The technology tag name is missing or invalid.
duplicate_key
The technology tag name is already registered.
internal
A server-side error occurred.
archive.drafts.publish
POST /archive.drafts.publish
Publishes an article draft, making it publicly available. If it is called on a draft that’s already published, the
request will have no effect. Before a draft can be published, it must be associated with a topic within the archive to
ensure it is properly categorized. (See archive topics)
Arguments
Name
Type
Required
Where
Description
draft_uuid
uuid
Yes
Body
The UUID of the article draft.
Errors
Type
Reason
action_already_completed
The draft is already published and does not need further action.
action_refused
The draft cannot be published because it lacks a required topic association.
missing_argument
The draft_uuid argument was not provided in the request.
unparseable_value
The argument draft_uuid is either not present (empty) or has an invalid format.
not_found
The specified article draft was not found.
internal
A server-side error occurred.
archive.drafts.list
GET /archive.drafts.list
Retrieves a list of ongoing article drafts. If a search query is provided, the method will filter results to include
only drafts with titles that contain any of the keywords in the search string. The response supports pagination, with
page and rpp (records per page) parameters for fine control.
Arguments
Name
Type
Required
Where
Description
search
string
No
Query
A string to filter results by keywords in draft titles. If empty or omitted, lists all drafts.
page
int
No
Query
The page number to request. Defaults to 1 if omitted.
rpp
int
No
Query
The number of drafts per page. Defaults to 20 if not provided.
Errors
Type
Reason
internal
A server-side error occurred.
archive.drafts.get
GET /archive.drafts.get
Retrieves one article draft by its UUID.
Arguments
Name
Type
Required
Where
Description
draft_uuid
uuid
Yes
Query
The UUID of the article draft.
Errors
Type
Reason
unparseable_value
The argument draft_uuid is either not present (empty) or has an invalid format.
not_found
The specified article draft was not found.
internal
A server-side error occurred.
archive.drafts.share
POST /archive.drafts.share
Generates a temporary, shareable link to an article draft, allowing those with the link to view the draft’s progress and
provide feedback. The link does not make the draft publicly accessible; only users with the exact link can access the
draft. The link expires after a specified duration, which is implementation-dependent and might be included in the
response. If this endpoint is called again before the previous link expires, it will return the same link.
评论