getAllForms
Get all form objects.
Description
This method retrieves all form objects from the API. It returns a Promise that resolves to an array of FormEntity objects. It returns a Promise that resolves to an IFormsEntity[] object.
Forms.getAllForms(
langCode,
offset,
limit
);
Parameters schema
Schema
langCode: string
Language code. Default: "en_US"
example: "en_US"
offset: number
Parameter for pagination. Default: 0
example: 0
limit: number
Parameter for pagination. Default: 30
example: 30
By default, you can retrieve 10 objects. This is due to the record limit in the module's permissions settings.
For pagination to work correctly, you need to configure Module permissions according to your needs in the corresponding section.
Examples
Minimal example
const response = await Forms.getAllForms();
Example with attributes
const response = await Forms.getAllForms('en_US', 0, 30);
Example response
[
{
"id": 9,
"attributeSetId": 20,
"type": "sing_in_up",
"localizeInfos": {
"title": "Registration",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 0,
"position": 1,
"identifier": "reg",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "email_reg",
"isLogin": true,
"isSignUp": false,
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {
"emailInspectionValidator": true
},
"localizeInfos": {
"title": "email"
},
"additionalFields": [],
"isNotificationEmail": false,
"isNotificationPhoneSMS": null,
"isNotificationPhonePush": null
},
{
"type": "string",
"marker": "password_reg",
"isLogin": null,
"isSignUp": false,
"position": 2,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {
"requiredValidator": {
"strict": true
},
"stringInspectionValidator": {
"stringMax": 0,
"stringMin": 0,
"stringLength": 0
}
},
"localizeInfos": {
"title": "password"
},
"additionalFields": [],
"isNotificationEmail": false,
"isNotificationPhoneSMS": null,
"isNotificationPhonePush": null
},
{
"type": "string",
"marker": "name_reg",
"isLogin": null,
"isSignUp": true,
"position": 3,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"localizeInfos": {
"title": "name"
},
"additionalFields": [],
"isNotificationEmail": false,
"isNotificationPhoneSMS": null,
"isNotificationPhonePush": null
},
"..."
]
},
{
"id": 8,
"attributeSetId": 14,
"type": "order",
"localizeInfos": {
"title": "Order",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 1,
"position": 2,
"identifier": "orderForm",
"processingType": "script",
"templateId": null,
"attributes": [
{
"type": "string",
"marker": "order_name",
"isLogin": null,
"isSignUp": null,
"position": 1,
"settings": {},
"isVisible": true,
"listTitles": [],
"validators": {},
"localizeInfos": {
"title": "name"
},
"additionalFields": [],
"isNotificationEmail": null,
"isNotificationPhoneSMS": null,
"isNotificationPhonePush": null
}
]
},
{
"id": 10,
"attributeSetId": 16,
"type": "data",
"localizeInfos": {
"title": "Collection form ru_RU",
"titleForSite": "",
"successMessage": "",
"unsuccessMessage": "",
"urlAddress": "",
"database": "0",
"script": "0"
},
"version": 0,
"position": 3,
"identifier": "collection_form",
"processingType": "script",
"templateId": null,
"attributes": {}
},
"..."
]
Response schema
Schema: IFormsEntity[]
id: number
The identifier of the object.
example: 12345
attributeSetId: number | null
The identifier of the attribute set being used, or null if not applicable.
example: 1234
type: string | null
Form type.
example: "contact"
localizeInfos: ILocalizeInfo
The name of the form, taking into account localization.
example:
{
"key": "value"
}
version: number
The version number of the object.
example: 1
position: number
The position of the object.
example: 1
identifier: string
The textual identifier for the record field.
example: "form_contact_us"
processingType: string
Type of form processing.
example: "async"
templateId: number | null
The identifier of the template used by the form, or null if no template is used.
example: 6789
attributes: IAttributes[] | Record<string, any>
The attributes of the form, which can be an array of attribute objects or a record of key-value pairs.
example:
{
"key": "value"
}