Answers.Body: <p>I'm not sure what context you are doing this in, but since you are calling the API from php, you can pass in the param <code>'check_permissions' =&gt; FALSE</code> to bypass the ACLs for the logged in user. This is useful when you know you want to get something from the api that the logged in user wouldn't normally be able to access. Just be careful!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-22T15:01:08.037Z
Answers.Text: Setting `check_permissions` to `FALSE` does not work. I'm still getting error "API permission check failed for Event/get call; insufficient permission: require access CiviCRM and access CiviEvent and view event info" as guest.
Answers.UserDisplayName: Philipp Michael
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-11T13:57:36.850Z
Answers.LastActivityDate: 2017-08-11T13:57:36.850Z
Answers.UserDisplayName: Coleman
Body: <p>I'm trying to get participant info via CiviCRM API like this:</p>
  
  <pre><code>civicrm_api('Participant', 'get', 
     array(
        'version' =&gt; 3,
        'sequential' =&gt; 1,
        'contact_id' =&gt; $contact_id,
        'event_id' =&gt; $event_id
     )
  );
  </code></pre>
  
  <p>but get the following error: </p>
  
  <blockquote>
    <p>API permission check failed for Event/get call; insufficient permission: require access CiviCRM and access CiviEvent and view event info</p>
  </blockquote>
  
  <p>I need to allow <strong>unauthorized users</strong> to access CiviCRM ("<strong>Master control</strong> for access to the main CiviCRM backend and API") and CiviEvent ("<strong>Create events</strong>, view all events, and view participant records (for visible contacts)") to solve this. Aren't those permissions to extensive, just to get some info about a participant? Or am I doing something wrong?</p>
  
  <p>I'm using CiviCRM 4.7.23. I did not get this error in 4.7.14.</p>
  
  <p>EDIT: I do not have to set these permissons to create a participant via API (which is OK). So I think there is definitely something wrong here.</p>
  
Tags: <civievent><api><permissions>
Title: Why do I need so extensive permissions for getting event participant via API?
ThreadText: # Why do I need so extensive permissions for getting event participant via API?
  
  (Asked by: username_0 on 2017-08-11)
  
  I'm trying to get participant info via CiviCRM API like this:
  
  ```
  civicrm_api('Participant', 'get', 
     array(
        'version' => 3,
        'sequential' => 1,
        'contact_id' => $contact_id,
        'event_id' => $event_id
     )
  );
  
  ```
  
  but get the following error:
  
  > API permission check failed for Event/get call; insufficient permission: require access CiviCRM and access CiviEvent and view event info
  
  I need to allow **unauthorized users** to access CiviCRM ("**Master control** for access to the main CiviCRM backend and API") and CiviEvent ("**Create events**, view all events, and view participant records (for visible contacts)") to solve this. Aren't those permissions to extensive, just to get some info about a participant? Or am I doing something wrong?
  
  I'm using CiviCRM 4.7.23. I did not get this error in 4.7.14.
  
  EDIT: I do not have to set these permissons to create a participant via API (which is OK). So I think there is definitely something wrong here.
  
  **Tags:** civievent, api, permissions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-08-11. Score: 2
  
  I'm not sure what context you are doing this in, but since you are calling the API from php, you can pass in the param `'check_permissions' => FALSE` to bypass the ACLs for the logged in user. This is useful when you know you want to get something from the api that the logged in user wouldn't normally be able to access. Just be careful!
  
  > **Comments:**
  > **username_0**: Setting `check_permissions` to `FALSE` does not work. I'm still getting error "API permission check failed for Event/get call; insufficient permission: require access CiviCRM and access CiviEvent and view event info" as guest.  
  
  ---
  
  