Hi,
Thank you for contacting the Ad Manager API support team.
To authenticate with the Ad Manager API, you can use either
Service account or
Web application OAuth2 authentication type. For adding a service account through the Ad Manager API, you can use the
createUsers() method in the
UserService to create a user with a required role based upon your requirements. You may get all roles in your network with the
getAllRoles() method. Please follow the steps outlined in the API
documentation to authenticate your Ad Manager API requests. Kindly note that the Ad Manager API doesn't use the API key for authentication. For more information on adding a service account user for the API access, I would recommend you to refer to this help center articles to
Add a service account user for API access.
As a next step, you can add the mentioned user account to "All Entities" teams. You can create teams and get information about all teams in your network using
TeamService.
From the
UserTeamAssociationService with
createUserTeamAssociations() method, you can add the mentioned account to the required teams. You may refer to the
help article to create and edit the Team permission. I would also suggest checking the
help article regarding Creating and editing user roles. You can check the
Java code sample of TeamService and all available
client libraries of the Ad Manager API.
To create and get the Client ID and Client Secret, please go through this
link in web application authentication. Here I am giving a link to
authorize requests which describes the process of getting
access token and you can also refer
here to get a refresh token. For more information, we recommend you to go through this
OAuth2.0 document and "
create authentication credentials" section in the
getStarted document in the
Google API Console Credentials page.
Hope this helps!
This message is in relation to case "ref:!00D1U01174p.!5004Q02tJItv:ref" (ADR-00239938)
Thanks,
![Google Logo](https://ci5.googleusercontent.com/proxy/9ju5nEgrbHdGK5lig8X4MQGTM97n8nSbSJ60DOc1vPdXe8gGNPklA-zA7hXOkDgnMgO9hHT2x1N3rPhJg-wqpPZKMcC8T4A2ylAWasD7e8BJotDEo7M=s0-d-e1-ft#https://www.gstatic.com/images/branding/product/1x/googleg_64dp.png) |
Ad Manager API Team |
![](https://ci4.googleusercontent.com/proxy/n_QwEgYMzXDsryDzGPnnmxI_AKlR4K2dwHwEtulqktOTtmvEf-GsE3R5dh2VExdSCEszJKYkpfklrGe-H6HVOPo_OSZNVw7qhv6OGj8sAMUT1Mo1aCOx9mVP6-u_Rjf93zZepjayIG4M0_eQ3C6qsxnbFEfJx7FGbqG6m8A3cOigPOHuQkm6Dpu_oXX48Ww=s0-d-e1-ft#https://google-dev-relations.my.salesforce.com/servlet/servlet.ImageServer?oid=00D1U000001174p&esid=0184Q00001PXmRB&from=ext)