Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

November 2013

Using Web Services to


Do File-Based Data
Import
Copyright © 2005, 2013 Oracle and/or its affiliates. All rights reserved.

This software and related documentation are provided under a license agreement containing restrictions on use
and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license
agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit,
distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering,
disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you
find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf
of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs
installed on the hardware, and/or documentation, delivered to U.S. Government end users are “commercial
computer software” pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental
regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any
operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be
subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S.
Government.

This software or hardware is developed for general use in a variety of information management applications. It is not
developed or intended for use in any inherently dangerous applications, including applications that may create a
risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to
take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation
and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous
applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used
under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD
logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a
registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information on content, products, and
services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all
warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its
affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party
content, products, or services.

Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support


Oracle customers have access to electronic support through My Oracle Support. For information, visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.
Contents

1 Using Web Services to Do File-Based Data Import .................................................. 5


2 Reference Information for Using Web Services to Do File-Based Data
Import .................................................................................................................................. 11

Syntax That the submitImportActivity Method Uses .................................................... 11

Parameters That You Can Use With the submitImportActivity Method ................... 11

Statuses That the submitImportActivity Method Uses ................................................. 13

Delimiters That Your Input File Can Use ......................................................................... 14

Timestamp Formats That Your Input File Can Use ........................................................ 14

Character Encoding That Your Input File Can Use ...................................................... 15

Using Web Services to Do File-Based Data Import 3


1 Using Web Services to Do File-
Based Data Import

This topic describes how to use the Import web service to import your custom data into Oracle
Sales Cloud.

Using web services to do file-based data import


1. Map the data:
A. Log in to your Oracle Sales Cloud application.
B. Navigate to the Setup and Maintenance screen, and then search for the Define
File Import task.
C. In the Search Results list, expand the Define File Import folder.
D. In the Manage File Import Mappings row, click the Go to Task icon.
E. Click Actions, and then click Create.
F. In the Create Import Mapping dialog box, enter the following value in the Import
Mapping field, and then click Save and Close:
GLD - Contact-map
For this example, you create a simple mapping that references Consumer
records and that uses only the First name and Last name fields of these records.
G. In the Name column, click GLD - Contact-map.
H. In the Edit Import Mapping screen, right-click the mapping number, and then
click Copy.
For this example, this number is 300100018631447. The Edit Import Mapping screen
uses this number to uniquely identify this mapping.
2. Encode your input file so that it uses Base64 encoding.
In this example, you import a file that includes the following consumers. The header
row is optional:
PersonFirstName,PersonLastName
Antonia,Pinas
Christina,Aamos
The encoded data for this example must use the following Base64 encoding:
UGVyc29uRmlyc3ROYW1lLFBlcnNvbkxhc3ROYW1lDQpHbGFuZG9uLExhdXJlbnQNCkdsY
W5kb24sUGl lcnJl
You can use an encoding tool of your choice. For example, you can use the
following tool:
http://www.opinionatedgeek.com/dotnet/tools/base64encode/
3. Send your data to Oracle Sales Cloud:
A. Open a SOAP tool that can send a SOAP envelope.

Using Web Services to Do File-Based Data Import 5


▪ Syntax That the submitImportActivity Method Uses

For example, open SoapUI. SoapUI is a functional testing application. For more
information, see http://www.soapui.org.
B. Use the SOAP tool to send the following SOAP envelope:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://xmlns.oracle.com/oracle/apps/marketing/commonMa
rketing/
mktImport/model/types/"xmlns:mod="http://xmlns.oracle.com/oracle/
apps/marketing/commonMarketing/ mktImport/model/">
<soapenv:Header/>
<soapenv:Body>
<typ:submitImportActivity>
<typ:importJobSubmitParam>
<mod:JobDescription>description</mod:JobDescription>
<mod:HeaderRowIncluded>header_row</mod:HeaderRowIncluded>
<mod:FileEcodingMode>encoding</mod:FileEcodingMode>
<mod:MappingNumber>mapping_number</mod:MappingNumber>
<mod:FileContent>import_content</mod:FileContent>
<mod:ImportMode>CREATE_RECORD</mod:ImportMode>
<mod:FileFormat>delimiter</mod:FileFormat>
</typ:importJobSubmitParam>
</typ:submitImportActivity>
</soapenv:Body>
</soapenv:Envelope>
where:
 description is a string that describes the purpose of the job. You can use any
string.
 header_row is one of the following values:
 Y. Your input file includes a header row.
 N. Your input file does not include a header row.
 encoding specifies the encoding that the Import web service uses when it
converts your input file. For example, UTF-8.
 mapping_number specifies the number that you identified in step 1.
 import_content specifies the Base64 encoding that you prepared in step 2.
 delimiter specifies the character that import_content uses to separate data
elements. Your input file must use the delimiter that delimiter specifies. A data
element is one part of a record. For example, PersonFirstName is one data
element of a consumer record.
For more information about these parameters, see Syntax That the
submitImportActivity Method Uses on page 11.
Note that the Import web service includes the following methods:
 submitImportActivity. Submits the file import activity.
 getImportActivityStatus. Gets the file import activity status.
 getImportActivityLogs. Gets the file import activity logs.
For this example, use your SOAP tool to send the following SOAP envelope:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://xmlns.oracle.com/oracle/apps/marketing/commonMa
rketing/ mktImport/model/types/"

6 Using Web Services to Do File-Based Data Import


▪ Syntax That the submitImportActivity Method Uses

xmlns:mod="http://xmlns.oracle.com/oracle/apps/marketing/comm
onMarketing/ mktImport/model/">
<soapenv:Header/>
<soapenv:Body>
<typ:submitImportActivity>
<typ:importJobSubmitParam>
<mod:JobDescription>GLD - Import Contact
Demonstration</ mod:JobDescription>
<mod:HeaderRowIncluded>Y</mod:HeaderRowIncluded>
<mod:FileEcodingMode>UTF-8</mod:FileEcodingMode>
<mod:MappingNumber>300100018631447</mod:MappingNumber>
<mod:FileContent>UGVyc29uRmlyc3ROYW1lLFBlcnNvbkxhc3ROYW
1lDQpHbGFuZG9 uLExhdXJlbnQNCkdsYW5kb24sUGllcnJl</mod:FileContent>
<mod:ImportMode>CREATE_RECORD</mod:ImportMode>
<mod:FileFormat>COMMA_DELIMITER</mod:FileFormat>
</typ:importJobSubmitParam>
</typ:submitImportActivity>
</soapenv:Body>
</soapenv:Envelope>
In your SOAP tool, make sure you add the user name and password that Oracle
Sales Cloud requires. For example, in SoapUI, click the Aut button in the lower-left
corner, and then enter the user name and password.
C. Make sure Oracle Sales Cloud sends the following reply:
<ns0:submitImportActivityResponse>
<ns0:result>
<ns1:JobId>300100018636453</ns1:JobId>
<ns1:Result>Success</ns1:Result>
</ns0:result>
</ns0:submitImportActivityResponse>
where:
 JobId identifies your job. Make a note of this number.
4. Get the status of your job. Send the following request to Oracle Sales Cloud:
<typ:getImportActivityStatus>
<typ:importJobId>300100018636453</typ:importJobId>
</typ:getImportActivityStatus>
where:
 importJobId specifies the number that you noted in step C on page 7.
Oracle Sales Cloud sends a reply. For example:
<ns0:getImportActivityStatusResponse>
<ns2:result>
<ns1:BatchId>300100018636457</ns1:BatchId>
<ns1:Status>status</ns1:Status>
<ns1:LoadDate>2012-10-03</ns1:LoadDate>
<ns1:RecordReadFromFile xsi:nil="true"/>
<ns1:LoadErrors xsi:nil="true"/>
<ns1:FormatErrors xsi:nil="true"/>
<ns1:SuccessfullyLoaded xsi:nil="true"/>
</ns2:result>
</ns0:getImportActivityStatusResponse>
where:
 Status indicates the status of your job. For more information, see Statuses That
the submitImportActivity Method Uses on page 13.

Using Web Services to Do File-Based Data Import 7


▪ Syntax That the submitImportActivity Method Uses

5. Repeat step 4 until Oracle Sales Cloud sends the following reply:
<ns2:result>
<ns1:BatchId>300100018636457</ns1:BatchId>
<ns1:Status>COMPLETE</ns1:Status>
<ns1:LoadDate>2012-10-03</ns1:LoadDate>
<ns1:RecordReadFromFile>2</ns1:RecordReadFromFile>
<ns1:LoadErrors>0</ns1:LoadErrors>
<ns1:FormatErrors xsi:nil="true"/>
<ns1:SuccessfullyLoaded>2</ns1:SuccessfullyLoaded>
</ns2:result>
where:
 Status is COMPLETE.
 LoadErrors is 0.
 FormatErrors is true.
 SuccessfullyLoaded is SuccessfullyLoaded.
6. Optional. Check the log.
You can check the log to determine if an error occurred, or to get the PartyId for
each record. Do the following work:
A. In your SOAP tool, send the following request to Oracle Sales Cloud:
<typ:getImportActivityLogs>
<typ:importJobId>300100018636453</typ:importJobId>
<typ:batchId>300100018636457</typ:batchId>
</typ:getImportActivityLogs>
where:
 importJobId identifies the number that you noted in step C on page 7.
 batchId identifies the number that Oracle Sales Cloud sent in the reply in
step 4.
Oracle Sales Cloud sends a reply. For example:
<ns0:getImportActivityLogsResponse>
<ns2:result>
<ns1:LogFileName>log-Import Activity 1349272813558
Data File.csv</ ns1:LogFileName>
<ns1:LogFileContent>
<xop:Include
href="cid:24f39a91936b44eeb3d0c1d6f4db93d2"/>
</ns1:LogFileContent>
<ns1:ErrorLogFileName xsi:nil="true"/>
<ns1:ExceptionLogFileName xsi:nil="true"/>
<ns1:BatchId xsi:nil="true"/>
</ns2:result>
</ns0:getImportActivityLogsResponse>
where:
 Include href specifies the Id that identifies the log file that Oracle Sales
Cloud sends.
B. Locate, and then open the file that Oracle Sales Cloud sent.
For example, in SoapUI you can do the following:
 Click the Raw tab. SoapUI displays the following reply:
Content-ID: <24f39a91936b44eeb3d0c1d6f4db93d2>
ObjectKey,PersonFirstName,PersonLastName
100100028456712,Antonia, Pinas

8 Using Web Services to Do File-Based Data Import


▪ Syntax That the submitImportActivity Method Uses

100100028456713,Christina,Aamos
------=_Part_161_384756467.1349273628660—
 To open the log file, click Attachments, and then search the Name column
for the Content-ID. In this example, you search for the following value:
24f39a91936b44eeb3d0c1d6f4db93d2
7. Verify your work:
Do one of the following:
 In SoapUI, use a web service to verify your work.
For example, you can use the following getPerson operation of the
foundationParties web service or the PersonService web service:
<ns0:getPersonResponse>
<ns2:result>
<ns1:PartyId>100100028456713</ns1:PartyId>
<ns1:PartyNumber>CDRM_1384311</ns1:PartyNumber>
<ns1:PartyName>Christina Aamos</ns1:PartyName>
<ns1:PartyType>PERSON</ns1:PartyType>
<ns1:ValidatedFlag>false</ns1:ValidatedFlag>
<ns1:LastUpdatedBy>BULK_IMPORT</ns1:LastUpdatedBy>
<ns1:LastUpdateLogin>-1</ns1:LastUpdateLogin>
<ns1:CreationDate>2012-10-03T07:04:18.577084-
07:00</ns1:CreationDate>
<ns1:RequestId>99999</ns1:RequestId>
<ns1:LastUpdateDate>2012-10-03T07:04:18.577084-
07:00</ ns1:LastUpdateDate>
<ns1:CreatedBy>BULK_IMPORT</ns1:CreatedBy>

<ns1:OrigSystemReference>300100018636467</ns1:OrigSystemRef
erence>
where:
 PartyId specifies the Partyid that you identified in step 6. For example, the
PartyId for Christina Aamos is 100100028456713.
 In your Oracle Sales Cloud application, locate the data that you imported in step
3. You search for People in the Customer Data Management Dashboard.

Using Web Services to Do File-Based Data Import 9


2 Reference Information for Using Web
Services to Do File-Based Data Import

Syntax That the submitImportActivity Method Uses


The submitImportActivity method uses the following syntax:
<typ:submitImportActivity>
<typ:importJobSubmitParam>
<mod:JobName>descriptive_name</mod:JobName>
<mod:JobDescription>description</mod:JobDescription>
<mod:HeaderRowIncluded>header_row</mod:HeaderRowIncluded>
<mod:ErrorThreshold>number</mod:ErrorThreshold>
<mod:Notification>Y_or_N</mod:Notification>
<mod:DateFormat>format</mod:DateFormat>
<mod:TimestampFormat>format</mod:TimestampFormat>
<mod:FileEcodingMode>encoding</mod:FileEcodingMode>
<mod:MappingNumber>mapping_number</mod:MappingNumber>
<mod:FileFormat>delimiter</mod:FileFormat>
<mod:FileContent>import_content</mod:FileContent>
<mod:ImportMode>import_mode</mod:ImportMode>
<mod:LookbackDays>number</mod:LookbackDays>
<mod:CallListCode>number</mod:CallListCode>
<mod:FileName>name</mod:FileName>
<mod:FileFormat>format</mod:FileFormat>
</typ:importJobSubmitParam>
</typ:submitImportActivity>
For more information about the parameters that this syntax uses, see Parameters That
You Can Use With the submitImportActivity Method on page 11.

Parameters That You Can Use With the submitImportActivity


Method
Table 1 describes the parameters that you can use with the submitImportActivity
method. The FileContent and MappingNumber parameters are required. All other
parameters are optional.

Table 1. Parameters That You Can Use With the submitImportActivity Method

Parameter Description

CallListCode Specify the Call List Code. The Call List Code is a
marketing code that identifies a group of records.

DateFormat Specify the date format that your input file uses.

ErrorThreshold Specify the error threshold. The import runs until the
number of errors is less than the value that you specify for
ErrorThreshold.

Using Web Services to Do File-Based Data Import 11


Reference Information for Using Web Services to Do File-Based Data Import ▪ Parameters
That You Can Use With the submitImportActivity Method

Parameter Description

FileContent Include the content of the import file.

FileEcodingMode For more information, see Character Encoding That Your


Input File Can Use on page 15.

FileFormat Specify the file format that the import file uses. You can
use one of the following values:
 TEXT_FILE. Specifies that the input file is a text file.
 XML_FILE. Specifies that the input file is an XML file.

FileName Specify the file name of the import file.

HeaderRowIncluded Specify whether or not your input file includes a header


row. You can use one of the following values:
 Y. Your input file includes a header row.
 N. Your input file does not include a header row.

ImportMode Specify the import mode. You can use one of the
following values:
 CREATE_RECORD. Creates new records.
 UPDATE_RECORD. Updates records that the Oracle
Sales Cloud database already contains.

JobDescription Describe the import job. You can include any description.
You can include this description as a string. It is not
necessary to use quotes to enclose this string.

JobName Specify the name of the import job. You can specify any
name. You can include this name as a string. It is not
necessary to use quotes to enclose this string.

LookbackDays Specify the lookback period, which is the number of days


that the Import web service examines for duplicates,
starting with the most recent day. For example, if today is
Thursday, and if you set LookbackDays to 3, then the
import examines records for duplicates dating back to
Monday, Tuesday, and Wednesday. Note the following:
 You can use the LookbackDays parameter only for the
Lead import object.
 The Import web service only examines leads that were
created during the lookback period. It evaluates these
leads for duplicates according to the attributes that
the predefined import mapping specifies. If it finds a

12 Using Web Services to Do File-Based Data Import


Reference Information for Using Web Services to Do File-Based Data Import ▪ Statuses That
the submitImportActivity Method Uses

Parameter Description
duplicate lead, then it does not import the duplicate,
but it does report this duplicate in the Exception
report.
 The Import web service considers each duplicate that
it finds as an error when it determines the allowable
error count threshold.

MappingNumber Specify the mapping number. The Edit Import Mapping


screen uses this number to uniquely identify a mapping.

Notification Specify whether or not to enable notification. You can use


one of the following values:
 Y. Enable notification. The Import web service sends
an email message to the Web Service user. This
message includes the task status.
 N. Do not enable notification. The Import web service
sends no notifications.

TimestampFormat For more information, see Timestamp Formats That Your


Input File Can Use on page 14.

Statuses That the submitImportActivity Method Uses


Table 2 describes the statuses that the submitImportActivity method uses.

Table 2. Statuses That the submitImportActivity Method Uses

Status Description

BASE_TABLE_UPLOAD Indicates that the bulk import process is uploading data


from the interface tables to the base tables.

COMPLETE Indicates that the import finished without error.

COMPLETE_WITH_ERRORS Indicates that the import finished, but with errors.

FAILED Indicates that the import failed to finish.

Indicates that Oracle Sales Cloud has not yet scheduled


NEW
the import.

RUNNING Indicates that the import is uploading data from the input
file to the interface tables.

Using Web Services to Do File-Based Data Import 13


Reference Information for Using Web Services to Do File-Based Data Import ▪ Delimiters That
Your Input File Can Use

Status Description

SCHEDULED Indicates that Oracle Sales Cloud has set a start time for
the import, but has not yet started this import.

Delimiters That Your Input File Can Use


Table 3 describes the delimiters that your input file can use.

Table 3. Delimiters That Your Input File Can Use

Delimiter Description

COMMA_DELIMITER Specifies that the input file uses a comma to separate


each data element.

FIXED_WIDTH_DELIMITER Specifies that the input file uses a fixed width to separate
each data element.

OTHER_DELIMITER Specifies that the input file uses a nonstandard delimiter to


separate each data element.

Specifies that the input file uses a tab to separate each


TAB_DELIMITER
data element.

XML_DELIMITER Specifies that the input file uses an XML tag to separate
each data element.

Timestamp Formats That Your Input File Can Use


Table 4 describes the timestamp formats that your input file can use.

Table 4. Timestamp Formats That Your Input File Can Use

Format Example

EEE, d MMM yyyy HH:mm:ss Z Wed, 4 Jul 2001 12:08:56 -0700

yyMMddHHmmssZ 010704120856-0700

yyyy.MM.dd G 'at' HH:mm:ss z 2001.07.04 at 12:08:56 PDT

yyyy.MMMMM.dd GGG hh:mm aaa 2001.July.04 12:08 PM

yyyy-MM-dd'T'HH:mm:ss.SSSZ 2001-07-04T12:08:56.235-0700

14 Using Web Services to Do File-Based Data Import


Reference Information for Using Web Services to Do File-Based Data Import ▪ Character
Encoding That Your Input File Can Use

Character Encoding That Your Input File Can Use


Table 5 describes the character encoding that your input file can use.

Table 5. Character Encoding That Your Input File Can Use

Character Encoding Description

Big5 Specifies to use Chinese traditional Big5 character


encoding for Taiwan, Hong Kong, and Macau. This
encoding displays traditional Chinese characters.

GB2312 Specifies to use Chinese simplified GB2312 character


encoding for the People's Republic of China. This
encoding displays simplified Chinese characters.

Shift_JIS Specifies to use Shift-JIS character encoding for the


Japanese language. This encoding displays Japanese
Industrial Standard characters.

UTF-16 Specifies to use UTF-16 character encoding. This encoding


uses the 16bit, variable-width Unicode Transformation
format.

UTF-16BE Specifies to use UTF-16BE character encoding. This


encoding uses the 16-bit, variable-width Unicode
Transformation format.

UTF-16LE Specifies to use UTF-16LE character encoding. This


encoding uses the 16-bit, variable-width Unicode
Transformation format.

UTF-8 Specifies to use UTF-8 character encoding. This encoding


uses the 8-bit, variable-width Unicode Transformation
format.

windows-1250 Specifies to use Microsoft Windows 1250 character


encoding for European languages that are based on the
Latin language. For example, Polish, Czech, Slovakian,
Hungarian, Slovene, Serbian, Croatian, Romanian or
Albanian.

windows-1252 Specifies to use Microsoft Windows 1252 character


encoding for Western European languages.

windows-1253 Specifies to use Microsoft Windows 1253 character


encoding for the Greek language.

Using Web Services to Do File-Based Data Import 15


Reference Information for Using Web Services to Do File-Based Data Import ▪ Character
Encoding That Your Input File Can Use

16 Using Web Services to Do File-Based Data Import

You might also like