Loading

Direct 2.0
Collapse

Create User Preference

ProductD&B Direct 2.0
Product Code(s)Not Applicable
Options(s)Email; HTTPCallBack; MQOutput
Monitoring AvailableNo
InterfaceREST
MethodPOST
Format(s)JSON
ServiceUser
{version}2.2
2.2 Released OnOctober 3, 2013

IMPORTANT: Version 2.2 is the latest available service for Direct 2.0 customers.

This function allows a customer to establish a profile for receiving communications from D&B Direct API services. Currently, this feature is utilized by Data Monitoring.

A User Preference captures the technical details required to deliver information through various protocols, including Email and HTTP Callback.

Update History

No modifications have been made to this data layer since the initial release.

Feature Request

IMPORTANT: Please see the new Online Services Security Enhancement Release, effective December 14, 2018.

Data Layer Entitlement

For customers in U.S. and Canadian markets, the API is provisioned for specific collections of products, reports, and/or features (collectively referred to as data layers) for production and trial usage. Entitlement is not required for testing in the sandbox environment.

  • This particular feature does not require entitlement for production and trial usage for D&B Direct 2.0 customers.

Specification

Possible values for Preference Type are Email; HTTPCallBack

The UserCredentials. UserID and UserCredentials. PasswordText parameters should be specified when reverse authentication (i.e., a D&B service contacting a customer's server, such as in an HTTPCallBack scenario) is required.

The URL value specified in PreferenceSpecification. PreferenceValueText is required to be a secure HTTP (i.e., https) link when HTTPCallBack is the preference type.

Restriction: The sequence of Request Parameters submitted to POST/PUT operations currently MUST follow the order presented in this section. This applies to REST calls only.

Restriction: An XML namespace statement MUST be included as the first statement within the primary Aggregate of the request. Please refer to the Sample Request for an example. This applies to REST calls only.

Sample Request (Create Email)
POST https://direct.dnb.com/V2.2/userpreference HTTP/1.1
Content-Type: application/json
Authorization: <MyToken>

{
  "user:CreatePreferenceRequest": {
    "@xmlns$user": "http://services.dnb.com/UserServiceV2.0",
    "user:TransactionDetail": { "user:ApplicationTransactionID": "John_Email_Pref_Creation" },
    "user:PreferenceRequestDetail": {
      "user:PreferenceSpecification": {
        "user:PreferenceType": "Email",
        "user:ApplicationAreaName": "Monitoring",
        "user:PreferenceName": "John-email",
        "user:PreferenceDescription": "John Email",
        "user:PreferenceValueText": "john@mycompany.com",
        "user:DefaultPreference": "false"
      }
    }
  }
}
Sample Request (Create HTTPcallback)
POST https://direct.dnb.com/V2.2/userpreference HTTP/1.1
Content-Type: application/json
Authorization: <MyToken>


{
  "user:CreatePreferenceRequest": {
    "@xmlns$user": "http://services.dnb.com/UserServiceV2.0",
    "user:TransactionDetail": { "user:ApplicationTransactionID": "John_Email_Pref_Creation" },
    "user:PreferenceRequestDetail": {
      "user:PreferenceSpecification": {
        "user:PreferenceType": "HTTPCallBack",
        "user:ApplicationAreaName": "Monitoring",
        "user:PreferenceName": "MyCompany-HTTPCallBack",
        "user:PreferenceDescription": "MyCompany's HTTPCallBack URI",
        "user:PreferenceValueText": "https://www.mycompany.com/uri",
        "user:DefaultPreference": "false"
      }
    }
  }
}
Name Characteristics
CreatePreferenceRequest Aggregate
CreatePreferenceRequest@ServiceVersionNumber Attribute
CreatePreferenceRequest { TransactionDetail Aggregate, Optional
CreatePreferenceRequest { TransactionDetail { ApplicationTransactionID string up to 64 chars., Optional
CreatePreferenceRequest { TransactionDetail { TransactionTimestamp DateTimestamp, Optional
CreatePreferenceRequest { TransactionDetail { SubmittingOfficeID string up to 64 chars., Optional
END: CreatePreferenceRequest } TransactionDetail /Aggregate
CreatePreferenceRequest { PreferenceRequestDetail Aggregate, Required
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification Aggregate, Required
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { PreferenceType

PreferenceTypeEnum, Required

Possible values: HTTPCallBack, Email, MQOutput

CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { ApplicationAreaName ApplicationAreaEnum, Optional
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { PreferenceName string up to 64 chars., Optional
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { PreferenceDescription string up to 256 chars., Optional
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { PreferenceValueText string up to 1024 chars., Required

For MQOutput Type, both MQ and AmazonSQS are supported.

Sample Template:

  • For MQ: mq://<HostName>:<PortNo>?QueueManager= <MyQueueManager>;Channel= <MyChannel>;RequestQueue=<MyRequestQueue>
  • For SQS: AmazonSQSName=<MySQSQueueName>;SecretKey=<MySecretKey>;AccessKey=<MyAccessKey>
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { UserCredentials Aggregate, Optional
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { UserCredentials { UserID string up to 64 chars., Required
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { UserCredentials { PasswordText string up to 64 chars., Required
END: CreatePreferenceRequest } PreferenceRequestDetail } PreferenceSpecification } UserCredentials /Aggregate
CreatePreferenceRequest { PreferenceRequestDetail { PreferenceSpecification { DefaultPreference boolean, Optional
END: CreatePreferenceRequest } PreferenceRequestDetail } PreferenceSpecification /Aggregate
END: CreatePreferenceRequest } PreferenceRequestDetail /Aggregate
END: CreatePreferenceRequest /Aggregate

Endpoint

Use the following endpoint for requesting this feature. The {version} is dependent on the underlying service delivering the response.

Endpoint (User)
POST https://direct.dnb.com/V{version}/userpreference

Testing

This operation has no additional limits or restrictions in the D&B Direct sandbox (test) environment.

Feature Response

NOTE: The D&B Direct REST implementation uses the BadgerFish approach for JSON with some minor variations.

Specification

The following is a list of the possible data fields returned by this operation in the JSON response. Samples are provided for testing successful and failed retrieval, and to demonstrate the basic layout of a response. The data returned in samples may not represent actual values that this feature will deliver.

NOTE: While this operation does not require that a PreferenceSpecification.UserCredentials aggregate be specified in the request, a Monitoring Notification Profile cannot be created if it references a UserPreference without credentials.

For testing HTTPCallBack scenarios, the URL value specified in PreferenceSpecification. PreferenceValueText may be any HTTP (i.e. secured or not secured) link.

Sample Response (Create Email)
{"CreatePreferenceResponse": {
   "@ServiceVersionNumber": "2.2",
   "TransactionDetail":    {
      "ApplicationTransactionID": "John_Email_Pref_Creation",
      "ServiceTransactionID": "Id-e28ed3dd524460fe1c9bffff-1",
      "TransactionTimestamp": "2013-09-26T12:29:51.256-04:00"
   },
   "TransactionResult":    {
      "SeverityText": "Information",
      "ResultID": "CM000",
      "ResultText": "Success"
   }
}}
Sample Response (Create HTTPcallback)
{"CreatePreferenceResponse": {
   "@ServiceVersionNumber": "2.2",
   "TransactionDetail":    {
      "ApplicationTransactionID": "John_Email_Pref_Creation",
      "ServiceTransactionID": "Id-87b3d8885244623c246b742e-1",
      "TransactionTimestamp": "2013-09-26T12:35:08.079-04:00"
   },
   "TransactionResult":    {
      "SeverityText": "Information",
      "ResultID": "CM000",
      "ResultText": "Success"
   }
}}
Name Characteristics
CreatePreferenceResponse Aggregate [M]
CreatePreferenceResponse@ServiceVersionNumber Attribute [M]
CreatePreferenceResponse { TransactionDetail Aggregate, Required [M]
CreatePreferenceResponse { TransactionDetail { ApplicationTransactionID string up to 64 chars., Optional [M]
CreatePreferenceResponse { TransactionDetail { ServiceTransactionID string up to 64 chars., Required [M]
CreatePreferenceResponse { TransactionDetail { TransactionTimestamp DateTimestamp, Required [M]
END: CreatePreferenceResponse } TransactionDetail /Aggregate [M]
CreatePreferenceResponse { TransactionResult Aggregate, Required [M]
CreatePreferenceResponse { TransactionResult { SeverityText string, Required [M]
CreatePreferenceResponse { TransactionResult { ResultID string up to 32 chars., Required [M]
CreatePreferenceResponse { TransactionResult { ResultText string up to 512 chars., Optional [M]
CreatePreferenceResponse { TransactionResult { ResultMessage Aggregate, Optional (Array) [M]
CreatePreferenceResponse { TransactionResult { ResultMessage { ResultDescription string up to 512 chars., Required [M]
END: CreatePreferenceResponse } TransactionResult } ResultMessage /Aggregate [M]
END: CreatePreferenceResponse } TransactionResult /Aggregate [M]
END: CreatePreferenceResponse /Aggregate [M]

Response Codes & Error Handling

Successful service requests will return a CM000 response code in the TransactionResult ResultID field. Otherwise, one of the D&B Direct standard response codes will be returned.

This operation may return the following response codes: CM002, CM0004, CM023, and SC001-SC009.

D&B Direct 2.0 API requests are provided on a metered basis; and may require entitlement prior to use in the production environment. In addition, a concurrency limit (QPS) is monitored to ensure that it is not exceeded. An error code will be returned in the event that a transaction is throttled.

While this operation is provided on a metered basis, usage is tracked; however, no billing for successful calls is recorded.

What to do Next