Google DFP API版本后更新



当Google更新API时,我在Google DFP API中面临问题。

我们已经使用Google DFP API版本" V201605"将DFP帐户数据获取到我们的网站中。现在,此API的最新版本为" V201702"。Google已从我们使用的列表中删除了API。

它会自动停止以获取 lineItem 和DFP API的其他服务,我们过去按照以下来获取,

$user = new DfpUser();
$user->LogDefaults();
$inventoryService = $user->GetService('InventoryService', 'v201605');
$lineItemService = $user->GetService('LineItemService', 'v201605');

在最新版本API中,Google完全更改了API代码的格式和结构。

我们需要重新启用旧的API版本,以便我们的代码可以像以前一样再次工作。

现在对此感到无助。

有人面临同样的问题吗?
期待回答。
预先感谢。

您可以像这样获取服务

$dfpServices = new DfpServices();
$session = new DfpSessionBuilder();
...do session handling...
$lineItemService = $dfpServices->get($session, LineItemService::class);

此时,所有功能都与以前相同,只需包装成类。

最新更新