In this guide, we'll walk through the different steps of successfully retrieving a user from the Central Directory.
- Registering a user with the Central End User Registry
- Registering a DFSP with the Central Directory
- Looking up a user in the Central Directory
- Next Steps
Start off by registering a user with the url http://dfsp1.com. Simply provide the user's url and make a call to the register user endpoint. More detail about the response and errors can be found in the Central End User Registry API documentation.
POST http://central-end-user-registry/users
Content-Type: application/json
{
"url": "http://user.dfsp.com"
}
HTTP/1.1 201 Created
{
"url": "http://user.dfsp.com",
"number": "17141140"
}
Once you have registered a user in the Central End User Registry, you need to register a DFSP with the Central Directory. This DFSP will simply be called dfsp1. A more in depth explanation can be found in the API documentation.
To register a DFSP with the directory, you need to authorize the call using HTTP basic auth with an admin key and secret.
Key | Secret |
---|---|
admin | admin |
POST http://central-directory/commands/register HTTP/1.1
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4=
{
"name": "The first DFSP",
"shortName": "dfsp1",
"providerUrl": "http://url.com"
}
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"name": "The first DFSP",
"shortName": "dfsp1",
"providerUrl": "http://url.com",
"key": "dfsp_key",
"secret": "dfsp_secret"
}
Now that you have created a user and registered a new DFSP, you can proceed with looking up the user in the Central Directory. Like before, more information can be found in the API documentation.
To retrieve the user from the directory, you need to authorize the call using HTTP basic auth with the key and secret returned from the register DFSP command above.
Key | Secret |
---|---|
dfsp1 | dfsp1 |
http://central-directory/resources/?identifierType=eur:17141140 HTTP/1.1
Authorization: Basic ZGZzcDE6ZGZzcDE=
HTTP/1.1 200 OK
[
{
"name": "The First DFSP",
"providerUrl": "http://dfsp/users/1",
"shortName": "dsfp1",
"primary": "true",
"registered": "true"
}
]
Now that you have succesfully created a DSFP and looked up a user, you should feel comfortable working with the other endpoints found in the Central End User Registry API documentation and the Central Directory API documentation.