Body: <p>When using API4 endpoint <code>https://mysite/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/ajax/rest/MyExtensionEntity/get&amp;_authx=ABC1234&amp;_authxSiteKey=QWER1234</code>, I get redirected to a login page by WP when not logged in. If logged in, I would get <code>&quot;SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api3().&quot;</code> . In AuthX settings, HTTP Parameter credential include JWT, API Key.</p>
  <p>The Entity for API4 is using AbstractEntity. I am just using <code>get</code> action at the moment.</p>
  <p>The purpose of the endpoint is so external sites can get data. Is there any settings I can do allow the request.</p>
  <p>Edit:
  tried using <code>civicrm/ajax/api4/</code> instead. Response is <code>SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api4().</code></p>
  <p>Edit 2:
  I also tried adding Bearer, but prompts same error</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-22T16:01:00.250Z
Comments.Text: At the bottom here is a collapsed accordion with a tip: https://docs.civicrm.org/dev/en/latest/framework/authx/#settings. If you do that and then it works, then it means your authx settings are the issue.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-12-23T13:00:29.933Z
Comments.Text: @Demerit Thank you. Will try.
Comments.UserDisplayName: david
Tags: <civicrm-entity><apiv4>
Title: API4 Endpoint for external request using GET
ThreadText: # API4 Endpoint for external request using GET
  
  (Asked by: username_0 on 2024-12-19)
  
  When using API4 endpoint `https://mysite/wp-admin/admin.php?page=CiviCRM&q=civicrm/ajax/rest/MyExtensionEntity/get&_authx=ABC1234&_authxSiteKey=QWER1234`, I get redirected to a login page by WP when not logged in. If logged in, I would get `"SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api3()."` . In AuthX settings, HTTP Parameter credential include JWT, API Key.
  
  The Entity for API4 is using AbstractEntity. I am just using `get` action at the moment.
  
  The purpose of the endpoint is so external sites can get data. Is there any settings I can do allow the request.
  
  Edit:
  tried using `civicrm/ajax/api4/` instead. Response is `SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api4().`
  
  Edit 2:
  I also tried adding Bearer, but prompts same error
  
  **Tags:** civicrm-entity, apiv4
  
  > **Comments:**
  > **username_1**: At the bottom here is a collapsed accordion with a tip: https://docs.civicrm.org/dev/en/latest/framework/authx/#settings. If you do that and then it works, then it means your authx settings are the issue.  
  > **username_0**: @username_1 Thank you. Will try.  
  
  ---
  
  ## 0 answers
  
  