View And Add Fields

You can use the Bronto SOAP API to view and add new fields to your account. This example will print a list of all fields on your Bronto account, display a field count, and create a new select field.

Start Tutorial

Authenticate With Bronto

Before you can login using the API, you need to log into Bronto and set up your authentication and API access tokens. To do this:

  1. Go to Home->Data Exchange.
  2. Click Add Access Token.
  3. Make sure the token has Read, Write and Send permissions.
  4. Create API Session

    Use the access token you created to log in. The session ID created when you log into the API will expire if there is no transaction for a 20 minute period.

    Get a List of Bronto Fields

    Call readFields to return an array of all Bronto fields. Print out the field name and the field type.

    Get the Field Count

    Count the number of returned fields.

    Set Field Options

    Create three select options: green, blue, and red. Each option is stored in an array. The red select option is set as the default option.

    Build a Field Object

    Create an array that contains all of the field object parameters. This includes:

    • the name of the field
    • the label, which is the public-facing name of the field
    • the type of field
    • the visibility of the field (public or private). Private fields are visible only to you.
    • the field type - select box, checkbox, or radio button
    • Create the New Field

      Send the new field to Bronto with addFields. You need to include the parameter isVisibleInContactList. When isVisibleInContactList is true, the field is displayed in the contact list grid as a separate column and is available when creating a webform.

      Results

      If there were any problems, you will see a code exception.

      Otherwise, you will see a list of all of your fields and a field count. You also will have a new select field on your Bronto site with the name MY SELECT FIELD.

      Go to Contacts->Fields in Bronto to see the field. You can also use readFields to confirm the new field exists.