> For the complete documentation index, see [llms.txt](https://resources.atriptech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.atriptech.com/api-wen-dang/readme/quick-start/making-requests.md).

# 沙箱访问

{% hint style="info" %}
遇到 API 接入问题时，可登录 [Eva](https://www.atriptech.com/) 寻求帮助。
{% endhint %}

用这页完成沙箱访问准备，并发送第一批 API 请求。

### 本阶段目标

完成沙箱的初始接入配置。

在开始构建预订流程前，应先完成这一步。

### 生成沙箱凭证

在 ATRIP 中获取沙箱凭证：

1. 打开 `Profile`
2. 打开 `My Profile`
3. 打开 `Company Information`

<figure><img src="/files/kMKR3ogQ7yQIC5YlbLsh" alt=""><figcaption></figcaption></figure>

在 `Sandbox Info` 中可以看到：

* `x-atlas-client-id`
* `x-atlas-client-secret`

每次调用沙箱 API 都要带上这两个值。

### 标准请求头

默认发送以下请求头：

* `Content-Type: application/json`
* `Accept: application/json`
* `Accept-Encoding: gzip`
* `x-atlas-client-id: <your-client-id>`
* `x-atlas-client-secret: <your-client-secret>`

### 基础请求规则

默认请求形式如下：

```
POST /<endpoint>.do
```

{% hint style="info" %}
沙箱基础地址是 `https://sandbox.atriptech.com/`。

把具体接口名拼在后面调用。

例如：`https://sandbox.atriptech.com/search.do`
{% endhint %}

* Atlas API 一律使用 `POST`
* 每个请求都发送 JSON body

### 后续会用到的标识符

后续步骤会拿到这些标识符。

它们会在预订链路中反复使用：

* `routingIdentifier`
* `sessionId`
* `orderNo`

### 响应与压缩处理

Atlas 的响应可能很大。

如果发送 `Accept-Encoding: gzip`，就必须正确处理 gzip 响应。

大多数 HTTP 客户端会自动解压。

所有集成都应遵循这些规则：

* `status == 0` 视为成功
* 不要用 `msg` 驱动业务逻辑
* 进入下一步前先检查返回的标识符
* 返回 `Content-Encoding: gzip` 时要正确处理压缩响应

### 安全要求

两个凭证都要保存在服务端。

不要暴露给客户端应用。

联调和测试使用沙箱。

验证完成后再切到生产环境。

### 完成标准

当你能在沙箱中做到以下几点时，这一阶段就完成了：

* 成功发送带认证的请求
* 正确使用标准请求头
* 明确哪些标识符会在后续复用
* 正确处理 gzip 响应

### 本阶段产出

* 沙箱 client ID 和 client secret
* 可用的请求配置
* 可开始开发的沙箱环境

### 下一步

先运行 [沙箱环境验证](/api-wen-dang/readme/quick-start/making-requests/sha-xiang-huan-jing-yan-zheng.md)。

四个核心步骤都通过后，再进入 [沙箱开发](/api-wen-dang/readme/quick-start/sha-xiang-kai-fa.md)。

### 相关页面

* [快速开始](/api-wen-dang/readme/quick-start.md)
* [沙箱环境验证](/api-wen-dang/readme/quick-start/making-requests/sha-xiang-huan-jing-yan-zheng.md)
* [沙箱开发](/api-wen-dang/readme/quick-start/sha-xiang-kai-fa.md)
* [预订流程概览](/api-wen-dang/readme/yu-ding-liu-cheng-gai-lan.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://resources.atriptech.com/api-wen-dang/readme/quick-start/making-requests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
