Section II – Functional Modules > Campaign Interface > Action Elements Bottom of Page
| Genesys 8.0 SCXML Technical Reference
< Parameter Elements

## Action Elements

The campaign calling list record control actions will be handled through the `<fetch>` action. The Outbound Contact Server campaign-related HTTP APIs will be mapped to the `<fetch>` attributes and child elements. See Outbound Contact 8.0 Reference Manual for the detailed specification of the interface (Chapter 3, "OCS Support for HTTP Protocol").

Important `<fetch>`-related usage notes with the Outbound Web 2.0 APIs:

- The method attribute value is always "post".
- The enctype attribute value is always "application/json".
- The type attribute value is always "application/json".
- The `<param>` name attribute is always "record".

The following is the general mapping to `<fetch>`, while the sub-sections are detailed mappings and examples for the functions that will be supported.

    <session:fetch requestid="_data.reqid"
    		srcexpr="'http://cvserver1.com/<resource>/<id>?req=actionx'"
    		method="post" type="application/json" enctype="application/json">
    	<param name="record" expr="_data.rmyrecord"/>
    </session:fetch>

`<resource>` can be:

- records — This contains the campaign records:

- `<id>` — This will be the ID of the record.

- phones — This is the phone number associated with a record or set of records:

- `<id>` — This will be the phone number.

- customer_ids — This is the customer ID associated with a record or set of records:

- `<id>` — This will be the customer ID.

#### Adding a New Record

This action adds a new record to an existing campaign's call list. This action covers the "Add_Record" IRD function block.

Elements:

- `Req = AddRecord`
- `<resource> = records`
- `<id> = recordid`

The following is an example of how to use the `<fetch>` element to add a new outbound record.

    <onentry>
    	<script>
    		Record = new Object();
    		Record.GSW_PHONE = "567567567545656";
    		Record.GSW_TZ_NAME = "'PST";
    		Record.GSW_CALL_RESULT = 28;
    		Record.STATUS_CODE = "New";
    		Record.CUSTOMER_STATUS = 5;
    		Record.GSW_CAMPAIGN = "New Productx";
    	</script>

    	<session:fetch
    			srcexpr="http://server1.genesyslab.com:8080/records/?req=AddRecord"
    			method="post" enctype=" application/json" type=" application/json">
    		<param name="record" expr="local.Record"/>
    	</session:fetch>
    </onentry>

#### Updating an Existing Record

This action updates an existing record in an existing campaign's call list. This action covers the "Update_Record" and "Reschedule" IRD function blocks.

Elements:

- `req = RecordReschedule` or `UpdateCallCompletionStats` or `RecordReject` or `RequestRecordCancel`
- `<resource> = records`
- `<id> = recordid`

The following is an example of how to use the `<fetch>` element to reschedule a record.

    <onentry>
    	<script>
    		Record = new Object();
    		Record.GSW_DATE_TIME = "10/12/2009";
    		Record.GSW_CAMPAIGN = "New Productx";
    	</script>

    	<session:fetch
    			srcexpr="http://server1.genesyslab.com:8080/records/123456?req=RecordReschedule"
    			method="post" enctype=" application/json" type=" application/json">
    		<param name="record" expr="local.Record"/>
    	</session:fetch>
    </onentry>

The following is an example of how to use the `<fetch>` element to UpdateCallCompletionStats for a record.

    <onentry>
    	<script>
    		Record = new Object();
    		Record.GSW_CAMPAIGN = "New Productx";
    	</script>

    	<session:fetch
    			srcexpr="http://server1.genesyslab.com:8080/records/123456?req=UpdateCallCompletionStats"
    			method="post" enctype=" application/json" type=" application/json">
    		<param name="record" expr="local.Record"/>
    	</session:fetch>
    </onentry>

The following is an example of how to use the `<fetch>` element to RecordReject a record.

    <onentry>
    	<script>
    		Record = new Object();
    		Record.GSW_CALLING_LIST = "First List";
    		Record.GSW_CAMPAIGN = "New Productx";
    	</script>

    	<session:fetch
    			srcexpr="http://server1.genesyslab.com:8080/records/123456?req=RecordReject"
    			method="post" enctype=" application/json" type=" application/json">
    		<param name="record" expr="local.Record"/>
    	</session:fetch>
    </onentry>

#### Reschedule an Existing Record

This action reschedules an existing record in an existing campaign's call list. This action covers the "Reschedule" IRD function blocks.

Elements:

- `req = RecordReschedule`
- `<resource> = records`
- `<id> = recordid`

The following is an example of how to use the `<fetch>` element to reschedule a record.

    	<onentry>
    	<script>
    		Record = new Object();
    		Record.GSW_DATE_TIME = "10/12/2009";
    		Record.GSW_CAMPAIGN = "New Productx";
    	</script>

    	<session:fetch
    			srcexpr="http://server1.genesyslab.com:8080/records/123456?req=RecordReschedule"
    			method="post" enctype=" application/json" type=" application/json">
    		<param name="record" expr="local.Record"/>
    	</session:fetch>
    </onentry>

#### Reject an Existing Record

This action rejects an existing record in an existing campaign's call list.

Elements:

- `req = RecordReject`
- `<resource> = records`
- `<id> = recordid`

The following is an example of how to use the `<fetch>` element to RecordReject a record.

    <onentry>
    	<script>
    		Record = new Object();
    		Record.GSW_CALLING_LIST = "First List";
    		Record.GSW_CAMPAIGN = "New Productx";
    	</script>

    	<session:fetch srcexpr="http://server1.genesyslab.com:8080/records/123456?req=RecordReject"
    			method="post" enctype=" application/json" type=" application/json">
    		<param name="record" expr="local.Record"/v
    	</session:fetch>
    </onentry>

#### Complete an Existing Record

This action completes an existing record in an existing campaign's call list. It covers the "Processed" IRD function block.

Elements:

- `req = RecordProcessed`
- `<resource> = records`
- `<id> = recorded`

The following is an example of how to use the `<fetch>` element to RequestRecordCancel a record.

    <onentry>
    	<session:fetch
    	srcexpr="http://server1.genesyslab.com:8080/records/123456?req=RequestRecordCancel"
    		method="post" enctype=" application/json" type=" application/json"/>
    </onentry>

#### Add the Customer to Do Not Contact List

This action completes an existing record in an existing campaign's call list and adds it to the do not contact list. This action covers the "Do Not Call" IRD function block.

Elements:

- ``req = DoNotCall``
- `<resource> = records`
- `<id> = recordid`

The following is an example of how to use the `<fetch>` element to RecordProcessed a record.

    <onentry>
    	<session:fetch
    		srcexpr="http://server1.genesyslab.com:8080/records/123456?req=DoNotcall"
    		method="post" enctype=" application/json" type=" application/json"/>
    </onentry>

Section II – Functional Modules > Campaign Interface > Action Elements Top of Page
| Genesys 8.0 SCXML Technical Reference
< Parameter Elements