Add a new custom field (POST)
The POSTcommand adds a new custom field by providing a custom field XML representation and content. To perform this procedure, you must have Operator-level access, or higher.
Command overview
Method — POST
Resource — customfield
Parameters
Parameter | Description | Example |
---|---|---|
usr 1 | A valid system user name (case sensitive) | usr=myUsername |
pwd 1 | The password that corresponds to the usr (user name) parameter (case sensitive) | pwd=myPassword |
tid | The transaction identifier (tid). You must specify the tid for all stateful operations. Do not include it in stateless operations. | tid=5456 |
1 This parameter is required.
Sample request
https://10.0.0.1/rest/configurationapi/customfieldapi/1.0/customfield?tid=4738&usr=jdoe&pwd=pa55w0rd
...
<customField active="true" entity="object" srcEntity="object" type="string" policy="first-non-null" export="x-custom-gzip" grammar="custom_gzip">
<name><![CDATA[Text Compression]]></name>
<description><![CDATA[Tracking all gzip text compression]]></ description>
<extractions>
<extraction>
<name><![CDATA[Text Objects]]></name>
<expression><![CDATA[(mime_type contains "text" ignorecase)]]></expression>
<source>
<sourceHTTPHeader origin="response" index="0" indexType="all" characterLimit="50">
<key><![CDATA[Content-Encoding]]></key>
</sourceHTTPHeader>
</source>
<transformations/>
</extraction>
</extractions>
</customField>
...
<customField active="true" entity="object" srcEntity="object" type="string" policy="first-non-null" export="x-custom-gzip" grammar="custom_gzip">
<name><![CDATA[Text Compression]]></name>
<description><![CDATA[Tracking all gzip text compression]]></ description>
<extractions>
<extraction>
<name><![CDATA[Text Objects]]></name>
<expression><![CDATA[(mime_type contains "text" ignorecase)]]></expression>
<source>
<sourceHTTPHeader origin="response" index="0" indexType="all" characterLimit="50">
<key><![CDATA[Content-Encoding]]></key>
</sourceHTTPHeader>
</source>
<transformations/>
</extraction>
</extractions>
</customField>
Sample Response
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status result="success"></status>
<result>
<customField id="44"/>
</result>
</response>
<response>
<status result="success"></status>
<result>
<customField id="44"/>
</result>
</response>
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*