目录

1、申请亚马逊开发者账号

1.1、登录/注册,进入页面,并点击右上角的登录

1.2、登录或者注册亚马逊开发者账号

1.3、新建security profile

1.3.1、在菜单栏找到 login with Amazon

1.3.2、create a new security profile

1.3.3、填写相关资料

1.3.4、保存成功后将会回到 login with Amazon 页面

1.3.5、回到亚马逊广告API的首页,填写右侧的相关信息

1.3.6、提交之后会有邮件通知你是否完成注册

2、创建 API 授权并且刷新令牌(Create API authorization and refresh tokens)

2.1、创建 authorization code

2.1.1、根据地区选择url

2.1.2、参数配置

2.1.3、进入2.1.2拼接的url,你就会被要求登录。这里会有两种情况

2.1.4、允许之后将会重定向到一个新的url。将当前的url里面的 code 参数保存下来。

2.2、Call the authorization URL to request authorization and refresh tokens

2.2.1、选择和2.1.1相同区域的url。

2.2.2、参数配置

2.2.3、请求header

2.2.4、请求token

2.2.5、返回栗子

2.2.6、刷新token

如有不对的地方,欢迎指出。共勉~!

问题集锦

Java 对接亚马逊广告API接口(Amazon AWS API) 第二章:沙盒测试


亚马逊广告官网: Amazon Advertising Advanced Tools Center

1、申请亚马逊开发者账号

官网教程: Amazon Advertising Advanced Tools Center

登录Amazon的常见问题(FAQ): Login with Amazon frequently asked questions (FAQ).

1.1、登录/注册,进入页面,并点击右上角的登录

亚马逊开发人员服务

1.2、登录或者注册亚马逊开发者账号

如果是注册账号。创建了一个新帐户之后,您将被重定向到开发人员注册页面。

1.3、新建security profile

1.3.1、在菜单栏找到 login with Amazon

1.3.2、create a new security profile

1.3.3、填写相关资料

1.3.4、保存成功后将会回到 login with Amazon 页面

这个页面将会显示security profile name 和 OAuth2 credentials 

OAuth2 credentials 包含 client ID client secret。将这两个信息保存起来。后面生成 token 的时候会用到。

1.3.5、回到亚马逊广告API的首页,填写右侧的相关信息

API | 亚马逊广告

====================== 注意要点 ====================================

1、在请描述计划的解决方案和功能(Comments)中可以指定

Data Provider
DSP 需求方平台
Sponsored Display 展示推广
Sponsored Brands 品牌推广
Sponsored Products 商品推广

If you are a direct advertiser, please submit your account type (ie. Seller, Vendor) and your merchant token or entity ID

如果您是直接广告主,请提交您的账户类型(即卖家、供应商)和您的卖家令牌或实体 ID

可以直接提供上述的相关信息,就不用管表单中的参数了。

2、What do you plan to manage with the API?

因为需要下载 Sponsored Products 的费用报告,所以这个地方要选择 Advertising API

==============================================================

1.3.6、提交之后会有邮件通知你是否完成注册

我们需要回答相关的问题完成注册。

1.3.6.1、第一封邮件。

Thanks for your interest in the Advertising API.

The API allows you to programmatically manage Sponsored Ads campaigns, ad groups, ads, keywords, bids, and budgets. In addition, detailed reporting allows you to pull performance data to analyze sales and investments.

To proceed with your request please reply to the following questions.

· How did you find out about the Amazon Advertising API

· Are you using Sponsored Ads already?

· Are you a seller or a vendor or a third party managing sellers or vendors?

· What solution are you trying to build/what process are you trying to automate?

· What is the target audience for your solution (e.g. are you planning to build an in-house solution to manage your Amazon Advertising campaigns? Do you plan to make the solution available to others?)

Best regards,
The Advertising API-Team

1.3.6.2、第二封邮件。

Thank you for providing more details about your request.

Could you please elaborate or provide us a detailed description of the solution you are trying to build?

This would help us to provide the best possible support.

Best Regards,

The Advertising API-Team

1.3.6.3、第三封邮件

大致是要求公司名、公司官网和邮箱必须使用相同的域名。

Hi,

Thanks for your interest in the Advertising API.

During registration, you provided a company name (XXXXXXXXXXX) that does not match your email domain (XXXX@outlook.com) or/ and website domain (www.amazon.com/shops/XXXXXXXX). We require consistent details (Company name, Email and Website URL) in order to proceed with your request.

Can you please provide us consistent details? For example, if your company name is “ABC”, then website has to be “ABC.com” then email has to be xyz@ABC.com

This information will help us to provide best possible support.

Best Regards,

The Advertising API-Team

==================== 2021-02-20 补充 ==========================

关于这个域名的问题。我是用中国公司去申请的,所以来回了多次这个问题的邮件。最终通过美国商标网证明了我公司是我公司

==============================================================

1.3.6.4、第四封邮件

会让我们选择即将使用的类型

Thanks for your interest in the Amazon Advertising API.​

Can you please specify which solution you are trying to build using our Advertising API?

  • Advertising API to manage Sponsored Ads: Amazon Advertising Advanced Tools Center
  • Data Provider API: Amazon Advertising Advanced Tools Center
  • DSP Reporting API: Amazon Advertising Advanced Tools Center

Best Regards,
The Advertising API Team​​​

1.3.6.5、第五封邮件

这一步似乎和Amazon Advertising Advanced Tools Center是一样的(即帐号使用的区域有哪些)。我们将NA, EU, and FE 这三个都回复过去即可。

Thanks for your interest in the Advertising API.

Which advertisers, in which regions, are requesting that you integrate with Amazon Advertising API for data providers? Are these existing Amazon DSP advertisers?

This information helps to provide the best possible support.

Best Regards,
The Advertising API Team​​​

1.3.6.6、第六封邮件

至此我们就已经通过了邮件的考验!

We are excited to invite you to use the Amazon Advertising API!

To get started, please do the following:

1.Make sure your developers or your technical team have read the Getting Started Guide and are aware of the API reference, which they will require to develop your integration.
 
2.As a first step, you will need to sign in to an existing Amazon Developer account or you can register a new account if you haven’t already done so. Please make sure to use this account for accessing the Amazon Advertising API.
Ø  To do this make sure to select “Sign In” in the top right hand corner of the website. There you can sign in with your existing account or create a new one.

3.Before you can register your application, you need to agree to the Amazon Advertising Data Provider agreement and to the Amazon Advertising API License Agreement found here. 
 
4.Once you have accepted the license agreement, select the application you wish to use to access the Amazon Advertising API.
 
A support account will be created for the email address used for this API invitation. Please reply to this email with the name and email address for any additional contacts who need an API support account. Registered accounts will receive direct alerts for issues impacting the API service and notification of product releases and features.

Please use your JIRA support account if you have any further questions/concerns with any of the above steps.

As a last step, we kindly ask you to fill out our feedback survey here to improve upon the API onboarding experience.

点击第三步链接后会出现下面的页面,至此帐号授权完成。

Bug

当你复制链接的时候,会发现链接长这样,OCID是空的。

https://advertising-api.amazon.com/apim/logIn?state={{OCID}}&locale=en_US

解决方法(Nowbe 提供)

将 OCID 替换成【卖家店铺ID】。

如果还不行,回邮件给亚马逊,说这个链接不行。他们会给你一个新的~

2、创建 API 授权并且刷新令牌(Create API authorization and refresh tokens)

官方教程: Amazon Advertising Advanced Tools Center

授权基于OAuth 2.0的规则

Audience Description
Advertiser A Seller Central or Amazon Advertising Console user that can create and manage advertising campaigns.
Advertising API Developer The owner of a Login with Amazon account that makes calls to the Amazon Advertising API directly, typically on behalf of an advertiser. An API developer typically requires permission - granted using Login with Amazon - from an advertiser to create and manage campaigns.

2.1、创建 authorization code

2.1.1、根据地区选择url

Region URL prefix
North America (NA) https://www.amazon.com/ap/oa
Europe (EU) https://eu.account.amazon.com/ap/oa
Far East (FE) https://apac.account.amazon.com/ap/oa

2.1.2、参数配置

Parameter Description
client_id The Client ID value that you retrieved in the prerequisites section of this document.
scope The OAuth 2.0 permission scope used to limit the application's access to an advertiser's account.
For the Sponsored Brands, Sponsored Display, and Sponsored Products APIs, set scope to cpc_advertising:campaign_management.
For the Data Provider API, set scope to advertising::audiences.
For the DSP API, set scope to advertising::campaign_management.
response_type The type of response. Always set to code.
redirect_uri The value from the Allowed Return URLs field, retrieved in the prerequisites section of this document.

e.g.以北美举例。

https://www.amazon.com/ap/oa?client_id=YOUR_LWA_CLIENT_ID&scope=advertising::campaign_management&response_type=code&redirect_uri=YOUR_RETURN_URL

============================ 注意要点 ===========================

这个链接相当于帐号授权了。我们需要到亚马逊后台去请求这个链接。一旦同意即完成亚马逊帐号对开发者帐号的授权。

注意:不要用你的 develop account 去登录通过授权,而是用 amazon account 去授权。

==================================================================

2.1.3、进入2.1.2拼接的url,你就会被要求登录。这里会有两种情况

非Data Provider API 使用你在 Login with Amazon 中注册的帐号
Data Provider API 使用你在additional setup steps for the Data Provider API中按不同区域申请的帐号。并且使用和当期url 相同区域的帐号登录

登录之后,直接点击允许(Allow)即可。

==================== 2020-08-12 添加 ==========================

拼接完成后请求出现这个bug。这是我们还没有通过亚马逊API申请。

============================================================

==================== 2021-02-20 添加 ==========================

通过邮件之后,再次测试。然而还是报错了... 但是这个bug还是很好处理的,只需要在对应位置添加上对应的回调URL就可以了。

在 Login With Amazon 里找到 web 设置,填上你的redirect_uri即可。可以填写亚马逊官网

============================================================

2.1.4、允许之后将会重定向到一个新的url。将当前的url里面的 code 参数保存下来。

Amazon.com

2.2、Call the authorization URL to request authorization and refresh tokens

2.2.1、选择和2.1.1相同区域的url。

Region Authorization URL
North America (NA) https://api.amazon.com/auth/o2/token
Europe (EU) https://api.amazon.co.uk/auth/o2/token
Far East (FE) https://api.amazon.co.jp/auth/o2/token

2.2.2、参数配置

Parameter Description
grant_type Must be authorization_code.
code The authorization code retrieved in 2.1.4.
redirect_uri One of the values from the consent privacy notice URL field. Recall that you retrieved this value in the prerequisites section of this document.
client_id The Client ID value that you retrieved in the prerequisites section of this document.
client_secret The Client Secret value that you retrieved in the prerequisites section of this document.

2.2.3、请求header

  • Content-Type:application/x-www-form-urlencoded
  • charset=UTF-8

2.2.4、请求token

curl  \
    -X POST \
    -H "Content-Type:application/x-www-form-urlencoded;charset=UTF-8" \
    --data "grant_type=authorization_code&code=AUTH_CODE&redirect_uri=YOUR_RETURN_URL&client_id=YOUR_CLIENT_ID&client_secret=YOUR_SECRET_KEY" \
    https://api.amazon.com/auth/o2/token

2.2.5、返回栗子

{"access_token": "","refresh_token": "","token_type": "bearer","expires_in": 3600
}
Field Description
access_token The authorization token.
refresh_token The refresh token.
token_type The type of OAuth 2.0 token. Always set to bearer.
expires_in The length of time until the authorization token expires, in seconds. token过期时间(秒)

Postman 测试

2.2.6、刷新token

curl \                                                                                                                                                        
    -X POST \
    -H "Content-Type:application/x-www-form-urlencoded;charset=UTF-8" \
    --data "grant_type=refresh_token&client_id=YOUR_CLIENT_ID&refresh_token=YOUR_REFRESH_TOKEN&client_secret=YOUR_CLIENT_SECRET" \
    https://api.amazon.com/auth/o2/token

Postman 测试

那么至此申请授权方面就已经完成了。接下来我会写第二章测试具体的API。

如有不对的地方,欢迎指出。共勉~!

问题集锦

问题 答案
亚马逊 MWS和AWS 开发者帐号是否通用 不通用,需要分别申请。
多个亚马逊卖家店铺是否需要申请多个开发者帐号 只需要申请一个,其他的通过授权即可。不同区域可通过不同的api区分区域。

Java 对接亚马逊广告API接口(Amazon AWS API) 第二章:沙盒测试

对接亚马逊 ads api( Amazon Advertising API) 第一章:申请授权相关推荐

  1. 亚马逊广告接口 amazon advert api 申请流程

    #亚马逊广告接口 amazon advert api 申请流程 官方文档 https://advertising.amazon.com/API/docs/en-us 申请连接 : https://ad ...

  2. 对接亚马逊 ads api( Amazon Advertising API) 第三章:对接 Sponsored Products

    目录 官方下载报告 demo 需求 对接 Sponsored Products 的 reports 报告 1. 获取 profileId 2. 请求 report 3. 获取 report 4. 获取 ...

  3. 亚马逊广告接口 amazon advertising

    亚马逊广告接口官方说明:https://advertising.amazon.com/API/docs/en-us/setting-up/account-setup 一:注册aws开发者账号 注册地址 ...

  4. 对接亚马逊 SP-API(Amazon Selling Partner API) 第四章:签名

    目录 1. 前提概要 2. Authorization 介绍 Python 版本完整案例 3. 拼接 Authorization Task 1: Create a canonical request ...

  5. 对接亚马逊 SP-API(Amazon Selling Partner API) 第一章:注册帐号

    目录 1. SP-API 基本介绍 1.1. 从 MWS 迁移到 SP-API 1.2. SP-API 开发者指南 1.3. MWS 与 SP-API 接口映射 1.4. SP-API 的站点 2. ...

  6. 对接亚马逊 SP-API(Amazon Selling Partner API) 第二章:授权

    目录 1. 授权销售伙伴 API 应用程序 1.1. Marketplace Appstore workflow 1.2. Website workflow(推荐使用) 1.3. 自行授权(仅限店铺本 ...

  7. 对接亚马逊 SP-API(Amazon Selling Partner API) 第三章:对接 SDK

    目录 必要条件 1. Generating a Java SDK with LWA token exchange and authentication 1.8. SwaggerToCL 结构. 1.9 ...

  8. 亚马逊国际获得AMAZON商品详情API,数据接口

    万邦亚马逊国际获得AMAZON商品详情 API 返回值说明 item_get-获得AMAZON商品详情 onebound.amazon.item_get 公共参数 请求地址: 跨境电商平台接口提供商 ...

  9. 亚马逊云科技Amazon S3存储与客户的“独家记忆”

    2023年3月14日是亚马逊云科技Amazon S3的17周岁生日,与这些宏大的.不可量化的概念与母题相比,Amazon S3更像是一位可靠的朋友.作为亚马逊云科技的众多服务中最热门的对象存储服务,1 ...

最新文章

  1. LightGBM模型_相关资料整理
  2. HDLBits 系列(40)如何写 TestBench 文件?
  3. Paper:论文解读《Adaptive Gradient Methods With Dynamic Bound Of Learning Rate》中国本科生提出AdaBound的神经网络优化算法
  4. 工作总结!日志打印的15个建议
  5. 有了C盘之后,添加另外一个磁盘的方法
  6. 巧用tab组件实现APP的布局效果
  7. Android解决异常apk on device '0292bea1': Unable to open sync connection!
  8. java解压zip文件程序_java 解压zip文件
  9. 6步学会VS封装DLL
  10. Windows Phone 7一周年生日
  11. Java基础continue语句
  12. 数据结构与算法学习笔记
  13. Avalondock 第二步 创建文档面板
  14. 人脸脸部识别技术_面部识别技术基础
  15. Tomcat启动时报错:A child container failed during start解决方案-clean
  16. 〖Python 数据库开发实战 - MongoDB篇②〗- Mac环境下的MongoDB数据库安装
  17. golang not enough arguments in call to uuid.Must have (uuid.UUID) want (uuid.UUID, error)
  18. R语言学习-基础篇1
  19. JS中findIndex方法的使用场景以及与find的差别
  20. 2022高处安装、维护、拆除考试题库模拟考试平台操作

热门文章

  1. JavaScript基础内功系列,这十篇文章里一定有你感兴趣的
  2. matlab万有引力模拟,测定“万有引力常量”的模拟实验(二)
  3. count(*)和count(1)的区别和性能分析
  4. 小程序分享带参数以及返回首页按钮
  5. PN通信组态(汇川变频器和S7-1200PN通信)
  6. 在Ubuntu平台上开发快递邮件查询Scope
  7. git 代码回滚 reset revert 详解 IDEA操作 4种reset区别
  8. 关于人生规划选择的一个哲理故事
  9. 一个IT人七次跳槽的十点经验总结:跳槽一定要谨慎
  10. 【只推荐一位Python大佬】 从程序员到创业者,再到自由职业