> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CountFormSpamSubmissionReports

# Package: forms

# Namespace: FormSpamSubmissionReportService

# Method link: https://dev.wix.com/docs/api-reference/crm/forms/form-spam-submission-report-v4/count-form-spam-submission-reports.md

## Permission Scopes:
Read Submissions: SCOPE.DC-FORMS.READ-SUBMISSIONS

## Introduction

Counts the form spam submission reports of the specified forms.

Forms with no reports aren't included in the response.

---

## REST API

### Schema

```
 Method: countFormSpamSubmissionReports
 Description: Counts the form spam submission reports of the specified forms.  Forms with no reports aren't included in the response.
 URL: https://www.wixapis.com/form-spam-submission-report-service/v4/form-spam-submission-reports/count
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  formIds, namespace
 Method parameters: 
   param name: formIds | type: array<formIds> | description: IDs of the forms to count reports for. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: namespace | type: namespace | description: Namespace of the app that the forms belong to.  Currently supports `wix.form_app.form`, the namespace of the Wix Forms app. | required: true | validation: minLength 10, maxLength 50
 Return type: CountFormSpamSubmissionReportsResponse
  - name: formsSpamSubmissionReportsCount | type: array<FormSpamSubmissionReportsCount> | description: Number of form spam submission reports for each form.  
     - name: formId | type: string | description: Form GUID.  | validation: format GUID
     - name: totalCount | type: integer | description: Number of form spam submission reports for the form.  


```

### Examples

### Count spam submission reports of forms
The second form has no reports, so it isn't included in the response.

```curl
curl -X POST \
'https://www.wixapis.com/form-spam-submission-report-service/v4/form-spam-submission-reports/count' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "formIds": [
    "21bcb6c7-02b3-4ed1-b6db-7856094fac03",
    "6e1f3a5c-8b2d-4c7e-9a4f-1d3b5e7c9a26"
  ],
  "namespace": "wix.form_app.form"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.forms.formSpamSubmissionReports.countFormSpamSubmissionReports(formIds, namespace)
 Description: Counts the form spam submission reports of the specified forms.  Forms with no reports aren't included in the response.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  formIds, namespace
 Method parameters: 
   param name: formIds | type: array<array> | description: IDs of the forms to count reports for. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: namespace | type: string | description: Namespace of the app that the forms belong to.  Currently supports `wix.form_app.form`, the namespace of the Wix Forms app. | required: true | validation: minLength 10, maxLength 50
 Return type: PROMISE<CountFormSpamSubmissionReportsResponse>
  - name: formsSpamSubmissionReportsCount | type: array<FormSpamSubmissionReportsCount> | description: Number of form spam submission reports for each form.  
     - name: formId | type: string | description: Form GUID.  | validation: format GUID
     - name: totalCount | type: integer | description: Number of form spam submission reports for the form.  


```

### Examples

### Count spam submission reports of forms
The second form has no reports, so it isn't included in the response.

```javascript
import { formSpamSubmissionReports } from "@wix/forms";

async function countFormSpamSubmissionReports() {
  const response = await formSpamSubmissionReports.countFormSpamSubmissionReports(
    [
      "21bcb6c7-02b3-4ed1-b6db-7856094fac03",
      "6e1f3a5c-8b2d-4c7e-9a4f-1d3b5e7c9a26"
    ],
    "wix.form_app.form",
  );
}

/* Promise resolves to:
 * {
 *   "formsSpamSubmissionReportsCount": [
 *     {
 *       "formId": "21bcb6c7-02b3-4ed1-b6db-7856094fac03",
 *       "totalCount": 14
 *     }
 *   ]
 * }
 */

```

### countFormSpamSubmissionReports (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { formSpamSubmissionReports } from '@wix/forms';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { formSpamSubmissionReports },
  // Include the auth strategy and host as relevant
});


async function countFormSpamSubmissionReports(formIds,namespace) {
  const response = await myWixClient.formSpamSubmissionReports.countFormSpamSubmissionReports(formIds,namespace);
};
```

---