Cookies Settings

Loading

dnb-logo
Direct 2.0
Collapse

Update User Preference

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

This function allows a customer to modify or cancel a user preference.

Update History

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

What to do First

Feature Request

IMPORTANT: Please see the new Online Services Security Enhancement Release, effective November 09, 2020.

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

User Preferences can be removed by setting the status to "Cancelled"; however, if the item is referenced in a Notification Profile it may not be removed.

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 (Update)
POST https://direct.dnb.com/V2.2/userpreference
Content-Type: application/json
Authorization: <MyToken>

{
  "UpdatePreferenceRequest": {
    "@xmlns": "http://services.dnb.com/UserServiceV2.0",
    "TransactionDetail": { "ApplicationTransactionID": "ID-001" },
    "UpdatePreferenceRequestDetail": {
      "PreferenceDetail": {
        "PreferenceType": "Email",
        "ApplicationAreaName": "Monitoring",
        "PreferenceName": "John-email"
      },
      "PreferenceUpdateSpecification": {
        "ApplicationAreaName": "Monitoring",
        "PreferenceName": "John-updatedemail",
        "PreferenceValueText": "john_UpdatedEmail@mycompany.com",
        "PreferenceStatusText": "Active",
        "DefaultPreference": "true"
      }
    }
  }
}
Name Characteristics
UpdatePreferenceRequest Aggregate
UpdatePreferenceRequest@ServiceVersionNumber Attribute
UpdatePreferenceRequest { TransactionDetail Aggregate, Optional
UpdatePreferenceRequest { TransactionDetail { ApplicationTransactionID string up to 64 chars., Optional
UpdatePreferenceRequest { TransactionDetail { TransactionTimestamp DateTimestamp, Optional
UpdatePreferenceRequest { TransactionDetail { SubmittingOfficeID string up to 64 chars., Optional
END: UpdatePreferenceRequest } TransactionDetail /Aggregate
UpdatePreferenceRequest { UpdatePreferenceRequestDetail Aggregate, Required
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceDetail Aggregate, Required
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceDetail { PreferenceType PreferenceTypeEnum, Required
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceDetail { ApplicationAreaName ApplicationAreaEnum, Optional
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceDetail { PreferenceName string up to 64 chars., Optional
END: UpdatePreferenceRequest } UpdatePreferenceRequestDetail } PreferenceDetail /Aggregate
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification Aggregate, Required
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { ApplicationAreaName ApplicationAreaEnum, Optional
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { PreferenceName string up to 64 chars., Optional
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { PreferenceValueText string up to 1024 chars., Optional
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { UserCredentials Aggregate, Optional
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { UserCredentials { UserID string up to 64 chars., Required
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { UserCredentials { PasswordText string up to 64 chars., Required
END: UpdatePreferenceRequest } UpdatePreferenceRequestDetail } PreferenceUpdateSpecification } UserCredentials /Aggregate
UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { PreferenceStatusText PreferenceStatusTextEnum, Optional

Records the status of the monitoring profile

UpdatePreferenceRequest { UpdatePreferenceRequestDetail { PreferenceUpdateSpecification { DefaultPreference boolean, Optional
END: UpdatePreferenceRequest } UpdatePreferenceRequestDetail } PreferenceUpdateSpecification /Aggregate
END: UpdatePreferenceRequest } UpdatePreferenceRequestDetail /Aggregate
END: UpdatePreferenceRequest /Aggregate

Deleting a Preference

To remove a preference, change the status to "Cancelled" through an update request. Canceled items can be restored within 24-hours of the update, after which they are deleted by the system.

"PreferenceUpdateSpecification": {
     "PreferenceStatusText": "Cancelled"
},

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.

Sample Response (Update)
{"UpdatePreferenceResponse": {
   "@ServiceVersionNumber": "2.2",
   "TransactionDetail":    {
      "ApplicationTransactionID": "ID-001",
      "ServiceTransactionID": "Id-d60f7ad2524464bf0bfbffff-1",
      "TransactionTimestamp": "2013-09-26T12:45:51.983-04:00"
   },
   "TransactionResult":    {
      "SeverityText": "Information",
      "ResultID": "CM000",
      "ResultText": "Success"
   },
   "UpdatePreferenceResponseDetail":    {
      "UpdatedPreferenceCount": 1,
      "PreferenceDetail":       {
         "PreferenceType": "Email",
         "ApplicationAreaName": "Monitoring",
         "PreferenceName": "John-updatedemail",
         "PreferenceValueText": "john_UpdatedEmail@mycompany.com",
         "PreferenceStatusText": "Active",
         "DefaultPreference": true,
         "FormerPreferenceDetail":          {
            "ApplicationAreaName": "Monitoring",
            "PreferenceName": "John-email",
            "PreferenceValueText": "john@mycompany.com",
            "PreferenceStatusText": "Active",
            "DefaultPreference": false
         }
      }
   }
}}
Name Characteristics
UpdatePreferenceResponse Aggregate [M]
UpdatePreferenceResponse@ServiceVersionNumber Attribute [M]
UpdatePreferenceResponse { TransactionDetail Aggregate, Required [M]
UpdatePreferenceResponse { TransactionDetail { ApplicationTransactionID string up to 64 chars., Optional [M]
UpdatePreferenceResponse { TransactionDetail { ServiceTransactionID string up to 64 chars., Required [M]
UpdatePreferenceResponse { TransactionDetail { TransactionTimestamp DateTimestamp, Required [M]
END: UpdatePreferenceResponse } TransactionDetail /Aggregate [M]
UpdatePreferenceResponse { TransactionResult Aggregate, Required [M]
UpdatePreferenceResponse { TransactionResult { SeverityText string, Required [M]
UpdatePreferenceResponse { TransactionResult { ResultID string up to 32 chars., Required [M]
UpdatePreferenceResponse { TransactionResult { ResultText string up to 512 chars., Optional [M]
UpdatePreferenceResponse { TransactionResult { ResultMessage Aggregate, Optional (Array) [M]
UpdatePreferenceResponse { TransactionResult { ResultMessage { ResultDescription string up to 512 chars., Required [M]
END: UpdatePreferenceResponse } TransactionResult } ResultMessage /Aggregate [M]
END: UpdatePreferenceResponse } TransactionResult /Aggregate [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail Aggregate, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { UpdatedPreferenceCount int, Required [M]

A numeric value which records the count of preferences updated for the details provided by the customer in the request

UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail Aggregate, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { PreferenceType PreferenceTypeEnum, Required [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { ApplicationAreaName ApplicationAreaEnum, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { PreferenceName string up to 64 chars., Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { PreferenceValueText string up to 256 chars., Required [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { UserCredentials Aggregate, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { UserCredentials { UserID string up to 64 chars., Required [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { UserCredentials { PasswordText string up to 64 chars., Required [M]
END: UpdatePreferenceResponse } UpdatePreferenceResponseDetail } PreferenceDetail } UserCredentials /Aggregate [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { PreferenceStatusText PreferenceStatusTextEnum, Required [M]

Records the status of the monitoring profile

UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { DefaultPreference boolean, Required [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail Aggregate, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { ApplicationAreaName ApplicationAreaEnum, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { PreferenceName string up to 64 chars., Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { PreferenceValueText string up to 1024 chars., Required [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { UserCredentials Aggregate, Optional [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { UserCredentials { UserID string up to 64 chars., Required [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { UserCredentials { PasswordText string up to 64 chars., Required [M]
END: UpdatePreferenceResponse } UpdatePreferenceResponseDetail } PreferenceDetail } FormerPreferenceDetail } UserCredentials /Aggregate [M]
UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { PreferenceStatusText PreferenceStatusTextEnum, Required [M]

Records the status of the monitoring profile

UpdatePreferenceResponse { UpdatePreferenceResponseDetail { PreferenceDetail { FormerPreferenceDetail { DefaultPreference boolean, Required [M]
END: UpdatePreferenceResponse } UpdatePreferenceResponseDetail } PreferenceDetail } FormerPreferenceDetail /Aggregate [M]
END: UpdatePreferenceResponse } UpdatePreferenceResponseDetail } PreferenceDetail /Aggregate [M]
END: UpdatePreferenceResponse } UpdatePreferenceResponseDetail /Aggregate [M]
END: UpdatePreferenceResponse /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, CM004, CM007, 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.