Add custom sandbox person¶
Warning
This is guide is only applicable to the sandbox environment.
Sometimes, you want to use your own data when testing. Consumer Intelligence (CI) provides functionality (in sandbox) for managing your own persons within CI.
Before you begin¶
The provided example values in this guide must be changed with the values of your client.
Replace <client_id>
with your client id, and <client_secret>
with your client secret.
Adding a sandbox person to CI¶
Step 1 - Setup¶
You must have already signed up as an organization with Dun & Bradstreet and have your sandbox credentials from the developer portal. See Getting started for help.
Step 2 - Authentication¶
First, you will need an access_token
from the
Authentication API
(POST:https://login.bisnode.com/sandbox/v1/token.oauth2
).
Don't forget to change credentials
Don't forget to replace <client_id>
with your client id, and <client_secret>
with your client secret.
The property access_token
from the response should be used for all other API requests in the Authorization
header as
the Bearer token.
Step 3 - Add a sandbox person¶
Use PUT:https://sandbox-api.bisnode.com/consumer-intelligence/sandbox/v1/persons
to add a person to CI.
Note
The id
-field is your id of this sandbox person that can later be used to update or delete the same person.
curl -X PUT https://sandbox-api.bisnode.com/consumer-intelligence/sandbox/v1/persons \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{
"id": "custom-id-123",
"country": "SE",
"legalId": "190101050953",
"firstName": "Kalle",
"familyName": "Customsson",
"dateOfBirth": "1901-01-05",
"gender": "Male",
"addressList": [
{
"type": "Postal",
"subType": "Domicile",
"restricted": "Confidential",
"careOf": "Kalle",
"streetName": "Sveavägen",
"streetNumber": "22",
"entrance": "A",
"country": "SE"
}
],
"phoneList": [
{
"type": "Mobile",
"number": "+46123456789"
}
],
"citizenship": ["SE"]
}'
In the response you will find a gedi
, save this for the next steps.
Step 4 - Verify sandbox person exists¶
Note
The process of adding persons to CI is asynchronous. If the person is not yet available, try again at a later time.
Use GET:/v3/persons/<gedi>}
to verify that the person you recently created exists.
Replace <gedi>
with the gedi
from the previous operation in Step 3.
Step 5 - Verify that you can find the person¶
Use POST:/v3/persons/_find
to find the person
Step 6 - Verify that you can subscribe¶
Use POST:/v3/consumers
to upload the consumer¶
Once the consumer is uploaded it should identify the person and create a subscription.
Use GET:/v3/consumers
to get the uploaded consumer¶
The uploaded consumer should be IDENTIFIED.
```bash
curl "https://sandbox-api.bisnode.com/consumer-intelligence/v3/consumers" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer
Use GET:/v3/subscriptions/persons
to get the latest versions of the subscribed person¶
Remove a sandbox person¶
Step 1 - Remove custom sandbox person¶
To remove the sandbox person previously added,
you use DELETE:https://sandbox-api.bisnode.com/consumer-intelligence/sandbox/v1/persons
,
adding your id
of the person in the request body.