OAuth User resource API?

jyuanjyuan Member Posts: 7
Hi there, how can I get the current OAuth2 authenticated user information?  I tried using Account API and it gives me the current Account ID.  While it can work for some situations, but it's not a true user principal.  I tried to use Employee, but it lists all of the employees.  

Is there a unpublished User api?

5 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 569 moderator
    @jyuan could you explain what you mean by "current"? Do you mean someone who's simply using your app at any given time?

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • jyuanjyuan Member Posts: 7
    The "current user" logged in via Auth flow.  At the end of the flow when the authentication and authorization are successful the token and refresh token assigned are for a specific user in the lightspeed system.  What's the end point such that I can get the information on the user?
  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 569 moderator
    @jyuan could you explain why the Account endpoint doesn’t suffice?

    Once you have the access token that token will only ever related to one authenticated LightSpeed account. You also get the Shop name alongside the accountID

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • jyuanjyuan Member Posts: 7
    AccountID and ShopID are for specific LightSpeed Account of the shop/store.  But the employee id is the right level of resource for the context of the API access.  

    I want to track the user that was authenticated.
  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 569 moderator
    @jyuan A user/employee authenticates an accountID. That authentication enables the app to work with the account regardless of user who enabled it. The user that authenticated the app in the first place isn't exposed via the API. You'll have to manually navigate to Settings > Advanced Setup > API Client Access and look at the employee associated with the access/refresh token.

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.