General

Forms

General Forms API documentation

Introduction

The forms API call is used to get forms stats and submissions from SwitchTransact.

Get Form List

This API will retrieve a list of all the forms.

Path
GET /forms/lists

Response:

{
    "status": true,
    "records": [
        {
            "public_id": "91c3203f7c63e4a6d5b7.......22c3203f7c63e4a6d522",
            "name": "My form name",
            "total_views": 45,
            "total_submissions": 35
        },
        ...
    ]
}

Error Response:

{
    "status": false,
    "error": "Not authorized to make this API call. Requesting Read on General."
}

When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys

Get Form Submissions

This API will retrieve the form submissions from a specific form.

Path
GET /forms/submissions/{public_id}

Response:

{
    "status": true,
    "records": [
        {
            "73995349244": {
                "name": "people.surname",
                "value": "Prinsloo"
            },
            ...
        },
        ...
    ]
}

The records will be in the format:

{
  "field_id": {
      "name": "field_name",
      "value": "field_value"
  },
  ...
}

Error Response:

{
    "status": false,
    "error": "Not authorized to make this API call. Requesting Read on General."
}

When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys


Copyright © 2024 SwitchTransact