SOAP Asynchronous Operation – asyncAddList

SOAP Action: asyncAddList

Scenario: Perform the creation of customer and employee records in a single request asynchronously

Request

<soapenv:Envelope
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:platformCore='urn:core_2021_2.platform.webservices.netsuite.com'
    xmlns:listRel='urn:relationships_2021_2.lists.webservices.netsuite.com'
    xmlns:listAcct='urn:accounting_2021_2.lists.webservices.netsuite.com'
    xmlns:platformMsgs='urn:messages_2021_2.platform.webservices.netsuite.com'>
    <soapenv:Header>
        <tokenPassport xsi:type='platformCore:TokenPassport'>
            <account xsi:type='xsd:string'>{{accountId}}</account>
            <consumerKey xsi:type='xsd:string'>{{consumerKey}}</consumerKey>
            <token xsi:type='xsd:string'>{{tokenId}}</token>
            <nonce xsi:type='xsd:string'>{{nonce}}</nonce>
            <timestamp xsi:type='xsd:long'>{{timestamp}}</timestamp>
            <signature algorithm='HMAC_SHA256' xsi:type='platformCore:TokenPassportSignature'>{{signature}}</signature>
        </tokenPassport>
    </soapenv:Header>
    <soapenv:Body>
        <asyncAddList xsi:type='platformMsgs:AsyncAddListRequest'>
            <record xsi:type='listRel:Customer'>
                <entityId xsi:type='xsd:string'/>
                <firstName xsi:type='xsd:string'>Test</firstName>
                <lastName xsi:type='xsd:string'>Developer</lastName>
                <companyName xsi:type='xsd:string'>Test Developer</companyName>
                <email xsi:type='xsd:string'>testdeveloper@gmail.com</email>
            </record>
            <record xsi:type='listEmp:Employee'>
                <entityId xsi:type='xsd:string'/>
                <firstName xsi:type='xsd:string'>Test</firstName>
                <lastName xsi:type='xsd:string'>Employee</lastName>
                <email xsi:type='xsd:string'>testemployee@gmail.com</email>
            </record>
        </asyncAddList>
    </soapenv:Body>
</soapenv:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <asyncAddListResponse
            xmlns="">
            <platformCore:asyncStatusResult
                xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com">
                <platformCore:jobId>ASYNCWEBSERVICES_TSTDRV2782962_080120231326469820838822226_7</platformCore:jobId>
                <platformCore:status>pending</platformCore:status>
                <platformCore:percentCompleted>0.0</platformCore:percentCompleted>
                <platformCore:estRemainingDuration>0.0</platformCore:estRemainingDuration>
            </platformCore:asyncStatusResult>
        </asyncAddListResponse>
    </soapenv:Body>
</soapenv:Envelope>

Leave a comment

Your email address will not be published. Required fields are marked *