Answers.Body: <p>In that case you will need to send api key of the logged in user who access is limited by ACL (also check_permission = 1 in api params). </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-16T09:51:53.563Z
Answers.Text: I tried but it gives me an error. 
  error_message: "Failed to authenticate key". I also provide a api key and site key then it gives me a error. error_message "ERROR: No CMS user associated with given api-key"
Answers.UserDisplayName: deepak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-16T09:56:39.763Z
Answers.Text: How to get api key of user?
Answers.UserDisplayName: deepak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-16T10:13:17.780Z
Answers.Text: this error occurs if the the logged user doesn't have api key. You need to have api key for all user. Api key is only required when using rest api
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-17T05:47:06.210Z
Answers.Text: How to get a user key using php?
Answers.UserDisplayName: deepak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-16T09:37:51.273Z
Answers.LastActivityDate: 2019-04-16T09:37:51.273Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I gave an ACL role to users for data segregation. I want to fetch data from database but data must filter i.e. ACL. How to get data. Also I want a userkey and sitekey? </p>
  
Tags: <api><extension><php>
Title: How to get a data for a perticular logged in user ( through API)?
ThreadText: # How to get a data for a perticular logged in user ( through API)?
  
  (Asked by: username_0 on 2019-04-16)
  
  I gave an ACL role to users for data segregation. I want to fetch data from database but data must filter i.e. ACL. How to get data. Also I want a userkey and sitekey?
  
  **Tags:** api, extension, php
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-16. Score: 1 | Accepted answer
  
  In that case you will need to send api key of the logged in user who access is limited by ACL (also check\_permission = 1 in api params).
  
  > **Comments:**
  > **username_0**: I tried but it gives me an error.  error_message: "Failed to authenticate key". I also provide a api key and site key then it gives me a error. error_message "ERROR: No CMS user associated with given api-key"  
  > **username_0**: How to get api key of user?  
  > **username_1**: this error occurs if the the logged user doesn't have api key. You need to have api key for all user. Api key is only required when using rest api  
  > **username_0**: How to get a user key using php?  
  
  ---
  
  