Answers.Body: <p>Certain field values are blocked through ajax call that includes from api explorer as well. The ajax call makes check permission to true by default and cannot be over-riden from api params. The result may vary incase calling from php or smarty</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-15T16:05:04.540Z
Answers.Text: When you say "blocked" do you mean that if I specify is_deleted as a return value and am using ajax api, then it's on purpose that it doesn't return any records? It's not a permissions issue - everything in this case is running as admin.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-14T10:32:04.870Z
Answers.LastActivityDate: 2021-12-14T10:32:04.870Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p><strong>Scenario</strong>:</p>
  <p>Contact id 2, is_deleted is set to 1. Permissions not an issue since running as admin and no acl's present.</p>
  <p><strong>Results</strong>:</p>
  <ul>
  <li><p>api3 explorer: Ask for return value &quot;contact is in trash&quot; which translates to <code>'return' =&gt; ['is_deleted']</code>, so in full <code>civicrm_api3('contact', 'get', ['id' =&gt; 2, 'return' =&gt; ['is_deleted']]);</code>. This returns 0 results in api3 explorer (which is wrong).</p>
  </li>
  <li><p>command line with cv: also no results</p>
  </li>
  <li><p>command line with cv but change is_deleted to contact_is_deleted: <code>civicrm_api3('contact', 'get', ['id' =&gt; 2, 'return' =&gt; ['contact_is_deleted']]);</code>. This does return results.</p>
  </li>
  <li><p>Seeing same on 5.35 and master. I don't remember having this issue before but maybe I never put it in the <code>return</code> clause. It does work as a &quot;where&quot; clause on the command line, e.g. <code>civicrm_api3('contact', 'get', ['id' =&gt; 2, 'is_deleted' =&gt; 1]);</code>, but not in api3 explorer.</p>
  </li>
  </ul>
  
Tags: <api>
Title: api3 and contact.is_deleted when using "return", and discrepancy between api explorer and php code?
ThreadText: # api3 and contact.is_deleted when using "return", and discrepancy between api explorer and php code?
  
  (Asked by: username_0 on 2021-12-13)
  
  **Scenario**:
  
  Contact id 2, is\_deleted is set to 1. Permissions not an issue since running as admin and no acl's present.
  
  **Results**:
  
  * api3 explorer: Ask for return value "contact is in trash" which translates to `'return' => ['is_deleted']`, so in full `civicrm_api3('contact', 'get', ['id' => 2, 'return' => ['is_deleted']]);`. This returns 0 results in api3 explorer (which is wrong).
  * command line with cv: also no results
  * command line with cv but change is\_deleted to contact\_is\_deleted: `civicrm_api3('contact', 'get', ['id' => 2, 'return' => ['contact_is_deleted']]);`. This does return results.
  * Seeing same on 5.35 and master. I don't remember having this issue before but maybe I never put it in the `return` clause. It does work as a "where" clause on the command line, e.g. `civicrm_api3('contact', 'get', ['id' => 2, 'is_deleted' => 1]);`, but not in api3 explorer.
  
  **Tags:** api
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-12-14. Score: 1
  
  Certain field values are blocked through ajax call that includes from api explorer as well. The ajax call makes check permission to true by default and cannot be over-riden from api params. The result may vary incase calling from php or smarty
  
  > **Comments:**
  > **username_0**: When you say "blocked" do you mean that if I specify is_deleted as a return value and am using ajax api, then it's on purpose that it doesn't return any records? It's not a permissions issue - everything in this case is running as admin.  
  
  ---
  
  