Home > Cloud Cruiser 4 > REST API reference > Customers > Import customers from CSV

Import customers from CSV

Imports CSV-formatted customer data.

Resource URL

POST http://<ccServerURL>/rest/v2/customers/import

Request

Parameters
  Name Type Description
URL query parameters (optional) updateDuplicates boolean Whether to update an existing customer when the source data contains a duplicate. When false, the duplicate source row is ignored. The default is false.
Content-Type

text/csv

Body

The customers to import, in Customer CSV file format.

Response

Content-Type

application/xml

Body

Details for the result of the import, as XML text with the root element itemImportResult or JAXB type com.cloudcruiser.server.webservices.v2.dto.common.ItemImportResult.

Schema

This XML schema describes common objects that are used by methods for more than one object type. Methods specific to an object type are located in its section.

Version 4.0
Version 4.1 and later
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.cloudcruiser.com/webservices/v2/Common" attributeFormDefault="unqualified" elementFormDefault="qualified"targetNamespace="http://www.cloudcruiser.com/webservices/v2/Common">
  <xs:import/>
  <xs:element name="itemImportResult" type="tns:ItemImportResult"/>
  <xs:complexType name="StartOfDay">
    <xs:complexContent>
      <xs:extension base="tns:Date">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Date">
    <xs:sequence/>
    <xs:attribute name="year" type="xs:short" use="required"/>
    <xs:attribute name="month" type="xs:short" use="required"/>
    <xs:attribute name="day" type="xs:short" use="required"/>
  </xs:complexType>
  <xs:complexType name="EndOfDay">
    <xs:complexContent>
      <xs:extension base="tns:Date">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="DateTime">
    <xs:complexContent>
      <xs:extension base="tns:Date">
        <xs:sequence/>
        <xs:attribute name="hours" type="xs:short" use="required"/>
        <xs:attribute name="minutes" type="xs:short" use="required"/>
        <xs:attribute name="seconds" type="xs:short" use="required"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Service">
    <xs:sequence/>
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="group" type="xs:string"/>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="ConversionType">
    <xs:sequence/>
    <xs:attribute name="operator" type="conversionOperatorType" use="required"/>
    <xs:attribute name="operand" type="xs:double" use="required"/>
  </xs:complexType>
  <xs:complexType name="ItemImportResult">
    <xs:sequence>
      <xs:element name="importedSummary">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="totalItems" type="xs:int"/>
            <xs:element name="newItems" type="xs:int"/>
            <xs:element name="duplicateItems" type="xs:int"/>
            <xs:element name="updatedItems" type="xs:int"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="newItemNames">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="newItemName" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="duplicateItemNames">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="duplicateItemName" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="updatedItemNames">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" name="updatedItemName" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

Example

URL invocation

POST http://localhost:8080/rest/v2/customers​​/import

Request body
rate_plan,account_id,alt_account_id,description,flag1,flag2,flag3,flag4,flag5,accounting_day,email,address1,address2,address3
Default,T|K1,,Cust 1 Description,A,B,C,D,E,2,t_k1@big.org,,,
Default,T|K2,,Cust 2 Description,,,,,,5,t_k2@big.org,"102 Second Street","San Jose","CA 93021"
Default,T|K3,alt12345,Cust 3 Description,,,,,,,t_k3@big.org,"103 Third Street","San Jose","CA 93021"
,T|K4,,Cust 4 Description,A,B,C,D,E,1,t_k4@big.org,"104 Fourth Street","San Jose","CA 93021"
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<itemImportResult xmlns="http://www.cloudcruiser.com/webservices/v2/Common">
    <importedSummary>
        <totalItems>4</totalItems>
        <newItems>4</newItems>
        <duplicateItems>0</duplicateItems>
        <updatedItems>0</updatedItems>
    </importedSummary>
    <newItemNames>
        <newItemName>Account T|K1</newItemName>
        <newItemName>Account T|K2</newItemName>
        <newItemName>Account T|K3</newItemName>
        <newItemName>Account T|K4</newItemName>
    </newItemNames>
</itemImportResult>
Last modified

Tags

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP