Site owners can add forms to pages that allow their visitors to leave information, like their name and address, or to create surveys or polls.

Use the Form API to retrieve all forms for a site. Use the Form Entries API to view the actual entries from a given form.

Fields

The following table shows all fields that exist for this API and those that are returned when you retrieve a list. All fields are returned when you retrieve a single item.

Name Description Type List
site_id ID of a Weebly site, unique to the currently authenticated user​ string X
form_id Unique ID for a form string X
form_name The name given to a form when created string X
last_submitted Timestamp for the date of the last form submission. Unix GMT Timestamp X
submission_count The number of form submissions. string X
page_id A unique ID that represents the page containing the form. string X
site_title ​Title of the site that contains the form. string X
deleted Whether or not the form has been deleted.
Valid values are:
  • 1: true
  • 0: false
string X

GET
Retrieve a List of Forms

GET /v1/user/sites/{SITE_ID}/forms

Returns all forms for the given site.


scope: read:site

Query Parameters

Returned values are paginated. You can further filter results using these parameters:

Parameter Description Type
page Which page of results to return. Start is 1. integer
limit Number of results per page to return. Default is 25.
Max is 200.
integer
query Use to retrieve only forms that have a full-text match with the query string. string
filterby Field name to set a filter on. string
filterfor ​Value to search the filterby field for. string
sortby Field name to sort by string
sortdir Sort direction. Valid values are:
  • asc
  • desc
string

Example CURL request returning all forms:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/forms \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example filtered request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/forms?sortby=form_id&sortdir=asc \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

[
    {
        "site_id":"987654321",
        "form_id":"123456",
        "form_name":"Contact Form",
        "last_submitted":1453382915,
        "submission_count":"4",
        "page_id":"765432198",
        "site_title":"My Site",
        "deleted": "0"
    }
    {
        "site_id":"987654321",
        "form_id":"456789",
        "form_name":"RSVP Form",
        "last_submitted":1453374946,
        "submission_count":"8",
        "page_id":"76543321",
        "site_title":"My Site",
        "deleted": "0"
    }
]

GET
Retrieve Details for a Form

GET /v1/user/sites/{SITE_ID}/forms/{FORM_ID}

Returns all fields for the given form.


scope: read:site

Example CURL request:

curl --request GET \
--url https://api.weebly.com/v1/user/sites/987654321/forms/123456 \
--header 'accept: application/vnd.weebly.v1+json' \
--header 'content-type: application/json' \
--header 'x-weebly-access-token: [YOUR_TOKEN]"

Example response:

See Fields table. All fields for the form are returned.

{
    "site_id":"987654321",
    "form_id":"123456",
    "form_name":"RSVP Form",
    "last_submitted":1453374946,
    "submission_count":"8",
    "page_id":"7654321",
    "site_title":"My Site",
    "deleted": "0"
}

Help make these docs better!









Tags: