连接到 Linkedin adAnalytics API - 参数中存在未经许可的字段字段、连接到、存在、参数

2023-09-08 08:55:20 作者:真心謊話

I am having trouble connecting to the LinkedIn AdAnalytics API. While using postman to test my connection - I receive the error:

{
    "serviceErrorCode": 100,
    "message": "Unpermitted fields present in PARAMETER: Data Processing Exception
                while processing fields [/daterange]",
    "status": 403
}

I can verify I have access. I am able to generate the access token with Oath 2.0 in postman. I used https://docs.microsoft.com/en-us/linkedin/marketing/getting-started to setup Oauth 2.0 access on postman and make sure I have the right permissions on my app. I am using the following scopes for my access.

r_organization_social, w_organization_social, rw_organization_admin,
rw_ads, r_ads_reporting, r_liteprofile
LinkedIn领英官方API接口文档说明 授权代码流程

Here is an example of using the V2 notation https://docs.microsoft.com/en-us/linkedin/shared/api-guide/concepts/protocol-version?context=linkedin/marketing/context:

Here is an example of using V1 notation https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting#sample-request.

Neither notation worked. I am very new to APIs so I am sure I am missing something, but I am unsure what it is.

解决方案

As you can see in the example, you can pass the dateRange values as single params in query string as follow:

CAMPAIGN&dateRange.start.day=1&dateRange.start.month=1&dateRange.start.year=2017&timeGranularity=DAILY

EDIT: Take care of use the camelCase version of the params name, in detail for dateRange: replace daterange with dateRange in all the occurrences and retry (I've replicated the error using the version in lowercase)

Hope this help