Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How to connect to Google Ad Manager API

Hello,

We would like to connect and fetch data from the Google Ad Manager API. Since there is no dedicated Matillion component for this purpose we have created an API Profile and would like to realize the authorization by using OAuth2.0. So far we have tried to pass the OAuth parameters by specifying those in the Parameter section as you can see in the attached screenshot "api_profile.png" but it failed due to a failed authorization (also visible in the attached screenshot).

Do you have any idea why it's failing or concrete tutorial that explains how to connect to the Google Ad Manager API?

Thanks in advance.

Best regards,
Gökhan

6 Community Answers

Goekhan Cimsir —

Unfortunately I could not find any option to attach files. If you need the metnioned attachments from my previous post please provide me an E-Mail address or any other option.


Matillion Agent  

Ian Funnell —

Hi Goekhan,

In general the way to get started with any API is with the following documents:

The main things you’ll need to have to hand are:

  • The addresses of the API endpoints
  • The API documentation concerning formats, authentication and paging (this will help you get the requests correct)
  • Ideally, some sample requests and responses (these will help you parse the responses correctly)

You’re right, there’s no way to add an attachment to a community message. If you need to send an attachment, please email directly to support@matillion.com

Best regards,
Ian


Goekhan Cimsir —

Hey Ian,

Thank you for your response and for highlighting the relevant documentation.

Although we've studied your referenced documentation we are still getting failures when connecting to our Google Ad Manager API.

Specifically we do not understand if we have to implement the OAuth2.0 flow manually when we want to create and connect to a custom API Profile.

One way we were thinking of is just to put the OAuth2.0 parameters such as OAuthClientId and OAuthCliendSecret in our custom API profile parameters but this did not work since it results in an authorization failed error response.

On the other hand we could try to create different rsd-files in our API-Profile that could deal with the single steps of an OAuth2.0 process such as

1. requesting the auth code
2. exchanging code for token etc.

The third option we can think of is to somehow link our API profile with the Matillion Manage OAuth configuration but here we would not know how to do so.

Is there any recommended way to authenticate/authorize a custom API Profile with OAuth2.0.

Best regards,
Gökhan


Matillion Agent  

Ian Funnell —

Hi Gökhan,

Matillion’s API Query component does not support OAuth in a single operation. Instead two steps are necessary:

  1. You call the API’s authorization endpoint, provide the ClientId and the Secret, and receive back a bearer token.
  2. You use the bearer token when calling any of the ordinary API endpoints.

Our document on Obtaining an API token and passing it into a RSD script has an example which you can download and install into your own environment in order to take a closer look at how those two steps could be implemented. It’s not specific to Google Ad Manager but does demonstrate how to split the problem into two parts.

Best regards,
Ian


Goekhan Cimsir —

Hey Ian,

Thank you for the referenced example. But even by following it we did not manage to authorize successfully with the Google Ad Manager API. In the example there seems to be a missing step at the beginning of the OAuth Flow that is required to correctly authorize with Google API.

In the first step it is needed to request an Authorization Code that is later exchanged for a Bearer Token by calling the /token endpoint as described here (Step 1: Set authorization parameters):

https://developers.google.com/identity/protocols/OAuth2WebServer

In your referenced example the first request goes directly to the /token endpoint. Is there any example or guidance that we can follow to realize the first step in the Google OAuth process?

Best regards,
Gökhan


Matillion Agent  

David Lipowitz —

Hi Gökhan,

When you say

we did not manage to authorize successfully with the Google Ad Manager API

Is there an error that resulted from that attempt? Were you able to set up an RSD file to access the token generating endpoint as described here: Obtaining an API token and passing it into a RSD script.

That would be the first step to get working and then you can build on that move to subsequent steps.

Best Regards,
Dave

Post Your Community Answer

To add an answer please login