Coder Social home page Coder Social logo

Comments (8)

jbandhauer avatar jbandhauer commented on July 26, 2024

Works for me...

jband@ ~/looker/src/looker-sdk/shell (master)$ ruby shell.rb 
Connecting to Looker at 'https://localhost:19999/api/3.0/'
Looker is alive!
[1] pry(main)> sdk.user_credentials_email(9)
=> {:email=>"[email protected]",
 :created_at=>2014-02-28 11:05:10 -0800,
 :logged_in_at=>2015-09-08 12:00:15 -0700,
 :type=>"email",
 :is_disabled=>false,
 :password_reset_url=>nil,
 :url=>"https://localhost:19999/api/3.0/users/9/credentials_email",
 :user_url=>"https://localhost:19999/api/3.0/users/9",
 :can=>{}}

Please explain your problem a bit more, perhaps I can help.

from looker-sdk-ruby.

jgn avatar jgn commented on July 26, 2024

Ah - parameter on user_credentials_email. I thought it was a method off of a user.

from looker-sdk-ruby.

jgn avatar jgn commented on July 26, 2024
Connecting to Looker at 'https://localhost:19999/api/3.0/'
Looker is alive!
[1] pry(main)> sdk.user_credentials_email(3)
LookerSDK::NotFound: GET https://localhost:19999/api/3.0/users/3/credentials_email: 404 - Not found // See: http://docs.looker.com/
from /opt/boxen/rbenv/versions/1.9.3-p550/lib/ruby/gems/1.9.1/bundler/gems/looker-sdk-ruby-abff0fb200a4/lib/looker-sdk/response/raise_error.rb:15:in `on_complete'

from looker-sdk-ruby.

jgn avatar jgn commented on July 26, 2024

Bit more, just to show that there's a user with id = 3:

$ ruby shell.rb
Connecting to Looker at 'https://localhost:19999/api/3.0/'
Looker is alive!
[1] pry(main)> sdk.alive
=> 200
[2] pry(main)> sdk.user(3)
=> {:id=>3,
 :first_name=>"John",
 :last_name=>"Norman",
 :avatar_url=>
  "https://www.gravatar.com/avatar/b9f047098e4ffbbc812a9ca9caba82e6?s=156&d=mm",
 :url=>"https://localhost:19999/api/3.0/users/3",
 :can=>{}}

[3] pry(main)> sdk.user_credentials_email(3)
LookerSDK::NotFound: GET https://localhost:19999/api/3.0/users/3/credentials_email: 404 - Not found // See: http://docs.looker.com/
from /opt/boxen/rbenv/versions/1.9.3-p550/lib/ruby/gems/1.9.1/bundler/gems/looker-sdk-ruby-abff0fb200a4/lib/looker-sdk/response/raise_error.rb:15:in `on_complete'
[4] pry(main)>

from looker-sdk-ruby.

jgn avatar jgn commented on July 26, 2024

Maybe that user is an API user.

from looker-sdk-ruby.

jgn avatar jgn commented on July 26, 2024

The user is not an API user, but the user is a SAML user. Would that make this request return a 404?

from looker-sdk-ruby.

jbandhauer avatar jbandhauer commented on July 26, 2024

Yes. If the resource does not exist then you will get a NotFound. So, if the user exists, but has no credentials_email then the resource you are asking for does not exist. This makes sense if your user only has credentials_saml, for instance, Same thing if the user making the request does not have permissions to access the resource - which might be part of the issue here... We show all users a limited view of all other users: names, email, avatar_url. But, only admins and the self-same user can see all the info about a specific user.

from looker-sdk-ruby.

jgn avatar jgn commented on July 26, 2024

Very good.

The user is question was an API user, but did not have the admin role. I
added admin and it works now.

I think these constraints would be worthy for docs.

On Tue, Sep 8, 2015 at 9:37 PM, John Bandhauer [email protected]
wrote:

Yes. If the resource does not exist then you will get a NotFound. So, if
the user exists, but has no credentials_email then the resource you are
asking for does not exist. This makes sense if your user only has
credentials_saml, for instance, Same thing if the user making the request
does not have permissions to access the resource - which might be part of
the issue here... We show all users a limited view of all other users:
names, email, avatar_url. But, only admins and the self-same user can see
all the info about a specific user.


Reply to this email directly or view it on GitHub
#33 (comment)
.

John G. Norman • Chief Software Architect at Iora Health
http://www.iorahealth.com
Note: We’ve moved -- new address:
101 Tremont Street, 6th floor, Boston, MA 02108

from looker-sdk-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.