Forms Endpoints

Get Form by ID


Get form details by its id

  • URL

    /api/v1/forms/{form_id}

  • Method:

    GET

  • Response Examples:

    • Code: 200
      Content:
{
    "error": 0,
    "msg": "OK",
    "errors": [],
    "data": {
        "form": {
            "id": 23,
            "owner_id": 1,
            "name": "test",
            "list_id": 16,
            "phone_number_list_id": 1,
            "json": "[]",
            "html": "<h1>test</h1><div class=\"rendered-form\"></div><form class=\"form-horizontal\" method=\"post\" action=\"https://sendiio.com/callbacks/subscription/lists\"><br><input type=\"email_name\" class=\"form-control\" id=\"email\" name=\"email\"  value=\"\" placeholder=\"Your email\" required><input type=\"hidden\" name=\"list\" id=\"list\" value=\"16\"><br><input type=\"text\" class=\"form-control\" id=\"number\" name=\"number\"  value=\"\" placeholder=\"Your phone number\" required><input type=\"hidden\" name=\"number_list\" id=\"number_list\" value=\"1\"><input type=\"hidden\" name=\"form\" value=\"23\"><br><button type=\"submit\" class=\"btn btn-default edit-form\" id=\"save_form\">Submit</button></form><br><br>",
            "callback": "http://test.com",
            "already_subscribed_callback": "http://test.com",
            "views": 2,
            "emails_lists_subscribes": 1,
            "phone_numbers_lists_subscribes": 2,
            "created_at": "2019-04-15 22:17:39",
            "updated_at": "2019-04-16 14:28:56"
        }
    }
}
  • Code: 404
    Content:
{
    "error": 1,
    "msg": "Error",
    "errors": [
        "Specified form id does not exist"
    ],
    "data": []
}

Get Forms


Get all forms belonging to the current user

  • URL

    /api/v1/forms

  • Method:

    GET

  • Response Examples:

    • Code: 200
      Content:
{
    "error": 0,
    "msg": "OK",
    "errors": [],
    "data": {
        "forms": [
            {
                "id": 23,
                "owner_id": 1,
                "name": "test",
                "list_id": 16,
                "phone_number_list_id": 1,
                "json": "[]",
                "html": "<h1>test</h1><div class=\"rendered-form\"></div><form class=\"form-horizontal\" method=\"post\" action=\"https://sendiio.com/callbacks/subscription/lists\"><br><input type=\"email_name\" class=\"form-control\" id=\"email\" name=\"email\"  value=\"\" placeholder=\"Your email\" required><input type=\"hidden\" name=\"list\" id=\"list\" value=\"16\"><br><input type=\"text\" class=\"form-control\" id=\"number\" name=\"number\"  value=\"\" placeholder=\"Your phone number\" required><input type=\"hidden\" name=\"number_list\" id=\"number_list\" value=\"1\"><input type=\"hidden\" name=\"form\" value=\"23\"><br><button type=\"submit\" class=\"btn btn-default edit-form\" id=\"save_form\">Submit</button></form><br><br>",
                "callback": "http://test.com",
                "already_subscribed_callback": "http://test.com",
                "views": 2,
                "emails_lists_subscribes": 1,
                "phone_numbers_lists_subscribes": 2,
                "created_at": "2019-04-15 22:17:39",
                "updated_at": "2019-04-16 14:28:56"
            }
        ]
    }
}

Get Form by ID


Get form details by its id

  • URL

    /api/v1/forms/{form_id}/edit

  • Method:

    POST

  • Data Params

    Required:
    successfully_subscribed_url=[url]
    already_subscribed_url=[url]
    email_list_id=[url](required if phone_list_id is not supplied)
    phone_list_id=[url](required if email_list_id is not supplied)
    name=[string]

  • Response Examples:

    • Code: 200
      Content:
{
    "error": 0,
    "msg": "OK",
    "errors": [],
    "data": []
}
  • Code: 401
    Content:
{
    "error": 1,
    "msg": "Validation errors",
    "errors": [
        "Specified 'email_list_id' is invalid"
    ],
    "data": []
}

Delete Form by ID


Delete existing form by its id

  • URL

    /api/v1/forms/{form_id}/delete

  • Method:

    GET

  • Response Examples:

    • Code: 200
      Content:
{
    "error": 0,
    "msg": "OK",
    "errors": [],
    "data": []
}
  • Code: 404
    Content:
{
    "error": 1,
    "msg": "Error",
    "errors": [
        "Specified form id does not exist"
    ],
    "data": []
}