Closed matthew-r-clark closed 3 years ago
Hi @matthew-r-clark, could you please post the responses from the API, when you are hitting the API directly.
Ofc, please delete any sensitive data.
It looks like there is some undocumented data difference in these responses, potentially and our validator is missing that.
Thank you for following up, @moltar!
Here is the response that I'm getting from https://advertising-api.amazon.com/sb/campaigns
[
{
"name": "[brand] Store.Image",
"budget": 200.0,
"bidOptimization": true,
"portfolioId": --portfolioId--,
"adFormat": "productCollection",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210309",
"state": "enabled",
"servingStatus": "running",
"creative": {
"brandName": --brandName--,
"brandLogoAssetID": "amzn1.assetlibrary.asset1.edbceb790b7a538eb4ec2509b7e14fa5:version_v1",
"headline": --headline--,
"shouldOptimizeAsins": false,
"asins": [
"B07H8NS5MS"
],
"brandLogoUrl": --brandLogoUrl--
},
"landingPage": {
"pageType": "store",
"url": --landingPageUrl--
}
},
{
"name": "[brand] Store.Product",
"budget": 800.0,
"bidOptimization": false,
"bidMultiplier": -95.0,
"portfolioId": --portfolioId--,
"adFormat": "productCollection",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210312",
"state": "enabled",
"servingStatus": "running",
"creative": {
"brandName": --brandName--,
"brandLogoAssetID": "amzn1.assetlibrary.asset1.edbceb790b7a538eb4ec2509b7e14fa5:version_v1",
"headline": --headline--,
"shouldOptimizeAsins": false,
"asins": [
"B07H8NS5MS"
],
"brandLogoUrl": --brandLogoUrl--
},
"landingPage": {
"pageType": "store",
"url": --landingPageUrl--
}
},
{
"name": "[brand] Store.Image_DEV",
"budget": 50.0,
"bidOptimization": true,
"portfolioId": --portfolioId--,
"adFormat": "productCollection",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210402",
"state": "paused",
"servingStatus": "paused",
"creative": {
"brandName": --brandName--,
"brandLogoAssetID": "amzn1.assetlibrary.asset1.edbceb790b7a538eb4ec2509b7e14fa5:version_v1",
"headline": --headline--,
"shouldOptimizeAsins": false,
"asins": [
"B07H8NS5MS"
],
"brandLogoUrl": --brandLogoUrl--
},
"landingPage": {
"pageType": "store",
"url": --landingPageUrl--
}
},
{
"name": "Brand Video Campaign",
"budget": 40.0,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20200729",
"state": "paused",
"servingStatus": "paused",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.b93c1a17-d818-4eb3-90fd-3713580c7c5f"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Campaign - 9/23/2020 15:26:16",
"budget": 150.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20200923",
"state": "paused",
"servingStatus": "paused",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.18f85b0c-5c32-4320-9b58-d4aa9a252d1b"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Video",
"budget": 150.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210305",
"state": "paused",
"servingStatus": "paused",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.18f85b0c-5c32-4320-9b58-d4aa9a252d1b"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Video v2",
"budget": 200.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210319",
"state": "enabled",
"servingStatus": "running",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.65782f90-9b18-4400-9b09-45d22d7a2fb3"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Video v3",
"budget": 400.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210330",
"state": "enabled",
"servingStatus": "running",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.d0938098-2c53-4c53-84fe-d66e80564f57"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
}
]
:tada: This issue has been resolved in version 3.1.15 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@moltar, thank you so much for the quick response!
However, it appears after installing the updated package, the issue persists.
I was checking the request params within the scaleleap package and it appears it is sending the request to the wrong amazon api endpoint.
This is what I'm seeing in my console when I test it:
And this is what's in the amazon documentation:
I was checking the two amazon api endpoints directly to see what the difference in response data was.
I get this for https://advertising-api.amazon.com/v2/hsa/campaigns
:
[
{
"campaignId": --campaignId--,
"name": "[brand] Store.Image",
"budget": 200.0,
"budgetType": "daily",
"startDate": "20210309",
"state": "enabled",
"servingStatus": "running",
"spendingPolicy": "asap",
"portfolioId": --portfolioId--,
"bidOptimization": true
},
{
"campaignId": --campaignId--,
"name": "[brand] Store.Product",
"budget": 800.0,
"budgetType": "daily",
"startDate": "20210312",
"state": "enabled",
"servingStatus": "running",
"spendingPolicy": "asap",
"portfolioId": --portfolioId--,
"bidOptimization": false,
"bidMultiplier": -95.0
},
{
"campaignId": --campaignId--,
"name": "[brand] Store.Image_DEV",
"budget": 50.0,
"budgetType": "daily",
"startDate": "20210402",
"state": "paused",
"servingStatus": "paused",
"spendingPolicy": "asap",
"portfolioId": --portfolioId--,
"bidOptimization": true
}
]
And then this for https://advertising-api.amazon.com/sb/campaigns
(should be the same as what I sent previously):
[
{
"name": "[brand] Store.Image",
"budget": 200.0,
"bidOptimization": true,
"portfolioId": --portfolioId--,
"adFormat": "productCollection",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210309",
"state": "enabled",
"servingStatus": "running",
"creative": {
"brandName": --brandName--,
"brandLogoAssetID": "amzn1.assetlibrary.asset1.edbceb790b7a538eb4ec2509b7e14fa5:version_v1",
"headline": --headline--,
"shouldOptimizeAsins": false,
"asins": [
"B07H8NS5MS"
],
"brandLogoUrl": --brandLogoUrl--
},
"landingPage": {
"pageType": "store",
"url": --landingPageUrl--
}
},
{
"name": "[brand] Store.Product",
"budget": 800.0,
"bidOptimization": false,
"bidMultiplier": -95.0,
"portfolioId": --portfolioId--,
"adFormat": "productCollection",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210312",
"state": "enabled",
"servingStatus": "running",
"creative": {
"brandName": --brandName--,
"brandLogoAssetID": "amzn1.assetlibrary.asset1.edbceb790b7a538eb4ec2509b7e14fa5:version_v1",
"headline": --headline--,
"shouldOptimizeAsins": false,
"asins": [
"B07H8NS5MS"
],
"brandLogoUrl": --brandLogoUrl--
},
"landingPage": {
"pageType": "store",
"url": --landingPageUrl--
}
},
{
"name": "[brand] Store.Image_DEV",
"budget": 50.0,
"bidOptimization": true,
"portfolioId": --portfolioId--,
"adFormat": "productCollection",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210402",
"state": "paused",
"servingStatus": "paused",
"creative": {
"brandName": --brandName--,
"brandLogoAssetID": "amzn1.assetlibrary.asset1.edbceb790b7a538eb4ec2509b7e14fa5:version_v1",
"headline": --headline--,
"shouldOptimizeAsins": false,
"asins": [
"B07H8NS5MS"
],
"brandLogoUrl": --brandLogoUrl--
},
"landingPage": {
"pageType": "store",
"url": --landingPageUrl--
}
},
{
"name": "Brand Video Campaign",
"budget": 40.0,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20200729",
"state": "paused",
"servingStatus": "paused",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.b93c1a17-d818-4eb3-90fd-3713580c7c5f"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Campaign - 9/23/2020 15:26:16",
"budget": 150.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20200923",
"state": "paused",
"servingStatus": "paused",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.18f85b0c-5c32-4320-9b58-d4aa9a252d1b"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Video",
"budget": 150.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210305",
"state": "paused",
"servingStatus": "paused",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.18f85b0c-5c32-4320-9b58-d4aa9a252d1b"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Video v2",
"budget": 200.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210319",
"state": "enabled",
"servingStatus": "running",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.65782f90-9b18-4400-9b09-45d22d7a2fb3"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
},
{
"name": "Video v3",
"budget": 400.0,
"portfolioId": --portfolioId--,
"adFormat": "video",
"campaignId": --campaignId--,
"budgetType": "daily",
"startDate": "20210330",
"state": "enabled",
"servingStatus": "running",
"creative": {
"asins": [
"B07H8NS5MS"
],
"videoMediaIds": [
"amzn1.adex.media1.d0938098-2c53-4c53-84fe-d66e80564f57"
],
"type": "video"
},
"landingPage": {
"pageType": "detailPage",
"url": --landingPageUrl--
}
}
]
The incorrect endpoint is not returning any arrays, which seems to be the likely reason why we are receiving that original error message. Also fyi, I'm not sure how the scaleleap package determines the api version (v2
) and if this is always included, but if I try sending a GET request to https://advertising-api.amazon.com/v2/sb/campaigns
, it returns a NOT_FOUND error.
Also fyi, I'm not sure how the scaleleap package determines the api version (v2) and if this is always included, but if I try sending a GET request to https://advertising-api.amazon.com/v2/sb/campaigns, it returns a NOT_FOUND error.
Their API organization is a huge mess and the version is not always included.
So it all depends on which version of the API you are looking at.
It appears that SB has been switched to v3 already, and we do not have support for that.
There is the API version switch at the top left, if you want to see the old docs.
We don't have the capacity to add this at the moment. If you wish to create a PR and migrate to v3 of SB API, we'll happily accept it.
@moltar I get this for list campaigns? can we move the landingPage
attribute to partials instead of strict?
{
campaignId: ---campaignId-----,
name: ' ---campaign_name-----',
budget: 100,
budgetType: 'daily',
startDate: '20190612',
state: 'paused',
servingStatus: 'paused',
spendingPolicy: 'asap',
bidOptimization: true
},
@NishealJ sure, please send a PR. Thanks
I'm receiving the following error whenever requesting all campaigns for sponsored brands via:
new AmazonAdvertising(marketplace, auth).sponsoredBrandsCampaign.listCampaigns()
However, whenever I request all campaigns for sponsored products or sponsored displays, it works as expected.
For all three (brands, products, and displays), I've used the respective module's
listCampaigns()
method, which all seem to take optional arguments for filtering results. In my usage, I'm not passing an argument into any of thelistCampaigns()
calls.Here is a sample of the code which results in this error:
I also tried hitting the amazon advertising api directly (
https://advertising-api.amazon.com/sb/campaigns
) and successfully received the sponsored brands campaigns in the response body.