APIs

This appendix covers the following topics:

Introduction

Oracle One-to-One Fulfillment is an automated way to send information to customers. It provides the ability to immediately satisfy a customer's requests for information, literature, and other correspondence or collateral. Customer service representatives handle a variety of requests ranging from product and service inquiries, pricing questions, billing inquiries and general customer care issues. Many of these requests result in distribution of literature, collateral, forms of application, letters or correspondence to the customer.

Oracle One-to-One Fulfillment provides the ability for interaction center administrators, mobile field representatives, marketing managers, customer care representatives and other service agents to respond to different customer needs quickly and easily by using email, fax or print channels.

PROCEDURE NAME DESCRIPTION
Start_Request Generates the history request identifier (x_hist_id), used as the tracking identifier for the fulfillment request.
Get_Content_XML Forms the <item> element of the XML request. You can call this API as many times as necessary.
Submit_Request Initiates the fulfillment request process.

Priority Levels

The following table lists the priority levels defined as global constants in package JTF_FM_REQUEST_GRP. The default is G_PRIORITY_REGULAR. Unused priority numbers are reserved for future use.

LEVEL NUMBER
G_PRIORITY_HIGHEST 1
G_PRIORITY_SPECIALITY_FLAG 6
G_PRIORITY_REGULAR 7

Interaction History Logging

One-to-One Fulfillment requests information can be logged in Interaction History Tables in the following ways:

Extended Headers

Extended Header information can be passed to the One-to-One Fulfillment Server using the (p_)extended_header parameter of the API. This is an optional parameter. If passed, the API expects this parameter in the XML format described in Extended Header XML Format. If any other format is used, the API will throw an error and the request will not be submitted.

Extended Header XML Format

<extended_header media_type="EMAIL">

<header_name>email_from_address</header_name>

<header_value>John.Doe@oracle.com</header_value>

</extended_header>

One-to-One Fulfillment Server recognizes the following sets of extended header parameters.

If any parameter other than those listed above are passed, the Fulfillment Server will put it into the header information.

Currently the media_type defaults to "EMAIL". If media_type is not set, then the Fulfillment Server will assume it to be EMAIL.

Sample Extended Header XML

<extended_header media_type="EMAIL">

<header_name>email_from_address</header_name>

<header_value>John.Doe@oracle.com</header_value>

<header_name>email_cc_address</header_name>

<header_value>Jane.Doe@oracle.com</header_value>

<header_name>email_bcc_address</header_name>

<header_value>xyz@oracle.com</header_value>

<header_name>sender_display_name</header_name>

<header_value>Jason.Doe</header_value>

</extended_header>

Start_Request

Call the Start_Request first to generate the history request identifier (x_request_id) that is used as the tracking identifier for the fulfillment request.

Procedure Specification

PROCEDURE Start_Request 
( p_api_version IN NUMBER, 
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, 
p_commit IN VARCHAR2 := FND_API.G_FALSE, 
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, 
x_return_status OUT VARCHAR2, 
x_msg_count OUT NUMBER, 
x_msg_data OUT VARCHAR2, 
x_request_id OUT NUMBER 
); 

Parameter Descriptions

The following table describes the IN parameters associated with the Start Request.

Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes This must match the version number of the API. An unexpected error is returned if the calling program version number is incompatible with the current API version number.
p_init_msg_list VARCHAR2 Yes Default = FND_API.G_FALSE. If set to true, then the API makes a call to fnd_msg_pub.initialize the message stack. If set to false, then the calling program must initialize the message stack. This action is required to be performed only once, even when more than one API is called.
p_commit VARCHAR2(1) No Default = FND_API.G_FALSE. If set to true, then the API commits before returning to the calling program. If set to false, then it is the responsibility of the calling program to commit the transaction.
p_validation_level NUMBER No This value determines whether or not validation should occur. This variable is checked against FND_API.G_VALID_LEVEL_NONE, and if it is greater than the latter, validation occurs.

Parameter Descriptions

The following table lists the OUT parameters associated with Request.

Parameter Data Type Description
x_return_status VARCHAR2 Indicates the return status of the API. The values returned are one of the following:
FND_API.G_RET_STS_SUCCESS:Success: Indicates that the API call was successful
FND_API.G_RET_STS_ERROR:Expected Error: There is a validation error, or missing data error.
FND_API.G_RET_STS_UNEXP_ERROR:Unexpected Error: The calling program can not correct the error.
x_msg_count NUMBER Holds the number of messages in the message list.
x_msg_data VARCHAR2 Holds the encoded message if x_msg_xount is equal to one.
x_request_id NUMBER The fulfillment request identifier. This can be used to track the status of the request.

Get_Content_Xml

Oracle does not recommend and does not support the creation of XML fulfillment requests by any other means than through these published APIs. Oracle provides this information on how the XML request is formed solely to facilitate understanding of the fulfillment request process.

Use the Get_Content_XML API to generate one, or more, XML <item> elements for a fulfillment request. The content is formed based on the parameters passed to the API, and the API returns the XML <item> as parameter x_content_xml.

The Get_Content_XML API performs that following tasks:

The Get_Content_XML API generates only one XML parameter for each API call. If you want to submit multiple content items for a single fulfillment request, then you must do the following:

The Submit_Request API takes this parameter and merges it with the XML request that it forms, submitting the complete request to the Request queue.

Content Source Parameter

New Parameter added in 11.5.9 when One-to-One Fulfillment started supporting both as Marketing Encyclopedia Systems (MES) and Oracle Content Management (OCM).

The Default Value assumed for this parameter is "mes". If GET_CONTENT_XML API is called without this parameter, the repository is assumed to be Marketing Encyclopedia Systems (MES).

From Release 11.5.9 onward, this API supports Oracle Content Management. The other valid value is "ocm".

From 11.5.10 release onward, this API supports the renditions available in Oracle Content Management.

One-to-One Fulfillment Request Types

Use one of the following content types (p_content_type) to create a valid fulfillment request.

If any other values are passed to it, the Get_Content_XML API exits with an unexpected error.

The following table lists example values for the p_content_id parameters used with query and collateral fulfillment requests.

Sample Parameter Values for Query and Collateral Requests

Example <item> XML Element

The Get_Content_XML API forms the XML in the fulfillment request.

In Release 11.5.10, Oracle One-to-One Fulfillment supports content from Oracle Content Manager and Management Encyclopedia System. To facilitate this support, the GET_CONTENT_XML has been overloaded. You can use the MES repository without changing any API calls. But, if the new content repository OCM is to be used, then you need to call the overloaded GET_CONTENT_XML with p_content_source = 'ocm' and p_version = version of the document.

The following code is an example of XML that is generated as part of an attachment fulfillment request, with an email media type. The content_id parameter is required for this API. The XML is passed back to the calling application as output parameter x_content_xml.

<items><item>
<media_type>
<email> abc@oracle.com</email>
</media_type>
<item_content quantity="0" user_note="THIS IS A FULFILLMENT TEST" source="mes">
<files>
<file id="117423" body="yes"/>
</files>
</item_content>
</item>
</items>

Note: Oracle does not recommend, nor does it support, the creation of XML fulfillment requests by any other means than through the APIs published in this document. Oracle provides this information on how the XML request is formed only to facilitate understanding of the fulfillment request process.

Get_Content_Xml - Overloaded Procedure Specification

PROCEDURE Get_Content_XML 
( p_api_version IN NUMBER, 
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, 
p_commit IN VARCHAR2 := FND_API.G_FALSE, 
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, 
x_return_status OUT VARCHAR2, 
x_msg_count OUT NUMBER, 
x_msg_data OUT VARCHAR2, 
p_content_id IN NUMBER, 
p_content_nm IN VARCHAR2 := FND_API.G_MISS_CHAR,  -- deprecated
p_document_type IN VARCHAR2 := FND_API.G_MISS_CHAR,--depreciated 
p_quantity IN NUMBER := 1, 
p_media_type IN VARCHAR2, 
p_printer IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_email IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_fax IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_file_path IN VARCHAR2 := FND_API.G_MISS_CHAR,--deprecated 
p_user_note IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_content_type IN VARCHAR2, 
p_bind_var IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, 
p_bind_val IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, 
p_bind_var_type IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, 
p_request_id IN NUMBER, 
x_content_xml OUT VARCHAR2 ,
p_content_source IN VARCHAR2,
p_version IN NUMBER
); 

Get_Content_Xml Specification

PROCEDURE Get_Content_XML 
( p_api_version IN NUMBER, 
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, 
p_commit IN VARCHAR2 := FND_API.G_FALSE, 
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, 
x_return_status OUT VARCHAR2, 
x_msg_count OUT NUMBER, 
x_msg_data OUT VARCHAR2, 
p_content_id IN NUMBER, 
p_content_nm IN VARCHAR2 := FND_API.G_MISS_CHAR,  -- deprecated
p_document_type IN VARCHAR2 := FND_API.G_MISS_CHAR,--depreciated 
p_quantity IN NUMBER := 1, 
p_media_type IN VARCHAR2, 
p_printer IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_email IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_fax IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_file_path IN VARCHAR2 := FND_API.G_MISS_CHAR,--deprecated 
p_user_note IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_content_type IN VARCHAR2, 
p_bind_var IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, 
p_bind_val IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, 
p_bind_var_type IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, 
p_request_id IN NUMBER, 
x_content_xml OUT VARCHAR2)

Parameter Descriptions

The following table describes the Get_Content_XML IN parameters.

Get_Content_XML IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes Must match the version number of the API. An unexpected error is returned if the calling program version number is incompatible with the current API version number (provided in the documentation).
p_init_msg_list VARCHAR2 Yes Default = FND_API.G_FALSE. If set to true, then the API makes a call to fnd_msg_pub.initialize the message stack. If set to false, then the calling program must initialize the message stack. This action is required to be performed only once, even in cases when more than one API is called.
p_commit VARCHAR2(1) No Default = FND_API.G_FALSE. If set to true, then the API commits before returning to the calling program. If set to false, then it is the responsibility of the calling program to commit the transaction.
p_validation_level NUMBER No This value determines whether or not validation should occur. This variable is checked against FND_API.G_VALID_LEVEL_NONE, and if it is greater than the latter, then validation occurs.
p_content_id NUMBER Yes A unique numeric identifier that identifies the content that is to be sent out. If not provided in the current API call, then an error message is generated and the API exits.
p_content_nm VARCHAR2 No Deprecated, currently unused.
p_document_type VARCHAR2 No Deprecated, currently unused.
p_quantity NUMBER Yes Quantity of the content to be sent (set always to 1).
p_media_type VARCHAR2 Yes Media type of the content generated by the Get_Content_XML API: FAX EMAIL PRINTER. If not provided in the current API call, then an error message is generated and the API exits. The same content can also be sent through all three media types or a combination of two media types. The values can be comma separated, for example, 'FAX,EMAIL,PRINTER' or 'EMAIL,FAX' or 'EMAIL,PRINTER' or any similar combinations.
p_printer VARCHAR2 No Supplied printer address, if p_media_ type is PRINTER. This parameter can accept the printer name/alias values.
p_email VARCHAR2 No Supplied email address, if p_media_ type is EMAIL.
p_fax VARCHAR2 No Supplied fax address, if p_media_ type is FAX
p_file_path VARCHAR2 No Deprecated, currently unused.
p_user_note VARCHAR2 No Any note that the agent wants to attach.
p_content_type VARCHAR2 Yes Valid content types:
  • QUERY

  • COLLATERAL

  • ATTACHMENT

  • DATA

    If not provided in the current API call, then an error message is generated and the API exits.

p_bind_var G_VARCHAR_TBL_TYPE=L_VARCHAR_TBL No Used with QUERY and DATA fulfillment requests. Part of a set of three matching records.
p_bind_val G_VARCHAR_TBL_TYPE=L_VARCHAR_TBL No Used with QUERY and DATA fulfillment requests. Part of a set of three matching records.
p_bind_var_type G_VARCHAR_TBL_TYPE=L_VARCHAR_TBL No Used with QUERY and DATA fulfillment requests. Part of a set of three matching records.
p_request_id NUMBER Yes The Start_Request API generates this unique identifier for the fulfillment request. If not provided in the current API call, then an error message is generated and the API exits.
p_content_source VARCHAR2 No New parameter added in 11.5.9 release. Supports the content repositories MES and OCM. The default is assumed as MES. OCM will use the Rendition functionality in OCM 11.5.10.
p_version NUMBER No OCM repositories support content versioning. Default is assumed as 1.

Get Content XML OUT Parameters

The following table describes the Get_Content_XML OUT parameters.

Parameter Data Type Description
x_return_status VARCHAR2 Indicates the return status of the API. The returned values returned are one of the following:
  • FND_API.G_RET_STS_SUCCESS. Success: Indicates that the API call was successful.

  • FND_API.G_RET_STS_ERROR. Expected Error: There is a validation error, or missing data error.

  • FND_API.G_RET_STS_UNEXP_ERROR. Unexpected Error: The calling program can not correct the error.

x_msg_count NUMBER Holds the number of messages in the message list.
x_msg_data VARCHAR2 Holds the encoded message if x_msg_count is equal to one.
x_content_xml VARCHAR2 Output content XML.

Send Request & Submit Request

Send Request is submit request overloaded. Submit Request in turn makes the call to Send Request. The additional parameter is p_preview.

Parameter p_preview

The p_preview parameter provides the ability to preview a fulfillment request before sending it to its destination. You can preview, submit or delete a fulfillment request through the One-to-One Fulfillment Administrator Console.

Previewing allows for a visual inspection of a fulfillment request before you decide to send it or cancel it. When you preview the request in a browser, you can print it through the browser. Printing a previewed request through a browser does not remove the request from the status table.

The value of p_preview determines whether the request is to be dispatched immediately or stored in the database to be inspected visually.

Use the Submit_Request procedure to submit a single new fulfillment request to the fulfillment engine. This API calls the Send_Request API.

Send Request Procedure Specification

PROCEDURE Submit_Request 
( p_api_version IN NUMBER, 
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, 
p_commit IN VARCHAR2 := FND_API.G_FALSE, 
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, 
x_return_status OUT VARCHAR2, 
x_msg_count OUT NUMBER, 
x_msg_data OUT VARCHAR2, 
p_template_id IN NUMBER := FND_API.G_MISS_NUM, 
p_subject IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_party_id IN NUMBER := FND_API.G_MISS_NUM, 
p_party_name IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_user_id IN NUMBER, 
p_priority IN NUMBER := G_PRIORITY_REGULAR, 
p_source_code_id IN NUMBER := FND_API.G_MISS_NUM, 
p_source_code IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_object_type IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_object_id IN NUMBER := FND_API.G_MISS_NUM, 
p_order_id IN NUMBER := FND_API.G_MISS_NUM, 
p_doc_id IN NUMBER := FND_API.G_MISS_NUM, 
p_doc_ref IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_server_id IN NUMBER := FND_API.G_MISS_NUM, 
p_queue_response IN VARCHAR2 := FND_API.G_FALSE, 
p_extended_header IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_content_xml IN VARCHAR2, 
p_request_id IN NUMBER ,
p_preview IN VARCHAR2
); 

Submit Request Procedure Specification

PROCEDURE Submit_Request 
( p_api_version IN NUMBER, 
p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, 
p_commit IN VARCHAR2 := FND_API.G_FALSE, 
p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, 
x_return_status OUT VARCHAR2, 
x_msg_count OUT NUMBER, 
x_msg_data OUT VARCHAR2, 
p_template_id IN NUMBER := FND_API.G_MISS_NUM, 
p_subject IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_party_id IN NUMBER := FND_API.G_MISS_NUM, 
p_party_name IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_user_id IN NUMBER, 
p_priority IN NUMBER := G_PRIORITY_REGULAR, 
p_source_code_id IN NUMBER := FND_API.G_MISS_NUM, 
p_source_code IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_object_type IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_object_id IN NUMBER := FND_API.G_MISS_NUM, 
p_order_id IN NUMBER := FND_API.G_MISS_NUM, 
p_doc_id IN NUMBER := FND_API.G_MISS_NUM, 
p_doc_ref IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_server_id IN NUMBER := FND_API.G_MISS_NUM, 
p_queue_response IN VARCHAR2 := FND_API.G_FALSE, 
p_extended_header IN VARCHAR2 := FND_API.G_MISS_CHAR, 
p_content_xml IN VARCHAR2, 
p_request_id IN NUMBER 
); 

Send and Submit_Request IN Parameters

The following table lists the IN parameters for Send_Request and Submit_Request.

Send and Submit_Request IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes This must match the version number of the API. An unexpected error is returned if the calling program version number is incompatible with the current API version number (provided in the documentation)
p_init_msg_list VARCHAR2 Yes Default = FND_API.G_FALSE. If set to true, then the API makes a call to fnd_msg_pub.initialize the message stack. If set to false, then the calling program must initialize the message stack. This action is required to be performed only once, even in the case where more than one API is called
p_commit VARCHAR2(1) No Default = FND_API.G_FALSE. If set to true, then the API commits before returning to the calling program. If set to false, then it is the calling program's responsibility to commit the transaction.
p_validation_level NUMBER No This value determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation occurs.
p_template_id NUMBER No The fulfillment request template identifier. NULL if request does not correspond to a predefined template.
p_subject VARCHAR2 No Subject specifies the purpose of the request
p_party_id NUMBER No Customer Identifier.
p_party_name VARCHAR2 No Customer Name.
p_user_id NUMBER Yes Agent or user Identifier who is making the request.
p_priority NUMBER No Priority for that particular request. If none provided, default is regular
p_source_code_id NUMBER No Campaign or promotion field.
p_source_code VARCHAR2 No Campaign or promotion field.
p_object_type VARCHAR2 No Campaign or promotion field.
p_object_id NUMBER No Campaign or promotion field.
p_order_id NUMBER No Unique identifier of the field.
p_doc_id NUMBER No Document Identifier, if not provided, set to p_request_id
p_doc_ref VARCHAR2 No Document Reference. If not provided, set to JFUF.
p_server_id NUMBER No Unique Identifier of the One-to-One Fulfillment Server. It is the primary key of JTF_FM_SERVICE_ALL table. If this is provided, that particular server processes the request.
p_queue_response VARCHAR2 No Deprecated and not supported. This field is used internally for other purposes.
p_extended_header VARCHAR2 No Used to insert a character string in the form of one or more extended header elements into the XML request.
p_content_xml VARCHAR2 Yes The XML content formed by calling the GET_CONTENT_XML API.
p_request_id NUMBER Yes The unique identifier for the fulfillment request generated by the Start_Request API. If not provided in the current API call, an error message is generated and the API exits.
p_preview VARCHAR2 Yes Boolean Value: Used to specify whether or not this is a preview request: TRUE: Preview this document. FALSE: Do not preview this document, instead send it to the fulfillment request queue.

Submit Request OUT Parameters

The following table describes the Submit_Request OUT parameters.

Parameter Data Type Description
x_return_status VARCHAR2 Indicates the return status of the API. Returns one of the following values:
  • FND_API.G_RET_STS_SUCCESS. Success: Indicates that the API call was successful

  • FND_API.G_RET_STS_ERROR. Expected Error: There is a validation error, or missing data error.

  • FND_API.G_RET_STS_UNEXP_ERROR. Unexpected Error: The calling program cannot correct the error.

x_msg_count NUMBER Holds the number of messages in the message list.
x_msg_data VARCHAR2 Holds the encoded message if x_msg_count is equal to one.

Messages and Notifications

The APIs contained in package JTF_FM_REQUEST_GRP generate messages and notifications as necessary. In addition, some messages are common to all of the Fulfillment APIs. These messages are detailed in the following sections.

The messages and notifications generated by each API are described in the following sections.

Business Events

When using the Multithreaded Fulfillment option, the business event oracle.apps.jtf.fm.int.RequestPostProcessing is raised at the end of the pre-processing stage of a request. By subscribing to this event, implementers have the ability to add custom validation for email request processing.

Common Messages

The following table lists the messages and notifications that are common to many of the APIs contained in package JTF_FM_REQUEST_GRP.

Common Status Messages
NUMBER TYPE NAME TEXT
210925 E JTF_FM_API_QUEUE_NOT_FOUND Could not find queue names for Server ID &ARG1
210927 E JTF_FM_API_REQUEST_NOTFOUND Could not find fulfillment request for Request ID & ARG1 in database
210932 E JTF_FM_API_MISSING_REQUEST_ID Value for Request ID cannot be NULL.
210939 E JTF_FM_API_DEBUG_MESSSAGE 1 to 1 Fulfillment API: &ARG1
210940 S JTF_FM_API_SUCCESS_MESSAGE The &ARG1 API has completed successfully.

Get_Content_XML Messages

The following table lists the messages and notifications that are used by the Get_ Content_XML API.

Status Messages for Get_Content_XML
NUMBER TYPE NAME TEXT
210922 E JTF_FM_API_INVALID_MEDIATYPE Invalid media type &ARG1 passed for Content ID &ARG2. Allowed media types are EMAIL, FAX, PRINTER
210923 E JTF_FM_API_MULTIPLE_MEDIATYPE Multiple media types were passed for Content ID = &ARG1. Only one media type is allowed for each content.
210924 E JTF_FM_API_INVALID_CONTENT Invalid content type &ARG1 passed for Content ID &ARG2. Allowed content types are QUERY, COLLATERAL, ATTACHMENT or DATA.
210929 E JTF_FM_API_MISSING_CONTENT_ID Value for Content ID cannot be NULL.
210930 E JTF_FM_API_MISSING_MEDIA_TYPE Value for Media Type cannot be NULL.
210931 E JTF_FM_API_MISSING_CONTENTTYPE Value for Content Type cannot be NULL.
210974 E JTF_FM_DISP_CONTENT_NOT_FOUND Cannot find document for Content ID &ARG1.
  E JTF_FM_API_CONTENT_INVALID The content_id &ARG1 is not a valid content_id, or does not exist.
  E JTF_FM_API_INVALID_LISTTYPE Invalid list type &ARG1 passed. Allowed list types are VIEW or ADDRESS
  E JTF_FM_API_MISSING_LIST_TYPE Value for List cannot be NULL
  E JTF_FM_API_INVALID_REQTYPE Invalid request type specified. Only allowed values are "E,P or T". E for "Electronic Request", P for "Physical Collateral" and T for "Test Requests".
  E JTF_FM_API_CF_INVALID_MEDIA Invalid Media Type specified. Only allowed Media types are any one of the following. "EPF, EFP, FEP, FPE, PEF, PFE, EP, EF, E, PE, PF, P, FE, FP, F". E represents "EMAIL", P represents "PRINTER", and F represents "FAX"

Example Scripts

The following scripts are examples that may not work if used in the exact form shown here and placed into another environment.

Sample Script - Start_Request, Get_Content_Xml, Submit_Request

DECLARE
l_api_versionNUMBER := 1.0;
l_commitVARCHAR2(5) := FND_API.G_TRUE;
l_content_idVARCHAR2(30);
l_media_typeVARCHAR2(30);
l_request_typeVARCHAR2(20);
l_user_noteVARCHAR2(1000);
l_document_typeVARCHAR2(150);
l_bind_var    JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;
l_bind_var_type    JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;
l_bind_val    JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;
l_template_id  NUMBER;
l_party_id NUMBER;
l_user_idNUMBER;
l_server_id NUMBER;
l_request_idNUMBER;
l_subjectVARCHAR2(100);
l_msg_count  NUMBER;
l_msg_data VARCHAR2(1000);
l_return_status VARCHAR2(1000);
l_content_xml1 VARCHAR2(1000);
l_content_xml VARCHAR2(10000);
l_content_nmVARCHAR2(100);
l_emailVARCHAR2(100);
l_printerVARCHAR2(100);
l_file_pathVARCHAR2(100);
l_faxVARCHAR2(100);
BEGIN
    -- Start the fulfillment request. The output request_id must be passed
    -- to all subsequent calls made for this request.
JTF_FM_REQUEST_GRP.STart_Request
(
p_api_version => l_api_version,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_request_id => l_request_id
);
DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));
-- Initialize the parameters for Master Document.
              -- this does not need anything.it just sends the email . 
   l_content_id := &p_contentid;--item id
    l_media_type := &p_mediaType; 
   l_document_type := &docType;--zip or htm or html
   l_request_type := &p_requestType;
   l_user_note := 'Please dont hesitate to call at 1-800-INFODSK.';
   l_email := &p_email;
   l_printer  := '\\ORADEV8\DEVSTANLEY';
   l_file_path := NULL;
   l_fax  := '9999999999';
    -- This call gets the XML string for the content(Master Document) with
    -- the parameters as defined above
JTF_FM_REQUEST_GRP.Get_Content_XML
(
p_api_version => l_api_version,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_content_id => l_content_id,
p_content_nm => l_content_nm,
p_document_type =>  l_document_type,
p_media_type=> l_media_type,
p_printer => l_printer,
p_email => l_email,
p_file_path => l_file_path,
p_fax => l_fax,
p_user_note => l_user_note, p_content_type => l_request_type,
p_bind_var => l_bind_var,
p_bind_val => l_bind_val,
p_bind_var_type => l_bind_var_type,
p_request_id => l_request_id,
x_content_xml => l_content_xml1);
-- The output XML string is stored in a local variable
                      l_content_xml := l_content_xml1;
-- Check the return status 
DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status);
DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count);
DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);   
 -- Initialize Parameters for submitting the fulfillment request
l_user_id := &p_userId;--this is a parameter that can be filled during run
-- l_server_id := null;
l_subject := &p_subject;--subject could be environment and what test it is
-- Submit the fulfillment request
JTF_FM_REQUEST_GRP.Submit_Request
(
p_api_version => l_api_version,
p_commit => l_commit,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_subject => l_subject,
p_party_id => l_party_id,
p_user_id => l_user_id,
p_queue_response => FND_API.G_TRUE,
p_content_xml => l_content_xml,
p_request_id => l_request_id
);
DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status);
DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count);
DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);
DBMS_OUTPUT.PUT_LINE('Message Data: '||l_user_id);
END;