GET/v1/flights/airlines
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
cURL 请求
bash
curl -X GET 'https://api.sandbox.travelandz.com/v1/flights/airlines' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'请填写凭证以发送请求。
响应
点击「试一试!」发送请求,响应将显示在此处。
列出航班集成可用的航空公司元数据,包括 IATA 代码、徽标和可用的政策 URL。
接口
| 方法 | 路径 | 认证 |
|---|---|---|
GET | /v1/flights/airlines | 需要 API key |
| Header | 说明 |
|---|---|
Authorization | Bearer <secret_key>. The secret is shown only once when the credential is created. |
X-Travelandz-Id | <public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential. |
Content-Type | Use application/json for requests with a body. |
Request Parameters
不需要路径参数或查询参数。
请求体
不需要请求体。
成功响应
返回 airline ids, names, IATA codes, logos and policy URLs.
响应体结构
airlinesairlines[]idairlines[]nameairlines[]iata_codeairlines[]logo_symbol_urlairlines[]logo_lockup_urlairlines[]conditions_of_carriage_urlliveModeTrue when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.
集成说明
Airline metadata is source-backed and can vary by environment and enabled integrations.
示例
bash
curl https://api.sandbox.travelandz.com/v1/flights/airlines \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"响应
| 状态码 | 说明 |
|---|---|
200 | Airlines retrieved successfully. |
400 | 请求无效:payload 不合法。 |
401 | 未授权:凭证无效或缺失。 |
403 | 禁止访问:凭证无效。 |
500 | 服务器内部错误 |
200 响应体
媒体类型:application/json
json
{
"airlines": [
{
"logo_symbol_url": null,
"logo_lockup_url": null,
"conditions_of_carriage_url": null,
"iata_code": "12",
"name": "12 North",
"id": "arl_00009VME7DEWSV8v1yhJgK"
},
{
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/Q5.svg",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/Q5.svg",
"conditions_of_carriage_url": null,
"iata_code": "Q5",
"name": "40-Mile Air",
"id": "arl_00009VME7DAGiJjwomhv2x"
},
{
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/A3.svg",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/A3.svg",
"conditions_of_carriage_url": "https://en.aegeanair.com/conditions-notices/conditions-notices/",
"iata_code": "A3",
"name": "Aegean Airlines",
"id": "arl_00009VME7DAGiJjwomhv3K"
}
],
"liveMode": false
}