I tried to perform a GET but I see a mistake:

curl 
'https://admin.googleapis.com/admin/directory/v1/users?domain=domain.com&maxResults=2'
 
-H "Accept: application/json" -d 
'@client_secret_736031670052-10a798qi65utf44iah5bk3c3oeuf7a54.apps.googleusercontent.com.json'
 

{ 
 "error": { 
   "code": 401, 
   "message": "Request is missing required authentication credential. 
Expected OAuth 2 access token, login cookie or other valid authentication 
cre
dential. See 
https://developers.google.com/identity/sign-in/web/devconsole-project.";, 
   "errors": [ 
     { 
       "message": "Login Required.", 
       "domain": "global", 
       "reason": "required", 
       "location": "Authorization", 
       "locationType": "header" 
     } 
   ], 
   "status": "UNAUTHENTICATED", 
   "details": [ 
     { 
       "@type": "type.googleapis.com/google.rpc.ErrorInfo", 
       "reason": "CREDENTIALS_MISSING", 
       "domain": "googleapis.com", 
       "metadata": { 
         "service": "admin.googleapis.com", 
         "method": "ccc.hosted.frontend.directory.v1.DirectoryUsers.Insert" 
       } 
     } 
   ] 
 } 
}

On Monday, January 17, 2022 at 12:32:58 PM UTC-3 Emanuel Gonzalez wrote:

> Hello everyone, i am automating the creation of mail accounts in the 
> domain of the company where I work. I have read the following 
> documentation: 
> https://developers.google.com/admin-sdk/directory/v1/guides/manage-users
>
> In the IAM option ==> Service accounts I have generated a user with their 
> API key and API controls added a new client.
>
> I want to test the API and bring me all the company email accounts and in 
> the documentation I see the following example:
>
> GET https://admin.googleapis.com/admin/directory/v1/users ?domain=primary 
> <https://admin.googleapis.com/admin/directory/v1/users?domain=primary> 
> domain name&pageToken=token for next results page &maxResults=max number of 
> results per page &orderBy=email, givenName, or familyName 
> &sortOrder=ascending or descending &query=email, givenName, or 
> familyName:the query's value*
>
> I’ll use curl or httpie to bring me the API data, but I don’t know where 
> to find the header value called "Token"
>
> Need help to properly enable the use of the API? I don’t know how to 
> enable OAuth 2.0 authentication.
>
> Reegards,
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0fb26cb1-afe8-4533-9190-502d081fb814n%40googlegroups.com.
  • Go... Emanuel Gonzalez
    • ... Emanuel Gonzalez
      • ... Emanuel Gonzalez
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to