亚马逊-广告授权
亚马逊广告(Amazon Ads)店铺授权与管理技能,提供完整的授权流程、已绑定账号与站点的查询、令牌刷新与读取等能力。发起授权链接时需要先向用户确认一个账号名称;一次授权即可自动发现并绑定同账号下所有可用站点的广告 profile(每个站点对应一个 profileId)。当用户提到亚马逊广告授权、Amazon Ads 授权、绑定广告账户、刷新广告令牌、查询 profile 列表、管理已授权广告账户、Amazon Advertising authorization, Ads token refresh, list profiles, ad account management时触发此技能。即使未明确提及"Amazon Ads"或"授权",只要涉及亚马逊广告账号绑定、访问令牌管理或广告 profile 列表查询,也应触发。 Skill: 亚马逊-广告授权 Owner: linkfox-ai Summary: 亚马逊广告(Amazon Ads)店铺授权与管理技能,提供完整的授权流程、已绑定账号与站点的查询、令牌刷新与读取等能力。发起授权链接时需要先向用户确认一个账号名称;一次授权即可自动发现并绑定同账号下所有可用站点的广告 profile(每个站点对应一个 profileId)。当用户提到亚马逊广告授权、Amazon Ads 授权、绑定广告账户、刷新广告令牌、查询 profile 列表、管理已授权广告账户、Amazon Advertising authorization, Ads token refresh, list profiles, ad account management时触发此技能。即使未明确提及"Amazon Ads"或"授权",只要涉及亚马逊广告账号绑定、访问令牌管理或广告 profile 列表查询,也应触发。 Tags: lates
Rank
62
Safety
84
Downloads
1.6k
Updated
Oct 10, 2026
Version
1.0.7
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.6K downloadsadoption · observed Oct 10, 2026
- Latest release
- 1.0.7release · observed Aug 14, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-amazon-ads-auth- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-ads-auth/snapshot"
Documentation
CLAWHUB
89,922 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: linkfox-amazon-ads-auth
description: 亚马逊广告(Amazon Ads)店铺授权与管理技能,提供完整的授权流程、已绑定账号与站点的查询、令牌刷新与读取等能力。发起授权链接时需要先向用户确认一个账号名称;一次授权即可自动发现并绑定同账号下所有可用站点的广告 profile(每个站点对应一个 profileId)。当用户提到亚马逊广告授权、Amazon Ads 授权、绑定广告账户、刷新广告令牌、查询 profile 列表、管理已授权广告账户、Amazon Advertising authorization, Ads token refresh, list profiles, ad account management时触发此技能。即使未明确提及"Amazon Ads"或"授权",只要涉及亚马逊广告账号绑定、访问令牌管理或广告 profile 列表查询,也应触发。
---
# Amazon Ads 授权与广告账户管理
Amazon Ads 的授权(LWA OAuth)、profile 发现、访问令牌管理。**下游 skill 的前置依赖**。
下游:`linkfox-amazon-ads-manager`(广告管理)、`linkfox-amazon-ads-report`(报告)。
## Core Concepts
- **授权流程**:生成 URL → 用户浏览器授权 → 系统存 token + 同步 profile
- **一次授权多 profile**:每个 marketplace(US/UK/JP…)一个 profileId;下游调用必须带 profileId
- **accountName 必填**:调 `authorize_url.py` 前必须问用户要一个非空账号名
- **下游选店**:业务 skill 经 `developerProxy` 传 **`profileId`**(+ `region`),服务端注入 token;**勿**先 `storeTokens` 取 raw token
- **accessToken 1 小时有效**;过期后下游返回 HTTP 401,可用 `refresh_token.py` 续签(刷新后重试 proxy,仍只需 `profileId`)
## 可用脚本
| 脚本 | 作用 |
|------|------|
| `authorize_url.py` | 为新账号生成授权 URL(`accountName` 必填) |
| `authorized_stores.py` | 列出已授权的账号 × 站点(按 profileId 聚合) |
| `profiles.py` | 列 profile 列表(`refresh=true` 穿透上游刷新) |
| `refresh_token.py` | 刷新 accessToken |
| `store_tokens.py` | 查授权/令牌**状态**(非下游 token 来源) |
入参、响应字段、错误码见 `references/api.md`。
## 调用方式
- **API 端点**:`POST /amazonAds/{authorizeUrl|storeTokens|authorizedStores|refreshToken}`(完整参数/响应/错误码见 `references/api.md`)
- **Python 脚本**:`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`(可用脚本见上文)
- **成本约束**:本工具会消耗积分;失败/空结果不得自动连续试探;需要继续检索时先向用户说明会产生额外消耗。
**输出策略(脚本默认行为)**:
- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`(`<cwd>` 为脚本执行时的工作目录,在 Claude Code 里即当前项目目录;`<session>` 取自环境变量 `SESSION_ID`,按用户任务自动聚合;**禁止写入 /tmp**,当前目录不可写则报错)
- 响应体 ≤ 8 KB:落盘后把完整 JSON 打印到 stdout
- 响应体 > 8 KB:落盘后 stdout 只输出摘要(顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本)
- 加 `--inline` 强制全量打印到 stdout(同样落盘)
**读数据建议**:先看摘要判断是否足够;需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取,避免整份 JSON 进入上下文。
## 解决认证和积分问题
发生以下异常情况时,采用 references/onboarding.md 引导解决问题:
### 异常情况
- **未配置API Key**:环境变量未配置 `LINKFOX_AGENT_API_KEY`,也未配置 `LINKFOXAGENT_API_KEY`。
- **响应401或402状态码**
- **响应提示积分或余额不足**:消息含"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。
## 支持区域
`NA`(美加墨巴) / `EU`(英德法意西荷印度中东等) / `FE`(日澳新)。默认 `NA`。
## Usage Scenarios
### 1. 新授权账号
1. 问用户要 `accountName`(非空字符串,用于识别)
2. 调 `authorize_url.py` 拿 URL → 给用户在浏览器打开(安全警告:为保障店铺安全,请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权,切勿在陌生或公共网络下操作。)
3. 授权完成后系统自动存 token + 同步 profile
4. 可选:调 `authorized_stores.py` 确认
### 2. 列已授权账号
调 `authorized_stores.py`,展示 `profileId / accountInfoName / countryCode / region`。
### 3. 刷新过期令牌
下游返回 HTTP 401 或含 `expired` / `unauthorized` 时,调 `refresh_token.py`(传 `profileId` 或 `authRecordId`)。
### 4. 给下游准备 profileId(高频)
用户只说自然语言("美国站"、"我的店铺"),**不要让用户报 profileId 数字**。
下游 **`linkfox-amazon-ads-manager`** / **`linkfox-amazon-ads-report`** 调用 `developerProxy` _meta.json
{
"ownerId": "kn7dmc1t4j28hem1twwyav85p182pb1j",
"slug": "linkfox-amazon-ads-auth",
"version": "1.0.7",
"publishedAt": 1786718500645
}references/api.md
# linkfox-amazon-ads-auth — 参数与字段参考
Amazon Ads 授权、已授权账号列表、profile 管理、令牌读取与刷新。
下游实体查询见 `linkfox-amazon-ads-manager`;SP 报告见 `linkfox-amazon-ads-report`。
## 通用约定
- **Base URL**:`${LINKFOX_TOOL_GATEWAY}`
- **Method**:POST,`Content-Type: application/json`
- **Auth**:Header `Authorization: <api_key>`(读环境变量 `LINKFOX_AGENT_API_KEY`(优先)或 `LINKFOXAGENT_API_KEY`;如未配置 按 SKILL.md 的 **## 解决认证和积分问题** 处理)
## 关键 ID 关系
```
一次 OAuth 授权
▼
authRecordId (1 条) ← 与 accessToken/refreshToken 绑定
│
├──► profileId A (US) ─┐
├──► profileId B (CA) ├── 一次授权 → 多个 profile(每个 marketplace 一个)
└──► profileId C (MX) ─┘
```
- `authRecordId`:授权记录 ID,一次 LWA OAuth 对应一个
- `profileId`:业务操作单位;下游 skill 调用的核心参数
- `accountInfoId`:广告主 entity 级标识,跨 marketplace 稳定
## 接口
### 1. 生成授权 URL — `/amazonAds/authorizeUrl`
**Request**:
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `region` | string | 是 | `NA` / `EU` / `FE` |
| `accountName` | string | **是** | 非空字符串,用于在已授权列表识别 |
**Response**:
```json
{"authorizeUrl": "https://sellercentral.amazon.com/ap/oa?...", "sourceType": "amazon_ads"}
```
授权完成后 OAuth 回调由系统内部处理(存 token + 同步 profile),不作为公开接口。
---
### 2. 列已授权账号 — `/amazonAds/authorizedStores`
**Request**:无(用当前用户上下文)
**Response**:
```json
{
"total": 3,
"stores": [
{
"profileId": 1111111111,
"accountInfoId": "ENTITY1ABC",
"accountInfoName": "店铺 A",
"accountType": "seller",
"countryCode": "US",
"marketplaceStringId": "ATVPDKIKX0DER",
"region": "NA",
"authRecordId": 1001,
"accountName": "我的美国广告账号"
}
]
}
```
按 profileId 聚合(每个账号 × marketplace 一条)。
`accountType` ∈ `seller` / `vendor` / `agency`。
---
### 3. 列 profile — `/amazonAds/profiles`
**Request**:
| 参数 | 类型 | 必填 | 默认 | 说明 |
|------|------|------|------|------|
| `refresh` | boolean | 否 | false | true=穿透上游重新拉取并落库;false=读本地快照 |
**Response**:
```json
{
"total": 3, "refreshed": false,
"profiles": [{
"profileId": 1111111111, "region": "NA", "countryCode": "US",
"currencyCode": "USD", "dailyBudget": "100.00",
"timezone": "America/Los_Angeles",
"accountInfoId": "ENTITY1ABC", "accountInfoType": "seller",
"accountInfoName": "店铺 A",
"marketplaceStringId": "ATVPDKIKX0DER",
"authRecordId": 1001
}]
}
```
与 `authorizedStores` 区别:前者面向"选账号 × 站点"粗粒度;本接口含货币、时区、日预算等业务字段。
---
### 4. 刷新令牌 — `/amazonAds/refreshToken`
`accessToken` 1 小时有效;过期后下游返回 HTTP 401 或错误体含 `expired` / `unauthorized` / `access token`。
**Request**(`authRecordId` 和 `profileId` 二选一):
| 参数 | 类型 | 说明 |
|------|------|------|
| `authRecordId` | number | 授权主表 ID |
| `profileId` | number | 系统会反查到所属授权 |
**Response**:
```json
{
"authRecordId": 1001,
"accessToken": "Atza|IwEBI...", "refreshToken": "Atzr|IwEBI...",
"tokenType": "bearer", "expiresIn": "3600",
"message": "刷新成功"
}
```
---
### 5. 查询令牌 — `/amazonAds/storeTokens`
**Request**(二选一,同上):`authRecordId` 或 `profileId`。
**Response**:同 §4,少了 `message` 字段。
本接口**不触发刷新**,references/onboarding.md
# 解决认证和积分问题
调用本 skill 时若网关返回 **auth** 或 **billing** 错误,走本 skill 自带的 `scripts/onboarding.py` 完成引导。
**auth 场景**:`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`;或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。
1. 若已配置 key → 先让用户重启会话(最常见误判),仍失败让用户重新取 key 或换手机号重注册
2. 未配置 → 询问:自助去 https://agent.linkfox.com/ 取 key,或提供手机号让脚本注册
3. 手机号路径:
- `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements
- 收到验证码后:`python scripts/onboarding.py login <phone> <code>`(workbuddy 宿主加 `--channel workbuddy`)
- 拿到 `api_key` 后把下面三平台配置转发给用户,提示重启会话生效:
- Windows PowerShell(永久):`setx LINKFOX_AGENT_API_KEY "<key>"`
- macOS zsh:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.zshrc && source ~/.zshrc`
- Linux bash:`echo 'export LINKFOX_AGENT_API_KEY="<key>"' >> ~/.bashrc && source ~/.bashrc`
- 变量名 `LINKFOX_AGENT_API_KEY`(主推)或 `LINKFOXAGENT_API_KEY`(老规范)任一即可
**billing 场景**:`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。
- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单,否则输出编号清单让用户选
- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`(通常 `wechat/alipay`)
- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`(标注兜底)
- 已付款可选调 `python scripts/onboarding.py query <order_id>`,不主动轮询
排除 `errcode=403`(无权限,不归入这两类)。所有子命令输出 stdout JSON,`error` 字段已含阶段前缀,透传给用户即可。完整用法:`python scripts/onboarding.py --help`。skill-card.md
## Description: This skill helps agents create Amazon Ads authorization links, list authorized stores and profiles, and refresh or check token status for LinkFox-managed Amazon Ads accounts. This skill is ready for commercial/non-commercial use. ## Publisher: [linkfox-ai](https://clawhub.ai/user/linkfox-ai) ### License/Terms of Use: MIT-0 ## Use Case: External operators and ecommerce agents use this skill to connect Amazon Ads accounts to LinkFox, discover marketplace profiles, and keep authorization status usable for downstream ads management and reporting skills. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The skill requires a LinkFox API key and can route users through LinkFox account and billing flows. Mitigation: Install and use it only when the user intends to use LinkFox services, and do not submit phone codes or payment actions unless that action is expected. Risk: Amazon Ads account metadata and authorization URLs may be written to local LinkFox output folders. Mitigation: Review local LinkFox output folders after use and avoid sharing saved outputs that may contain account or authorization details. Risk: Custom gateway URL environment variables can change where requests are sent. Mitigation: Avoid custom gateway URL overrides unless the endpoint is trusted and intentionally configured. ## Reference(s): - [Amazon Ads API Reference](references/api.md) - [Authentication and Billing Onboarding](references/onboarding.md) - [Amazon Ads Console](https://advertising.amazon.com/) - [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-ads-auth) ## Skill Output: **Output Type(s):** [text, json, shell commands, configuration, guidance] **Output Format:** [Markdown guidance with JSON API and script outputs.] **Output Parameters:** [1D] **Other Properties Related to Output:** [Scripts persist full responses under a local linkfox session folder and may summarize large responses on stdout.] ## Skill Version(s): 1.0.7 (source: server release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-ads-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-ads-auth",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T07:50:33.013Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-ads-auth/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-ads-auth/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T07:50:33.013Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.6K downloads",
"href": "https://clawhub.ai/linkfox-ai/linkfox-amazon-ads-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/linkfox-amazon-ads-auth",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T07:50:33.013Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.7",
"href": "https://clawhub.ai/linkfox-ai/linkfox-amazon-ads-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/linkfox-amazon-ads-auth",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-14T14:41:40.645Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-ads-auth/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-ads-auth/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.7",
"description": "Update from 1.0.6 to 1.0.7",
"href": "https://clawhub.ai/linkfox-ai/linkfox-amazon-ads-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/linkfox-amazon-ads-auth",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-14T14:41:40.645Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
