System Web Form Fields

    List System Web Form Fields

    Lists all system webform fields from the specified webform.

    Note: This operation does not support: pagination, filtering, or sorting parameters.

    Request

    • Method: GET
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /api/v1/admin/sites/[site_ID]/webforms/[webform_ID]/fields/system
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.
    • Accept header: application/xml or application/json

    Response

    An object with the following properties:

    • links - a collection of links (array)
      • self - the API URL that will return this result (string)
      • previous - the API URL that will return the previous page of results, if any (string)
      • next - the API URL that will return the next page of results, if any (string)
    • items - an array of Web Form objects with the following properties (array)
      • links - a collection of links (array)
        • self - the API URL that will return full details for this web form (string)
      • id - the ID of the web form field (integer) possible values are:
        • -2 - CustomerDetails
        • -3 - CustomerEmailAddress
        • -304 - WebFormSecurity
        • -10 - CustomerHomeAddress
        • -20 - CustomerHomePhoneNumber
        • -23 - CustomerHomeFaxNumber
        • -5 - CustomerUsername
        • -6 - CustomerPassword
        • -7 - CustomerDOB
        • -11 - CustomerWorkAddress
        • -21 - CustomerWorkPhoneNumber
        • -24 - CustomerWorkFaxNumber
        • -25 - CustomerWebAddress
        • -4 - CustomerCompanyDetails
        • -22 - CustomerMobilePhoneNumber
        • -500 - ReferAFriend
        • -31 - CustomerAnniversary2
        • -33 - CustomerAnniversary4
        • -34 - CustomerAnniversary5
        • -32 - CustomerAnniversary3
        • -30 - CustomerAnniversary1
        • -301 - PaymentMethodType
        • -302 - CreditCardPayment
        • -13 - CustomerBillingAddress
        • -40 - CustomerShippingDetails
        • -41 - CustomerShippingAttention
        • -12 - CustomerShippingAddress
        • -303 - CreditCardUpdate
        • -300 - CreditCardProcessing
        • -200 - FileAttachment
        • -403 - Recaptcha
        • -404 - RecaptchaV2
        • -402 - ImageVerificationV2Only
      • name - the name of the web form field (string)
      • type - an object of the field's type
        • id - the ID of the web form field type (integer)
        • name - the name of the web form field type (string)
      • mandatory - if the web form is mandatory set this to true (bool)
      • order - the order of the field in the web form (integer)

    Accepts and returns JSON or XML as Content-Type.


    Sample request

    GET /api/v1/admin/sites/1767665/webforms/10090/fields/system
    Authorization: 7e04176165cd4df7b628cc8ad022a8becf3bb84de44d480aadfae75e4fa07b56
    Content-Type: application/json

    Sample response

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
      "links": [
        {
          "rel": "self",
          "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system"
        },
        {
          "rel": "previous",
          "uri": null
        },
        {
          "rel": "next",
          "uri": null
        }
      ],
      "items": [
        {
          "links": [
            {
              "rel": "self",
              "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system/-2"
            }
          ],
          "id": -2,
          "name": "CustomerDetails",
          "type": {
            "id": -2,
            "name": "CustomerDetails"
          },
          "mandatory": true,
          "order": 1
        },
        {
          "links": [
            {
              "rel": "self",
              "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system/-3"
            }
          ],
          "id": -3,
          "name": "CustomerEmailAddress",
          "type": {
            "id": -3,
            "name": "CustomerEmailAddress"
          },
          "mandatory": true,
          "order": 2
        },
        {
          "links": [
            {
              "rel": "self",
              "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system/-20"
            }
          ],
          "id": -20,
          "name": "CustomerHomePhoneNumber",
          "type": {
            "id": -20,
            "name": "CustomerHomePhoneNumber"
          },
          "mandatory": true,
          "order": 3
        },
        {
          "links": [
            {
              "rel": "self",
              "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system/-11"
            }
          ],
          "id": -11,
          "name": "CustomerWorkAddress",
          "type": {
            "id": -11,
            "name": "CustomerWorkAddress"
          },
          "mandatory": true,
          "order": 4
        },
        {
          "links": [
            {
              "rel": "self",
              "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system/-402"
            }
          ],
          "id": -402,
          "name": "ImageVerificationV2Only",
          "type": {
            "id": -402,
            "name": "ImageVerificationV2Only"
          },
          "mandatory": true,
          "order": 8
        }
      ],
      "totalItemsCount": 5,
      "itemsPerPageCount": 1000,
      "currentPage": 1
    }

    Sample code

    var request = $.ajax({
        url: "/api/v1/admin/sites/1767665/webforms/10090/fields/system",
        type: "GET",
        headers: {
            "Authorization": $.cookie('access_token')
        },
        contentType: "application/json"
    });
    request.done(function (msg) {
        console.log('Request successful, response is: ')
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed. Error code: " + jqXHR.status);
    })

    Get System Webform Field Details

    Get details for a system webform field.

    Note: This operation does not support: pagination, filtering, or sorting parameters.

    Request

    • Method: GET
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /api/v1/admin/sites/[site_ID]/webforms/[webform_ID]/fields/system/[field_ID]
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.
    • Accept header: application/xml or application/json

    Response

    An object with the following properties:

    • links - a collection of links (array)
      • self - the API URL that will return full details for this web form (string)
    • id - the ID of the web form field (integer) possible values are:
      • -2 - CustomerDetails
      • -3 - CustomerEmailAddress
      • -304 - WebFormSecurity
      • -10 - CustomerHomeAddress
      • -20 - CustomerHomePhoneNumber
      • -23 - CustomerHomeFaxNumber
      • -5 - CustomerUsername
      • -6 - CustomerPassword
      • -7 - CustomerDOB
      • -11 - CustomerWorkAddress
      • -21 - CustomerWorkPhoneNumber
      • -24 - CustomerWorkFaxNumber
      • -25 - CustomerWebAddress
      • -4 - CustomerCompanyDetails
      • -22 - CustomerMobilePhoneNumber
      • -500 - ReferAFriend
      • -31 - CustomerAnniversary2
      • -33 - CustomerAnniversary4
      • -34 - CustomerAnniversary5
      • -32 - CustomerAnniversary3
      • -30 - CustomerAnniversary1
      • -301 - PaymentMethodType
      • -302 - CreditCardPayment
      • -13 - CustomerBillingAddress
      • -40 - CustomerShippingDetails
      • -41 - CustomerShippingAttention
      • -12 - CustomerShippingAddress
      • -303 - CreditCardUpdate
      • -300 - CreditCardProcessing
      • -200 - FileAttachment
      • -403 - Recaptcha
      • -404 - RecaptchaV2
      • -402 - ImageVerificationV2Only
    • name - the name of the web form field (string)
    • type - an object of the field's type
      • id - the ID of the web form field type (integer)
      • name - the name of the web form field type (string)
    • mandatory - if the web form is mandatory set this to true (bool)
    • order - the order of the field in the web form (integer)

    Accepts and returns JSON or XML as Content-Type.


    Sample request

    GET /api/v1/admin/sites/current/webforms/1767665/webforms/10090/fields/system/-400
    Authorization: 7e04176165cd4df7b628cc8ad022a8becf3bb84de44d480aadfae75e4fa07b56
    Content-Type: application/json

    Sample response

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": -400,
        "name": "[ImageVerification]",
        "type": {
            "id": -400,
            "name": "ImageVerification"
        },
        "mandatory": true,
        "order": 3
    }
    

    Sample code

    var request = $.ajax({
        url: "/api/v1/admin/sites/current/webforms/1767665/webforms/10090/fields/system/-400",
        type: "GET",
        headers: {
            "Authorization": $.cookie('access_token')
        },
        contentType: "application/json"
    });
    request.done(function (msg) {
        console.log('Request successful, response is: ')
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed. Error code: " + jqXHR.status);
    })

    Create System Field in Web Form

    Creates a new system field.

    Note: This operation does not support: pagination, filtering, or sorting parameters.

    Request

    • Method: POST
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /api/v1/admin/sites/[site_ID]/webforms/[webform_ID]/fields/system
      • Alternatively use "current" in place of site_ID for current login token's site
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.
    • Accept header: application/xml or application/json

    Parameters

    • type - field's type
      • id - the ID of the web form field type (integer) possible values are:
        • -2 - CustomerDetails
        • -3 - CustomerEmailAddress
        • -304 - WebFormSecurity
        • -10 - CustomerHomeAddress
        • -20 - CustomerHomePhoneNumber
        • -23 - CustomerHomeFaxNumber
        • -5 - CustomerUsername
        • -6 - CustomerPassword
        • -7 - CustomerDOB
        • -11 - CustomerWorkAddress
        • -21 - CustomerWorkPhoneNumber
        • -24 - CustomerWorkFaxNumber
        • -25 - CustomerWebAddress
        • -4 - CustomerCompanyDetails
        • -22 - CustomerMobilePhoneNumber
        • -500 - ReferAFriend
        • -31 - CustomerAnniversary2
        • -33 - CustomerAnniversary4
        • -34 - CustomerAnniversary5
        • -32 - CustomerAnniversary3
        • -30 - CustomerAnniversary1
        • -301 - PaymentMethodType
        • -302 - CreditCardPayment
        • -13 - CustomerBillingAddress
        • -40 - CustomerShippingDetails
        • -41 - CustomerShippingAttention
        • -12 - CustomerShippingAddress
        • -303 - CreditCardUpdate
        • -300 - CreditCardProcessing
        • -200 - FileAttachment
        • -403 - Recaptcha
        • -404 - RecaptchaV2
        • -402 - ImageVerificationV2Only
    • mandatory - if the web form is mandatory set this to true (bool)
    • order - the order of the field in the web form - if missing field is placed last in list (integer)

     

    Response

    Accepts JSON or XML as Content-Type.

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
      "links": [
        {
          "rel": "self",
          "uri": "https://api.worldsecuresystems.com/api/v1/admin/sites/1767665/webforms/10090/fields/system/-34"
        }
      ],
      "id": -34
    }

    Sample request

    POST /api/v1/admin/sites/current/webforms
    Authorization: 7e04176165cd4df7b628cc8ad022a8becf3bb84de44d480aadfae75e4fa07b56
    Content-Type: application/json
    

    Sample code

    var request = $.ajax({
        url: "/api/v1/admin/sites/1767665/webforms/10090/fields/system",
        type: "POST",
        headers: {
            "Authorization": $.cookie('access_token')
        },
        contentType: "application/json",
    	"processData": false,
        data: JSON.stringify({
            "type": {
    			"id": "-34"
    		},
    		"mandatory" : true
        })
    });
    request.done(function (msg) {
        console.log('Request successful, response is: ')
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed. Error code: " + jqXHR.status);
    })

    Update System Web Form Field

    Updates an existing system field.

    Request

    • Method: PUT
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /api/v1/admin/sites/[site_ID]/webforms/[webform_ID]/fields/system/[field_ID]
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.
    • Accept header: application/xml or application/json

    Parameters

    • mandatory - if the web form is mandatory set this to true (bool)
    • order - the order of the field in the web form (integer)

     

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts JSON or XML as Content-Type.

    HTTP/1.1 200 OK
    Content-Length: 0

    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/api/v1/admin/sites/1767665/webforms/10090/fields/system/-34",
        type: "PUT",
        connection: "keep-alive",    
        contentType: "application/json",headers: {
            "Authorization": $.cookie('access_token')
        },   
        processData: false,
    	data: JSON.stringify({
            "mandatory": false,
            "order": 21
        })
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });
        

    Delete System Web Form Field

    Delete system field from the web form.

    Request

    • Method: DELETE
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /api/v1/admin/sites/[site_ID]/webforms/[webform_ID]/fields/system/[field_ID]
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.
    • Accept header: application/xml or application/json
    DELETE /api/v1/admin/sites/1767665/webforms/10851/fields/system/-34 HTTPS/1.1
    Content-Type: application/json; charset=utf-8

    Response

    Returns an empty body if successful or a detailed error message.

    HTTP/1.1 200 OK
    Content-Length: 0

    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/api/v1/admin/sites/1767665/webforms/10090/fields/system/-34",
        type: "DELETE",
        connection: "keep-alive",    
        contentType: "application/json",headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });