Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

change api to v2 #16

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

change api to v2 #16

wants to merge 25 commits into from

Conversation

rams007
Copy link

@rams007 rams007 commented Dec 7, 2018

Hello. I update yours SDK to to work with the new version of API

@rams007
Copy link
Author

rams007 commented Dec 7, 2018

I also add new methods for auto targeting search terms.
based on this:

This is to notify you of a change to search-terms reporting for auto-targeted campaigns. Search-terms report for auto-targeted campaigns generated before 11/14/2018 can be accessed from the endpoint: /v2/sp/keywords/report Search-terms report for auto-targeted campaigns generated on-and-after 11/14/2018 can be accessed from the endpoint: /v2/sp/targets/report Use query-segmentation to retrieve a search-terms report. Example search-terms report request for auto-targeted campaigns created before 11/14/2018: POST /v2/sp/keywords/report { "segment":"query", "reportDate":"20181113", "metrics":"impressions,clicks,..." } Example search-terms report request for auto-targeted campaigns created on-and-after 11/14/2018: POST /v2/sp/targets/report { "segment":"query", "reportDate":"20181201", "metrics":"impressions,clicks,..." } Please let us know if you experience any problems retrieving search-terms reporting for auto-targeted campaigns after reviewing these instructions. Best regards, Amazon Advertising API

@sidrafarooq
Copy link

sidrafarooq commented May 27, 2019

@rams007

requestSnapshot doesn't need campaignType in v2

This should be
$client->requestSnapshot( "campaigns", array("stateFilter" => "enabled,paused,archived", "campaignType" => "sponsoredProducts"));

changed to
$client->requestSnapshot( "campaigns", array("stateFilter" => "enabled,paused,archived");

@ahmedfeki
Copy link

Thanks for the migration
just a small correction for your example for creating target clause

$res = $client->createTargetingClauses(array(array( "campaignId" => 215604220644776, "adGroupId" => 239844918051417, "expressionType" => "manual", "expression" => array( array( "type" => "asinSameAs", "value" => "B078W31JTN" ) ), "bid" => 1.0, "state" => "enabled" )));

the expression require 2 arrays
else you will get this error
"code":"422","details":"The server understood your request but was unable to process one or more parameters."

i'm writing the full error
because i'm sure someone coming from google with a little results and a hope to find a solution
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants