> ## Documentation Index
> Fetch the complete documentation index at: https://docs.livingsecurity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Postman 集合

> 导入生成的 Living Security Public API Postman 集合，粘贴 API 密钥，几分钟内即可调用 /v1。

Living Security API v1 Postman 集合由驱动 [API v1 参考](/v1-reference/openapi-v1.json)的同一份 OpenAPI 规范生成，因此始终与已发布的接口契约保持一致。该集合涵盖全部 `/v1` 个操作，按资源分组，并已预先配置身份验证。

## 下载

<Info>
  在提供文件之前，下载链接会提示您使用 Living Security 账户登录。
</Info>

<CardGroup cols={1}>
  <Card title="Living Security API v1 集合" icon="download">
    Postman Collection v2.1，包含全部 `/v1` 个操作，并已预先配置 Basic 身份验证。集合 `baseUrl` 为空——发送请求之前，请先选择区域环境。

    <a href="/v1-reference/postman/living-security-api-v1.postman_collection.json" download="living-security-api-v1.postman_collection.json">下载集合</a>
  </Card>

  <Card title="生产（美国）环境" icon="download">
    `baseUrl` 已预设为 `https://api.us-east-1.livingsecurity.ai/v1`，其中 `apiKeySecret` 和 `contractVersion` 变量为空，需要您自行填写。

    <a href="/v1-reference/postman/living-security-production.postman_environment.json" download="living-security-production.postman_environment.json">下载美国生产环境</a>
  </Card>

  <Card title="生产（欧盟）环境" icon="download">
    `baseUrl` 已预设为 `https://api.eu-west-1.livingsecurity.ai/v1`，其中 `apiKeySecret` 和 `contractVersion` 变量为空，需要您自行填写。

    <a href="/v1-reference/postman/living-security-production-eu.postman_environment.json" download="living-security-production-eu.postman_environment.json">下载欧盟生产环境</a>
  </Card>

  <Card title="环境模板" icon="download">
    包含相同的变量，但 `baseUrl` 为空，适用于非生产环境的设置。

    <a href="/v1-reference/postman/living-security-environment-template.postman_environment.json" download="living-security-environment-template.postman_environment.json">下载环境模板</a>
  </Card>
</CardGroup>

## 在 Postman 中进行设置

<Steps>
  <Step title="导入文件">
    在 Postman 中选择 **Import**，然后将集合文件以及与贵组织相匹配的“生产（美国）”或“生产（欧盟）”环境文件拖入。请参阅[区域](/zh-Hans/developers/v1/regions)。
  </Step>

  <Step title="创建 API 密钥">
    在仪表板中，打开 **设置 → 集成与开发者 → Developer Hub**，创建一个服务账户，然后创建 API 密钥。密钥的 secret 以 `lsk_live_` 开头，并且仅显示一次，请立即复制。详情请参阅 [API 密钥](/zh-Hans/developers/developer-hub/api-keys)。
  </Step>

  <Step title="粘贴 secret">
    设置 `apiKeySecret` 变量——可以在已导入的环境中设置（推荐；该变量为 secret 类型），也可以在集合的 **Variables** 选项卡中设置。
  </Step>

  <Step title="发送请求">
    选择已导入的区域环境，打开任意请求——例如 **Organization → Retrieve the organization**——然后点击 **Send**。在选择环境之前请勿发送请求；集合的 `baseUrl` 为空是有意为之。
  </Step>
</Steps>

## 身份验证的预配置方式

该集合在集合级别设置了 Basic 身份验证，用户名为 `apikey`，密码为 `{{apiKeySecret}}`。API 接受在任一 Basic 身份验证字段中提供密钥 secret，因此只要设置好该变量，即可直接使用。

如果您更倾向于使用 Bearer 身份验证，请将集合的 **Authorization** 类型更改为 **Bearer Token**，并使用 `{{apiKeySecret}}` 作为令牌——API 对这两种方式接受相同的 secret。

将 Bearer 标头与 API 密钥搭配使用无需 OAuth。若要使用 OAuth，请将 **Bearer Token** 设置为您的 OAuth 访问令牌，而不是 API 密钥的 secret。如需选择身份验证方法，请参阅[身份验证](/zh-Hans/developers/v1/authentication)；有关令牌和客户端的设置，请参阅 [OAuth 客户端凭据](/zh-Hans/developers/v1/oauth)。

## 契约版本标头

每个请求都带有一个 `Living-Security-Version` 标头，预设为 `{{contractVersion}}`，默认处于禁用状态。保持禁用即可使用贵组织固定的契约版本。启用后，可将请求固定到某个特定的已发布版本——已发布的版本请参阅[更新日志](/zh-Hans/developers/v1/changelog)。

## 查询参数和请求体

列表端点的筛选条件（`limit`、`page_token` 以及特定资源的筛选条件）已包含在每个请求中，但处于禁用状态，因此全新导入后即可成功调用每个端点。请启用并填写您需要的条件——有关 `page_token` 的工作方式，请参阅[分页](/zh-Hans/developers/v1/pagination)。`POST` 操作的请求体已预先填入带类型的占位值。

<Note>
  每当契约发生变更时，该集合都会根据已发布的 OpenAPI 规范重新生成——请下载最新副本，而不要通过编辑请求来保持其时效性。
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.