Answers.Body: <p>Turns out this was caused by some server settings by my hosting provider (apparently they did some changes to the firewall). They managed to fix it and it seems to be working fine. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-12T11:50:22.287Z
Answers.LastActivityDate: 2019-11-12T11:50:22.287Z
Answers.UserDisplayName: Marian Zastawny
Body: <p>When I run the API command (via CiviCRM API Explorer) to list all the "Mailing Lists" i.e.</p>
  
  <p><code>$result = civicrm_api3('Group', 'get', ['group_type' =&gt; "Mailing List"]);</code></p>
  
  <p>I get the full list of mailing list groups. However if I run the with "LIKE" filtering option instead of "=", i.e:</p>
  
  <p><code>$result = civicrm_api3('Group', 'get', ['group_type' =&gt; ['LIKE' =&gt; "Mailing List"],]);</code></p>
  
  <p>I don't get any results and the console suggests that i hit a <strong>403</strong> error, which indicates this is a permission problem. I am running this as an administrator so I should have full access to  the system.</p>
  
  <p>Any suggestions on how to address this issue are welcome.I am running CiviCRM 5.18.4 on Wordpress 5.2.4. </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-31T13:23:34.683Z
Comments.Text: in database 'group_type' stored the value of "Mailing List". if you want to use like operator, then try 
  'group_type' => ['LIKE' => "%2%"],
  
  2 is value of 'Mailing List', 
  1 is value of 'Access Control'
Comments.UserDisplayName: Sunil Pawar
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-01T15:45:04.817Z
Comments.Text: Curious as to why you would want to do a LIKE on group_type??  LIKE on a group name makes sense, or using IN with group_type.
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-03T20:49:50.717Z
Comments.Text: Thanks for the comments, however they don't really address the baseline issue. I do actually get 403 error for all "LIKE' tests for additional group parameters (type, name, etc.). The type is most important as it has been identified as the cause of the problem with listing recipient groups I reported as gitlab issue report: https://lab.civicrm.org/dev/mail/issues/54#note_25897 and here: https://civicrm.stackexchange.com/questions/33070/unable-to-load-the-recipients-group-when-sending-mailing-with-civimail
Comments.UserDisplayName: Marian Zastawny
Tags: <api><groups><permissions><mailing>
Title: Unable to list groups with CiviCRM API
ThreadText: # Unable to list groups with CiviCRM API
  
  (Asked by: username_0 on 2019-10-29)
  
  When I run the API command (via CiviCRM API Explorer) to list all the "Mailing Lists" i.e.
  
  `$result = civicrm_api3('Group', 'get', ['group_type' => "Mailing List"]);`
  
  I get the full list of mailing list groups. However if I run the with "LIKE" filtering option instead of "=", i.e:
  
  `$result = civicrm_api3('Group', 'get', ['group_type' => ['LIKE' => "Mailing List"],]);`
  
  I don't get any results and the console suggests that i hit a **403** error, which indicates this is a permission problem. I am running this as an administrator so I should have full access to the system.
  
  Any suggestions on how to address this issue are welcome.I am running CiviCRM 5.18.4 on Wordpress 5.2.4.
  
  **Tags:** api, groups, permissions, mailing
  
  > **Comments:**
  > **username_1**: in database 'group_type' stored the value of "Mailing List". if you want to use like operator, then try  'group_type' => ['LIKE' => "%2%"],  2 is value of 'Mailing List',  1 is value of 'Access Control'  
  > **username_2**: Curious as to why you would want to do a LIKE on group_type??  LIKE on a group name makes sense, or using IN with group_type.  
  > **username_0**: Thanks for the comments, however they don't really address the baseline issue. I do actually get 403 error for all "LIKE' tests for additional group parameters (type, name, etc.). The type is most important as it has been identified as the cause of the problem with listing recipient groups I reported as gitlab issue report: https://lab.civicrm.org/dev/mail/issues/54#note_25897 and here: https://civicrm.stackexchange.com/questions/33070/unable-to-load-the-recipients-group-when-sending-mailing-with-civimail  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-11-12. Score: 1
  
  Turns out this was caused by some server settings by my hosting provider (apparently they did some changes to the firewall). They managed to fix it and it seems to be working fine.
  
  
  ---
  
  