Search code examples
google-api-ruby-client

Determining the parameters for "discovered_api"


This might be a really stupid question, but how do you determine the parameters to pass in the client "discovered_api" call? and then what is the executed "api_method"

For instance, I'm trying to call the Admin SDK Users List call which is "GET https://www.googleapis.com/admin/directory/v1/users".

There doesn't seem to be a clear way of extracting this from the API reference, or am I just looking in the wrong place?


Solution

  • I misunderstood the original question. I still think the other post is potentially valuable so I thought I'd add a new answer.

    I experimented a bit and this will display the Title, id and whether or not it is preferred. The ID has a colon which seems to be where you separate the first and second argument when calling discovered_api.

    puts "Title \t ID \t Preferred"
    client.discovered_apis.each do |gapi| 
      puts "#{gapi.title} \t #{gapi.id} \t #{gapi.preferred}"
    end