Reference Guide#

Introduction#

The WebSmart Delivery Indicator returns geographic, demographic and census data for a given location, defined by the address key returned by the Address Verifier service.

The Delivery Indicator Service returns a result code indicating whether the submitted address is a business or a residential address.

Service URLs#

Sample Code#

Adding Delivery Indicator to a Project#

If you are using the SOAP service with Visual Studio .NET, you need to add a web reference to the service to your project. Click on the Project menu and select Add Web Reference.... Enter the following URL on the Add Web Reference dialog box:

https://rbdi.melissadata.net/v2/SOAP/Service.svc

If you are not using Visual Studio .NET, see the documentation for your SOAP interface for the procedure for adding the service to your project.

Submitting an XML request#

After building your XML string from your data, an XML request to the web service is submitted using an HTTP POST operation to the following URL:

https://rbdi.melissadata.net/v2/XML/Service.svc/doRBDI

Building a REST Request#

Query strings are sent to the web service as part of the URL using an HTTP Get operation appended to following URL:

https://rbdi.melissadata.net/v2/REST/Service.svc/doRBDI

Delivery Indicator Request Object#

At the very minimum, a request to the WebSmart Delivery Indicator consists of the user’s Customer ID and at least one AddressKey.

SOAP Request#

The following Visual Basic Code shows a simple order of operations for building and submitting a RequestArray object, submitting it to the web service and retrieving a response object.

Step 1 – Create the Request and Response Objects

Dim ReqRBDI As New dqwsRBDI.RequestArray
Dim ResRBDI As New dqwsRBDI.ResponseArray

Step 2 – Assign the General Request Values

There are two properties of the Request Array object that apply to the request as a whole. CustomerID is required.

ReqRBDI.CustomerID = strCustID
ReqRBDI.TransmissionReference = strTranRef

The Transmission Reference is a unique string value that identifies this request array.

Step 3 – Dimension the Record Array

The maximum number of records per request is 100, therefore the largest dimension will be 99.

ReDim ReqRBDI.Record(99)

For maximum efficiency, you should dimension the array using the exact number of records being submitted minus one.

Step 4 – Build the Record Array

The exact method for building the array will depend on the exact database software in use, but you will need to loop through every record to be submitted and assign the required values to the corresponding elements for each record in the RequestArray.

ReqRBDI.Record(intRecord) = New dqwsRBDI.RequestArrayRecord
ReqRBDI.Record(intRecord).AddressKey = "92688211282"

The lines above show only the elements that are absolutely required to submit a record to the web service.

Repeat for each record being submitted with the current RequestArray.

Step 5 – Submit the Request Array

The final step is to create the Service Client Object and then submit the RequestArray object doRBDI method. This sends the data to the web service and retrieves the ResponseArray object.

RBDIClient = New dqwsRBDI.Service
ResRBDI = RBDIClient.doRBDI(ReqRBDI)
RBDIClient.Dispose()

XML Request#

The raw XML request is built using whatever XML tools are available via your development tools and submitted to the following URL using an HTTP POST request.

https://RBDI.melissadata.net/v2/XML/Service.svc/doRBDI

Rather than an array of Record object, an XML request contains a <Record> element for each address record, up to 100.

The following XML Code contains the same request as the SOAP example about.

<?xml version="1.0" ?>
<RequestArray xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <TransmissionReference xmlns="urn:mdWebServiceRBDI">Test</TransmissionReference>
  <CustomerID xmlns="urn:mdWebServiceRBDI">XXXXXXXX</CustomerID>
  <Record xmlns="urn:mdWebServiceRBDI">
    <AddressKey>92688211282</AddressKey>
  </Record>
</RequestArray>

REST Request#

A REST request can submit a single address record via an HTTP GET. The following example uses the same address as the SOAP and XML samples.

https://RBDI.melissadata.net/v2/REST/Service.svc/doRBDI?id=12345678&t=RestTest&key=92688211282

The record ID element does not exist for the REST interface, since you can only submit a single record per request.

Request Elements#

The following section lists the elements that set the basic options for each and identify the user to the web service.

Customer ID#

This is a required string value containing the identifier number issued to the customer when signing up for Melissa Data Web Services.

You need a customer ID to access any Melissa Data web service. If this element is not populated, the web service will return an error. To receive a customer ID, call your Melissa Data sale representative.

SOAP#

Request.CustomerID = string

XML#

<RequestArray>
  <CustomerID>String</CustomerID>
</RequestArray>

REST#

id={CustomerID}

Transmission Reference#

This is an optional string value that may be passed with each Request Array to serve as a unique identifier for this set of records.

This value is returned as sent by the Response Array, allowing you to match the Response to the Request.

SOAP#

Request.TransmissionReference = string

XML#

<RequestArray>
  <TransmissionReference>String</TransmissionReference>
</RequestArray>

REST#

t={transMissionReference}

Record Elements#

For the SOAP and XML web services, the Request Array will contain an element or property called Record. In SOAP this property is an array of object variables of the type Record. XML will have as many Record elements as there are addresses being submitted to the web service.

The REST interface only allows a single record per request.

Record ID#

This element is a string value containing a unique identifier for the current record.

Use this element to match the record with the record returned with the Response Array.

When using the SOAP interface, if this element is not populated, the web service will automatically insert a sequential number for each record.

There is no equivalent for Record ID for the REST interface.

SOAP#

Request.Record().RecordID = string

XML#

<RequestArray>
  <Record>
    <RecordID>String</RecordID>
  </Record>
</RequestArray>

AddressKey#

This element is a required eleven-character string value containing a unique number representing a specific location.

This value is returned by submitting an address record to the Address Verifier service.

SOAP#

Request.Record().AddressKey = string

XML#

<RequestArray>
  <Record>
    <AddressKey>String</AddressKey>
  </Record>
</RequestArray>

REST#

key={AddressKey}

Delivery Indicator Response#

The SOAP interface for the Delivery Indicator service returns a ResponseArray Object. The primary component of this object is an array of Record objects, one for each record submitted with the RequestArray, containing the verified and standardized address data.

The XML interface returns an XML document containing a number of <Record> elements, one for each record submitted with the Request, containing the verified and standardized address data.

The REST interface returns an XML document with a single <Record> element.

TransmissionReference#

Returns a string value containing the contents of the TransmissionReference element from the original Request.

If you passed any value to the TransmissionReference element when building your request, it is returned here. You can use this property to match the response to the request.

SOAP#

string = Response.TransmissionReference

XML#

<ResponseArray>
  <TransmissionReference>String</TransmissionReference>
</ResponseArray>

Total Records#

Returns a string value containing the number records returned with the current response.

This property returns the number of records processed and returned by the response as a string value.

SOAP#

string = Response.TotalRecords

XML#

<ResponseArray>
  <TotalRecords>String</TotalRecords>
</ResponseArray>

Results#

Returns a string value containing the general and system error messages from the most recent request sent to the service.

Do not confuse this element with the Results element returned with each record. This element returns error messages caused by the most recent request as a whole.

For a list of these codes, see Delivery Indicator - Service Level Result Codes.

SOAP#

string = Response.Results

XML#

<ResponseArray>
  <Results>String</Results>
</ResponseArray>

Version#

Returns a string value containing the current version number of the Delivery Indicator web service.

SOAP#

string = Response.Version

XML#

<ResponseArray>
  <Version>String</Version>
</ResponseArray>

Record Elements#

The SOAP version of the Response Array returns a property called Record which is an array of Record objects, one for each record submitted with the original Request Array.

The XML service returns one <Record> element for every record submitted with the original request.

The REST response is identical to the XML response, but will only contain a single <Record> element.

The following section describes the elements returned by each record in the Response Array.

Record ID#

For each record in the Response Array, this element returns a string value containing the unique identifier for the current record if one was passed to the Request Array.

Use this element to match the record in the Response Array with the record originally passed with the request.

SOAP#

string = Response.Record().RecordID

XML#

<ResponseArray>
  <Record>
    <RecordID>String</RecordID>
  </Record>
</ResponseArray>

Results#

For each record in the Response Array, this element returns a string value containing either the RBDI status of the location represented by the submitted address key or an error code if the service was unable to process the submitted data.

This element returns the status and error messages for each record in the Response Array.

The Result element may return one or more four-character strings, separated by commas, depending on the result generated by the current record.

If the address in the current record was verified, this element will contain the value GS01 at the very minimum and may include more of the GS codes. If the address could not be verified, the codes beginning with GE will indicate the reason or reasons why verification failed.

For a list of these codes, see Delivery Indicator - Record Level Result Codes.

SOAP#

string = Response.Record().Results

XML#

<ResponseArray>
  <Record>
    <Address>
      <Results>String</Results>
    </Address>
  </Record>
</ResponseArray>

Response Object XML Format#

The following shows the structure of the XML document returned by the WebSmart Delivery Indicator service.

<?xml version="1.0" ?>
<ResponseArray xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Version xmlns="urn:mdWebServiceRBDI">2.0.30</Version>
  <TransmissionReference xmlns="urn:mdWebServiceRBDI">Test
  </TransmissionReference>
  <Results xmlns="urn:mdWebServiceRBDI" />
  <TotalRecords xmlns="urn:mdWebServiceRBDI">1</TotalRecords>
  <Record xmlns="urn:mdWebServiceRBDI">
    <RecordID>1</RecordID>
    <Address>
      <Results>DS02</Results>
    </Address>
  </Record>
</ResponseArray>