Body: <p>This is the first time I have been trying to integrate with a CiviCRM instance. I have admin rights to the instance, however I am having issues getting the REST API to come back with any results. I am able to get back results using the <a href="https://my.sitename.com/civicrm/api4#/explorer//" rel="nofollow noreferrer">https://my.sitename.com/civicrm/api4#/explorer//</a> gui, however when I hit it via postman or curl I always get back</p>
  <pre><code>{&quot;values&quot;:[],&quot;entity&quot;:&quot;Contact&quot;,&quot;action&quot;:&quot;get&quot;,&quot;debug&quot;:null,&quot;version&quot;:4,&quot;count&quot;:0,&quot;countFetched&quot;:0}
  </code></pre>
  <p>Example curl</p>
  <pre><code>curl --location --request POST 'https://my.sitename.com/civicrm/ajax/api4/Contact/get' \
  --header 'X-Requested-With: XMLHttpRequest' \
  --header 'X-Civi-Auth: Bearer $MYAPIKEY' \
  --header 'X-Civi-Key: $SITEKEY' \
  --header 'Accept: application/json'
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-22T01:35:23.337Z
Comments.Text: Looks like the connection is successful but the user you are authenticating with does not have permission to view any contacts.
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-22T14:24:44.057Z
Comments.Text: This is where I am a little fuzzy about where using the developer api in the website vs the rest API works. I am signed into the website using the account that the token is assigned to, so I would expect to have the same permissions; that being said it appears that there is some other layer of permissions that is applied to the rest api that I don't understand.
Comments.UserDisplayName: Charles Todd
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-22T18:13:36.023Z
Comments.Text: Have you checked these docs? https://docs.civicrm.org/dev/en/latest/api/v4/rest/
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-22T20:48:30.997Z
Comments.Text: I have been reading this documentation, I think what is maybe hanging me up is line here
  
  
  For API keys and passwords, the user must have the matching permission (authenticate with api key or authenticate with password).
Comments.UserDisplayName: Charles Todd
Tags: <api><rest>
Title: Rest API shows no results
ThreadText: # Rest API shows no results
  
  (Asked by: username_0 on 2024-04-22)
  
  This is the first time I have been trying to integrate with a CiviCRM instance. I have admin rights to the instance, however I am having issues getting the REST API to come back with any results. I am able to get back results using the https://my.sitename.com/civicrm/api4#/explorer// gui, however when I hit it via postman or curl I always get back
  {"values":[],"entity":"Contact","action":"get","debug":null,"version":4,"count":0,"countFetched":0}
  
  Example curl
  curl --location --request POST 'https://my.sitename.com/civicrm/ajax/api4/Contact/get' \
  --header 'X-Requested-With: XMLHttpRequest' \
  --header 'X-Civi-Auth: Bearer $MYAPIKEY' \
  --header 'X-Civi-Key: $SITEKEY' \
  --header 'Accept: application/json'
  
  **Tags:** api, rest
  
  > **Comments:**
  > **username_1**: Looks like the connection is successful but the user you are authenticating with does not have permission to view any contacts.  
  > **username_0**: This is where I am a little fuzzy about where using the developer api in the website vs the rest API works. I am signed into the website using the account that the token is assigned to, so I would expect to have the same permissions; that being said it appears that there is some other layer of permissions that is applied to the rest api that I don't understand.  
  > **username_1**: Have you checked these docs? https://docs.civicrm.org/dev/en/latest/api/v4/rest/  
  > **username_0**: I have been reading this documentation, I think what is maybe hanging me up is line here   For API keys and passwords, the user must have the matching permission (authenticate with api key or authenticate with password).  
  
  ---
  
  ## 0 answers
  
  