DFA API Authentication

429 views
Skip to first unread message

tyriek.mcd...@gmail.com

unread,
Nov 4, 2013, 11:21:58 AM11/4/13
to google-doubleclick-...@googlegroups.com
**Disclaimer**
This is my first time using the DFA API. 
------------------------------------------------------------

I'm trying to pull data such as CTR and Ad Spend and a few other metrics with PHP, so I downloaded the not-so-complete php toolkit but when i put my DFA username and password into the Authenticate.php file and try to auth, i get error "4- wrong username or password"

I got confirmation that I have access to the API from the support email but I'm not getting very far. I never got a API Key to use, and I'm not really sure where to get one from. It was my understanding that I would get an api key for the session after authenticating. 

Any help would be greatly appreciated!

Jonathon Imperiosi (DFA API Team)

unread,
Nov 4, 2013, 1:30:58 PM11/4/13
to google-doubleclick-...@googlegroups.com
Hello!

As a first step, I'd suggest double checking the username and password that you're supplying. You should have a DFA user profile name and DFA API password, which is separate from your Google account name and password (unless you explicitly configured them to be the same). With this info, a call to login.authenticate will return a user profile token that can be used to make subsequent requests.

Regards,
- Jonathon Imperiosi, DFA API Team

tyriek.mcd...@gmail.com

unread,
Nov 19, 2013, 12:55:33 PM11/19/13
to google-doubleclick-...@googlegroups.com
Thanks for replying Jonathon!  I got a reply from a support rep saying that I had been granted access to the DFA API but I never setup a separate username and password for it. I'm not sure where to find or set that user/password. Am I missing something?

Jonathon Imperiosi (DFA API Team)

unread,
Nov 19, 2013, 2:32:39 PM11/19/13
to google-doubleclick-...@googlegroups.com
Hello,

To use the DFA API, you'll need API access enabled for both your DFA account, as well as for the user profile making requests. If you haven't yet created a user profile, you can find instructions for doing so here. There may also be some info you find useful in the getting started guide.

Cheers,
- Jonathon Imperiosi, DFA API Team

tyriek.mcd...@gmail.com

unread,
Nov 21, 2013, 12:52:11 PM11/21/13
to google-doubleclick-...@googlegroups.com
Looks like I have API access and my username and password are setup correctly. I'm using the PHP client that I found here Here and using "Authenticate.php" to try to login, but when I supply my user and pass I get the same error: "4 - Invalid username or password."

Is that client no longer working or am I missing something?

Jonathon Imperiosi (DFA API Team)

unread,
Nov 21, 2013, 2:09:15 PM11/21/13
to google-doubleclick-...@googlegroups.com
Hello,

Those PHP examples are a little outdated, we no longer support API v1.18. I quickly tested updating Authenticate.php to point to v1.19 of the API (just alter the URLs for loginWsdl and namespace) and it worked fine for me.

Please make sure you're passing in the username and password found on your user profile page in the DFA Trafficking site. To be clear, you need to supply the info displayed in the "Profile name" and "API password" fields. If you still run into trouble you can log the request and response that fail, and send them to the DFA API support email address listed on this page.

Cheers,
- Jonathon Imperiosi, DFA API Team

tyriek mcdaniel

unread,
Nov 21, 2013, 3:28:32 PM11/21/13
to google-doubleclick-...@googlegroups.com
Do you mind sending me the code that you used? (the authenticate.php file)


--
You received this message because you are subscribed to a topic in the Google Groups "Google's DoubleClick for Advertisers API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-doubleclick-for-advertisers-api/BgE0lJpd6Ao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-doubleclick-for-ad...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jonathon Imperiosi (DFA API Team)

unread,
Nov 21, 2013, 3:54:25 PM11/21/13
to google-doubleclick-...@googlegroups.com
Sure, you can find my modified file attached.

One thing I noticed while looking over this file is that it targets the test environment by default, rather than production. If your account was just recently granted API access, it may not be set up on test, yet. I went ahead and switched the URL to point at production, so you can see if that works out any better for you. 

Cheers,
- Jonathon Imperiosi, DFA API Team

To unsubscribe from this group and all its topics, send an email to google-doubleclick-for-advertisers-api+unsubscribe@googlegroups.com.
Authenticate.php

tyriek mcdaniel

unread,
Nov 21, 2013, 4:11:30 PM11/21/13
to google-doubleclick-...@googlegroups.com
Welll just my luck. It works now! I didn't know I needed to hit prod vs test in order to get this working.


To unsubscribe from this group and all its topics, send an email to google-doubleclick-for-ad...@googlegroups.com.

siva kumar reddy

unread,
Nov 22, 2013, 12:36:10 PM11/22/13
to google-doubleclick-...@googlegroups.com
Hello,

We are using the oauth 2.0 mechanism to grant access from users for dfa admin api. the authentication part is working fine with out any issues,

once the authentication part is completed, when we are trying to use any of the web service mehods, like getting the advertisers, all the web methods require username to be passed,

How can we get that username?

actually i am using the google user service to get the email address of the user authenticating and using that as username for google api methods. in some cases it is working fine, but in some cases if same username is there google is suffxing some number at the last.

say user is authenticatin x...@gmail.com, we are able to get the email and using that as username for dfa api methods, but it is not working, as google is suffxing some number like xyz2, xyz3,

how to get that usernames.

I am totally struck at this points

Thanks in adavnce.
Regards,
SB

Jonathon Imperiosi (DFA API Team)

unread,
Nov 22, 2013, 3:59:42 PM11/22/13
to google-doubleclick-...@googlegroups.com
Hello,

There are a number of ways to find your DFA username. Here are a few:

1. It is visible within the DFA Trafficking UI in the upper left hand corner of the page
2. It is returned by calling user.getUser or user.getUsersByCriteria, which are part of the DFA API
3. It is returned by calling UserProfiles.get or UserProfiles.list, which are part of the DFA Reporting API

Cheers,
- Jonathon Imperiosi, DFA API Team

Jonathon Imperiosi (DFA API Team)

unread,
Nov 22, 2013, 4:12:45 PM11/22/13
to google-doubleclick-...@googlegroups.com
Correction: user name is visible in the upper right hand corner of the DFA Trafficking API.

sivakumar reddy

unread,
Nov 24, 2013, 11:49:52 PM11/24/13
to google-doubleclick-...@googlegroups.com
Hello, Thanks for your quick reply,

1st method will not work for us, as we have to programatically retrieve the username from c#.net.
2nd method also will not work, as the given methods required username for the user object to retrieve the users.
         we are using the below method approach to retreive the web methods, first configuring the user for oauth, here itself we need the username
private void ConfigureUserForOAuth(OAuth2ProviderForApplications oAuth)
        {
            oAuth = RefreshAccessToken(oAuth, oAuth.UpdatedOn.ToString());
            dfaUser.OAuthProvider = oAuth;
            (dfaUser.Config as DfaAppConfig).DfaUserName = userName;
        }
       then calling the other methods,
    
            AdvertiserRemoteService service =                          (AdvertiserRemoteService)dfaUser.GetService(DfaService.v1_20.AdvertiserRemoteService);
                AdvertiserSearchCriteria searchCriteria = new AdvertiserSearchCriteria();
                searchCriteria.pageSize = maxPageSize;
                searchCriteria.searchString = "*";

  here for the above method we need to pass username for dfaUser object.

3rd method will get all the profiles, but we don't know at this time which advertiser user will select, and to get the advetisers again we need the username to retreive the advertisers.


If you have any other suggestions or a sample code, it will be very helpful for me.

Thanking you,
Regards,
SB


--

Jonathon Imperiosi (DFA API Team)

unread,
Dec 2, 2013, 8:40:11 AM12/2/13
to google-doubleclick-...@googlegroups.com
Hello,

Sorry for the delay. Could you please provide some more information about how you are authenticating users and retrieving refresh tokens?

Regards,
- Jonathon Imperiosi, DFA API Team

To unsubscribe from this group and all its topics, send an email to google-doubleclick-for-advertisers-api+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages