Update User Preference
Product | D&B Direct 2.0 |
Product Code(s) | Not Applicable |
Options(s) | None |
Monitoring Available | No |
Interface | REST |
Method | POST |
Format(s) | JSON |
Service | User |
{version} | 2.2 |
2.2 Released On | October 3, 2013 |
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.
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.
{"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 } } } }}
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.