Amazon Advertising API Scala Client Library
Base on : https://github.com/amzn/amazon-advertising-api-php-sdk
import AmazonAdvertisingApi._
val config: Config = Config(
"CLIENT_ID",
"CLIENT_SECRET",
"REFRESH_TOKEN",
REGION,
"VERSION",
SANDBOX
)
val client: Client = Client(config)
client.doRefreshToken
import play.api.libs.json.{JsValue, Json}
import java.time.LocalDate
import java.time.format.DateTimeFormatter
val reportDate: String = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))
val data: JsValue = Json.obj(
"reportDate" -> reportDate,
"metrics" -> "campaignName,campaignId"
)
val profileId: String = "123"
val response = client.requestReport("sp/campaigns", profileId, data).asString.body
client.getReportStatus(reportId, profileId)
client.getReportURL(s"reports/$reportId/download", profileId)