Cannot able to get Imps(last 30d) from an Active Ad

179 views
Skip to first unread message

Canvas AdOps

unread,
Jan 4, 2022, 9:23:49 AM1/4/22
to Google's Campaign Manager 360 API Forum
Hi Team,

Could you please help us with how to get the Imps(last 30d) properties from an active ad through API.


I have used the above endpoint but I didn't get those properties from the Response.

Thanks,


ads.JPG

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 5, 2022, 2:57:41 AM1/5/22
to adops-rpa...@canvasww.com, google-doubleclick-...@googlegroups.com
Hi Canvas,

Thank you for reaching out to us.

With regard to your concern, I'm afraid that the REST Resource: ads does not have Imps(last 30d) properties. However, if you want to get this data, we would recommend utilizing Campaign manager's report builder instead which you can also run via API as well.

Regards,
Google Logo
Teejay Wennie Pimentel
DCM API Team
 

 

ref:_00D1U1174p._5004Q2TnixM:ref

Canvas AdOps

unread,
Jan 11, 2022, 3:09:06 AM1/11/22
to Google's Campaign Manager 360 API Forum
Hi,

Thanks for the response.

How can I get these specific data Imps (last 30d) properties from the report via API, it asks report ID to get the properties. How can I generate the report ID?

Could you please guide me on this?

Thanks,
report.JPG

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 11, 2022, 4:59:32 AM1/11/22
to adops-rpa...@canvasww.com, google-doubleclick-...@googlegroups.com

Hello Canvas,

 

I'm Michael and I work along with Teejay, allow me to assist you from here.

 

The report ID will be generated upon the creation of the report through reports.insert method. Additionally, these are the lists of metrics, dimensions and filters you may add on your report.

 

Let us know should you have any other concern.

Regards,

Google Logo
Michael Angelo Legaspi
DCM API Team
 


ref:_00D1U1174p._5004Q2TnixM:ref

Canvas AdOps

unread,
Jan 12, 2022, 12:44:18 AM1/12/22
to Google's Campaign Manager 360 API Forum
Hi,

I could not understand, please let me know what will be the endpoint to get the Imps(Last 30d) which is available in the UI via API. I tried by using get ads, get placement and get creatives endpoint, Even then I could not able to get the Imps(Last 30d) properties value.

Please refer to the attachment


Thanks,

On Wednesday, January 5, 2022 at 1:27:41 PM UTC+5:30 dcmapi wrote:
1.png

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 12, 2022, 3:42:30 AM1/12/22
to adops-rpa...@canvasww.com, google-doubleclick-...@googlegroups.com

Hello Canvas,

 

Thank you for providing additional details.

 

I believe the entity you are trying to retrieve is only available at CM360 UI side. In API, these are the only entities available to be retrieved on a campaign level: https://developers.google.com/doubleclick-advertisers/rest/v3.5/campaigns#Campaign

 

On the other hand, you may try the previously suggested by my colleague to create the report via API and extract the data by filtering it by impressions within 30 days.

 

These are the list of API REST Resources you may use:

 

Let us know should you have any other concern.

Regards,

Google Logo
Michael Angelo Legaspi
DCM API Team
 


ref:_00D1U1174p._5004Q2TnixM:ref

Canvas AdOps

unread,
Jan 17, 2022, 5:25:40 AM1/17/22
to Google's Campaign Manager 360 API Forum
Hi,

I have created and run the report by filtering the metrics impressions last 30 days.

While getting the file using Report.file.get Method I got the below response.

{
  "kind": "dfareporting#file",
  "etag": "\"RvK3bBAIJV9G8AXCaaT8VyOinN4\"",
  "reportId": "909359500",
  "id": "3565921758",
  "lastModifiedTime": "1642409529000",
  "status": "REPORT_AVAILABLE",
  "fileName": "",
  "format": "CSV",
  "dateRange": {
    "kind": "dfareporting#dateRange",
    "startDate": "2021-12-18",
    "endDate": "2022-01-16"
  },
  "urls": {
    "browserUrl": "https://www.google.com/reporting/downloadFile?id=909359500:3565921758",
    "apiUrl": "https://www.googleapis.com/dfareporting/v3.5/reports/909359500/files/3565921758?alt=media"
  }
}

From the above response, I got the below urls.


browserUrl is used to download the file from the browser

On using apiUrl I got the error message on the browser. It asks the authentication credential. Attached the screenshot for your reference.

Could you please help us how to get the file details via API using apiUrl

Thanks,
Errormsg.JPG

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 18, 2022, 2:35:02 AM1/18/22
to adops-rpa...@canvasww.com, google-doubleclick-...@googlegroups.com

Hello Canvas,

 

Thank you for your response.

 

We do have a documentation for downloading the generated report files through browserUrl or apiUrl provided in the resource file, you may check it here.

 

Let us know should you have further concerns.

Regards,

Canvas AdOps

unread,
Jan 18, 2022, 3:54:19 AM1/18/22
to Google's Campaign Manager 360 API Forum
Hi,

I am trying to get a request from the below apiUrl in postman but it didn't work. It shows 400(BadRequest Error).


Could you please help regarding this?

Thanks,

badrequest.JPG

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 18, 2022, 5:10:09 AM1/18/22
to adops-rpa...@canvasww.com, google-doubleclick-...@googlegroups.com

Hello Canvas,

 

Thank you for responding back to us.

 

It looks like the url endpoint you are using to pull the report file details is missing its profile ID, hence you are getting a BadRequest Error. Please be informed that you must add the profile ID to the url endpoint and it should look like this: https://dfareporting.googleapis.com/dfareporting/v3.5/userprofiles/{profileId}/reports/{reportId}/files/{fileId} as indicated in the reports.files.get method.

 

Let us know should you have any other concern.

Regards,

Canvas AdOps

unread,
Jan 20, 2022, 5:24:01 AM1/20/22
to Google's Campaign Manager 360 API Forum
Hi,

I was creating the report using report.insert method in API Explorer and it creates the report.

Report Response:
{
  "kind": "dfareporting#report",
  "id": "910448271",
  "etag": "\"Mvfz3TZ0IlD8CZwiCQVeI1YO8-0\"",
  "lastModifiedTime": "1642668956000",
  "ownerProfileId": "5279470",
  "accountId": "9281",
  "name": "Test",
  "type": "STANDARD"
}

But I am trying to create the same report in postman and UiPath and it shows the below error.


Postman Response:
{
    "error": {
        "code": 403,
        "message": "Request had insufficient authentication scopes.",
        "errors": [
            {
                "message": "Insufficient Permission",
                "domain": "global",
                "reason": "insufficientPermissions"
            }
        ],
        "status": "PERMISSION_DENIED",
        "details": [
            {
                "@type": "type.googleapis.com/google.rpc.ErrorInfo",
                "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
                "domain": "googleapis.com",
                "metadata": {
                    "service": "dfareporting.googleapis.com",
                    "method": "ads.xfa.proto.rosyapi.templates.v3p5.DfareportingReports.Insert"
                }
            }
        ]
    }
} 

Could you please help us to find what is the procedure to create the report in postman or Uipath?

Is there am I missing any parameters in Endpoint?

Thanks,

DCM API (DoubleClick Campaign Mgr)

unread,
Jan 20, 2022, 10:44:01 PM1/20/22
to adops-rpa...@canvasww.com, google-doubleclick-...@googlegroups.com

Hello Canvas,

 

Thank you for your response.

 

It appears that you are having error due to authentication scopes. We do have a document where it indicates what kind of scope you would need depends on what you are trying to access, you may check it here: https://developers.google.com/doubleclick-advertisers/authorizing?hl=en

 

More specifically on your issue, you should have https://www.googleapis.com/auth/dfareporting as this is the required scope for reporting.

 

To check the scope of your token, you will need to use your refresh token to get a new access token, and then append the access token to the end of URL:  https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=

This will take you to a page with info about the access token, including its associated scopes. You will get the structure as below:

 

{
"issued_to": "#####",
"audience": "#####",
"scope": "#####",
"expires_in": #####,
"access_type": "offline"
}

 

If you are using the correct scope to make a reports.insert call, then scope in the above structure should include 'https://www.googleapis.com/auth/dfareporting'.

 

On a side note, it seems this is more on POSTMAN rather than anything specific to DCM API response issue, we would recommend to reach out directly to their support channel and ask for assistance with regards to building your request on their platform. You may use this link when reaching out to them, but if it does not work for you, feel free to look for an alternative contact as we do not have support knowledge for that platform.

Regards,

Reply all
Reply to author
Forward
0 new messages