TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Cosmic REST API v2 and Brand New Docs

2 点作者 tonyspiro超过 4 年前

1 comment

tonyspiro超过 4 年前
Hi I&#x27;m Tony, CEO of Cosmic (W19). Cosmic is a Headless CMS that provides a web dashboard to create content and API tools to deliver content to any website or app. We just released the Cosmic REST API v2 which we rebuilt from the ground up.<p>Check out the link above to see the changelog article or you can read the list of improvements &#x2F; features &#x2F; changes here:<p>New Features:<p>Nested metadata props are now possible without limit. This gives you GraphQL-like data response powers to get only the data you need. No depth limit for Object relationships. The only limit is the prevention of infinite recursion. We now offer a Postman collection to review and demo all REST API methods. This is a great way to get started with the new API methods. You can now use the after param for Object pagination vs limit and skip. We now have endpoints for Metafields and Media Folders to do CRUD operations directly.<p>Improvements:<p>Lighter codebase, faster endpoints. In some cases, endpoint response times are up to 50% faster (non-cached). Better endpoint structures that follow standard REST conventions such as POST &#x2F;resources, GET &#x2F;resources&#x2F;:resource_id, etc. Consistent error responses with verbose messages. The Select Dropdown Metafield now includes both key and value in the API response.<p>Changes:<p>_id has been changed to id. type_slug has been changed to type. status can now either be published or any (which returns latest Object version draft or published). query is now the primary method for fetching and filtering Objects (Advanced Queries from v1). Single Objects must now be fetched using id. To fetch by slug, you will need to use query. write_key will now be required in the request header as Authorization Bearer. metafields are hidden by default. Stricter user input requirements. No additional fields are possible in the body for POST and PATCH requests. There is a new, more secure token authentication strategy.<p>You can see more in the new docs site: <a href="https:&#x2F;&#x2F;docs-v2.cosmicjs.com" rel="nofollow">https:&#x2F;&#x2F;docs-v2.cosmicjs.com</a><p>Let me know what you think!