<< Back to Help Contents

Opportunity API Custom Fields

Data Reference

Custom field

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customField>
    <
id>1</id> <!-- integer -->
    <
tag>Staff</tag
    <
label>NI Number</label> <!-- required -->
    <
text>12345678</text> <!-- required for list or text custom fields -->
    <
date>2009-03-13T00:00:00Z</date
        <!-- 
required for date custom fieldtime ignored -->
    <
boolean>true</boolean> <!-- true false see help -->
</
customField

Custom field definition

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customFieldDefinitions size="5">
    <
customFieldDefinition>
        <
tag>Staff</tag> <!-- data tag name -->
        <
label>NI Number</label> <!-- custom field label -->
        <
type>Text</type> <!-- Text Date | List | Boolean -->
        <
options>^[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-DFM]{0,1}$</options>
        <!-- 
optional regular expression for text fields or semi-colon delimited list of options for lists -->
    </
customFieldDefinition>
    ...
</
customFieldDefinitions

View Custom Fields

GET /api/opportunity/{id}/customfield

List custom fields for a case. Note that boolean custom fields that have been set to false will not be returned.

Example response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customFields size="3">
    <
customField>
        <
id>1</id>
        <
tag>Staff</tag>
        <
label>NI Number</label>
        <
text>12345678</text>
    </
customField>
    <
customField>
        <
id>2</id>
        <
tag>Staff</tag>
        <
label>Start Date</label>
        <
date>2009-03-13T00:00:00Z</date>
    </
customField>
    <
customField>
        <
id>3</id>
        <
label>Send news letter</label>
        <
boolean>true</boolean>
    </
customField>
</
customFields

View Custom Field Configuration

GET /api/opportunity/customfield/definitions

List of available custom field configurations for opportunities.

Example response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customFieldDefinitions size="5">
    <
customFieldDefinition>
        <
tag>Staff</tag>
        <
label>NI Number</label>
        <
type>Text</type>
        <
options>^[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-DFM]{0,1}$</options>
    </
customFieldDefinition>
    <
customFieldDefinition>
        <
tag>Staff</tag>
        <
label>Start Date</label>
        <
type>Date</type>
    </
customFieldDefinition>
    <
customFieldDefinition>
        <
label>Birthday</label>
        <
type>Date</type>
    </
customFieldDefinition>
    <
customFieldDefinition>
        <
label>Operating System</label>
        <
type>List</type>
        <
options>Windows;Mac;Linux;Unix</options>
    </
customFieldDefinition>
    <
customFieldDefinition>
        <
label>Send news letter</label>
        <
type>Boolean</type>
    </
customFieldDefinition>
</
customFieldDefinitions

Add Custom Field

POST /api/opportunity/{kase-id}/customfield

When adding a custom field set the text of the label element to be the name of the custom field and optionally if you are adding a custom field for a data tag also set the text of the tag element to be the custom field name.

Populate the text of the appropriate value element <text /> for text and list custom fields, <date /> for date custom fields and <boolean /> for boolean custom fields.

Adding a boolean custom field with a false boolean value will have no effect.

Example request:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customField>
    <
tag>Staff</tag>
    <
label>Start Date</label>
    <
date>2009-03-13T00:00:00Z</date>
</
customField

Update Custom Field

PUT /api/opportunity/{kase-id}/customfield/{customfield-id}

Updating an existing boolean field to a value of false will delete the custom field from the contact, it will not be displayed on the next get.

Example request:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customField>
    <
date>2009-04-14T00:00:00Z</date>
</
customField

Delete Custom Field

DELETE /api/opportunity/{kase-id}/customfield/{customfield-id}

 

authored by Phillip.Haines, last updated on 2010-01-27

<< Back to Help Contents