/get_entities
Return all end-user and legal entities (businesses) associated with a customer application.
This endpoint allows the listing of all entities registered to an application.
Requests
The optional entity_type field is used to filter for entities which only match the specified type. The only supported values are one of: [individual
, business
]
Results are paginated. The page
and per_page
keys can be specified in query parameters (e.g. by appending ?page=2&per_page=2
or >?per_page=100
to the end of the URL).
Authorization / Authentication
header.user_handle
should have the registered handle to be verified.
Apps using Access Token Authorization
Use a valid access token in an Authorization: Bearer request header.
See Authenticating with an Access Token for more details.
Apps using ECDSA Authentication
Only the authsignature
header is required for this request. See the section on ECDSA Authentication for more detail about ECDSA signature generation.
Note - We recently renamed the field auth_handle
to app_handle
. For backward compatibility, auth_handle
is still valid but has been removed from our documentation.
POST /0.2/get_entities HTTP/1.1
sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
{
"header": {
"created": 1234567890,
"app_handle": "handle.silamoney.eth",
"version": "0.2",
"reference": "<your unique id>"
},
"message": "header_msg",
"entity_type": "optional_entity_type_filter"
}
***
HTTP/1.1 200 OK
{
"success": true,
"status": "SUCCESS",
"response_time_ms": "171",
"reference": "<your unique id>",
"entities": {
"individuals": [
{
"handle": "app_user_1",
"full_name": "Test User",
"created": 1587169254,
"status": "active",
"wallet_addresses": []
]
},
{
"handle": "app_user_2",
"full_name": "Test User",
"created": 1587169254,
"status": "active",
"wallet_addresses": []
]
}
],
"businesses": [
{
"handle": "biz_entity_1",
"full_name": "Test User",
"created": 1587169254,
"status": "active",
"wallet_addresses": [],
"uuid": "2c43d338-93aa-4132-8433-a5eef45da82d",
"business_type": "sole_proprietorship",
"dba": ""
},
{
"handle": "biz_entity_2",
"full_name": "Test User",
"created": 1587169254,
"status": "active",
"uuid": "cc373292-56c9-4159-ac47-b1a680a018f3",
"business_type": "llc",
"dba": "S701X7OeuLnc"
}
]
},
"pagination": {
"returned_count": 4,
"total_count": 4,
"current_page": 1,
"total_pages": 1
}
}
const pagination = {
page: 1,
perPage: 1
}; // pagination and its properties are optional
const res = await sila.getEntities(entity_type, pagination); // Entity type is optional, it can be 'individual' or 'business'
// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.success); // TRUE
console.log(res.data.status);
console.log(res.data.entities.individuals);
console.log(res.data.entities.individuals[0].handle);
console.log(res.data.entities.individuals[0].full_name);
console.log(res.data.entities.individuals[0].created);
console.log(res.data.entities.individuals[0].status);
console.log(res.data.entities.individuals[0].blockchain_addresses);
console.log(res.data.entities.businesses);
console.log(res.data.entities.businesses[0].handle);
console.log(res.data.entities.individuals[0].full_name);
console.log(res.data.entities.individuals[0].created);
console.log(res.data.entities.individuals[0].status);
console.log(res.data.entities.individuals[0].blockchain_addresses);
console.log(res.data.entities.individuals[0].uuid);
console.log(res.data.entities.individuals[0].business_type);
console.log(res.data.entities.individuals[0].dba);
console.log(res.data.pagination);
console.log(res.data.pagination.returned_count);
console.log(res.data.pagination.total_count);
console.log(res.data.pagination.current_page);
console.log(res.data.pagination.total_pages);
payload = {
"entity_type": "individual | business"
}
response = User.getEntities(app, payload, per_page, page)
# Success Response
{
"status": 'SUCCESS',
"success": true,
"entities": {
"individuals": [
{
"handle": "app_user_1",
"full_name": "Test User",
"created": 1587169254,
"status": "active",
"blockchain_addresses": [
"0x0558fE768Bb4fA4D85d9A21Bf855A15Cb2841377"
]
},
...
],
"businesses": [
{
"handle": "biz_entity_1",
"full_name": "Test User",
"created": 1587169254,
"status": "active",
"blockchain_addresses": [
"0x200a260a21b4cBd17887F179549C7337FF63e0Bb"
],
"uuid": "2c43d338-93aa-4132-8433-a5eef45da82d",
"business_type": "sole_proprietorship",
"dba": ""
},
...
]
},
"pagination": {
"returned_count": 5,
"total_count": 5,
"current_page": 1,
"total_pages": 1
}
}
int page = 1;
int perPage = 50;
ApiResponse response = api.getEntities("entity type", page, perPage);
// Success Object Response
System.out.println(response.getStatusCode()); // 200
((GetEntitiesResponse)response.getData()).isSuccess(); // true
((GetEntitiesResponse)response.getData()).getEntities(); // Entities object
((GetEntitiesResponse)response.getData()).getPagination();// Pagination object
((GetEntitiesResponse)response.getData()).getPagination().getReturnedCount(); // 1
((GetEntitiesResponse)response.getData()).getPagination().getTotalCount(); // 1
((GetEntitiesResponse)response.getData()).getPagination().getCurrentPage(); // 1
((GetEntitiesResponse)response.getData()).getPagination().getTotalPages(); // 1
((GetEntitiesResponse)response.getData()).getEntities().getIndividuals(); // List of individual entities
((GetEntitiesResponse)response.getData()).getEntities().getIndividuals().get(0).getHandle();
((GetEntitiesResponse)response.getData()).getEntities().getIndividuals().get(0).getFullName();
((GetEntitiesResponse)response.getData()).getEntities().getIndividuals().get(0).getCreated();
((GetEntitiesResponse)response.getData()).getEntities().getIndividuals().get(0).getStatus();
((GetEntitiesResponse)response.getData()).getEntities().getIndividuals().get(0).getBlockchainAddresses();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses();// List of business entities
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getHandle();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getFullName();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getStatus();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getCreated();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getBlockchainAddresses();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getBusinessType();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getBlockchainAddresses();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getUuid();
((GetEntitiesResponse)response.getData()).getEntities().getBusinesses().get(0).getDba();
$type = null; // Optional. Can be set to 'individual' or 'business'
$page = 1; // Optional. The page number to get
$perPage = 5; // Optional. The number of entities per page
$response = $client->getEntities($type, $page, $perPage);
// Response 200
echo $response->getData()->success; // TRUE
echo $response->getData()->status;
echo $response->getData()->entities; // An object that contains the results (individuals and businesses)
echo $response->getData()->entities->individuals; // An array of individual entities (handle, full name, status...)
echo $response->getData()->entities->individuals[0]->handle;
echo $response->getData()->entities->individuals[0]->full_name;
echo $response->getData()->entities->individuals[0]->created;
echo $response->getData()->entities->individuals[0]->status;
echo $response->getData()->entities->individuals[0]->blockchain_addresses;
echo $response->getData()->entities->businesses; // An array of business entities (handle, full name, status...)
echo $response->getData()->entities->businesses[0]->handle;
echo $response->getData()->entities->businesses[0]->full_name;
echo $response->getData()->entities->businesses[0]->created;
echo $response->getData()->entities->businesses[0]->status;
echo $response->getData()->entities->businesses[0]->blockchain_addresses;
echo $response->getData()->entities->businesses[0]->uuid;
echo $response->getData()->entities->businesses[0]->business_type;
echo $response->getData()->entities->businesses[0]->dba;
echo $response->getData()->pagination; // Pagination details (returned count, total count, current page, total pages)
echo $response->getData()->pagination->returned_count;
echo $response->getData()->pagination->total_count;
echo $response->getData()->pagination->current_page;
echo $response->getData()->pagination->total_pages;
string entityTypeFilter = null; // Optional. Can be set to 'individual' or 'business'
int page = 1; // Optional. The page number to get
int perPage = 5; // Optional. The number of entities pe
ApiResponse<object> response = api.GetEntities(entityTypeFilter, page, perPage);//Type filter is optional.
// Success response object
Console.WriteLine(response.StatusCode); // 200
var parsedData = (GetEntitiesResponse)response.Data;
Console.WriteLine(parsedData.Success);
Console.WriteLine(parsedData.Entities.Individuals); // Individual entities list
Console.WriteLine(parsedData.Entities.Businesses); // Business entities list
Console.WriteLine(parsedData.Pagination); // Business entities list
Console.WriteLine(parsedData.Entities.Individuals[0].Handle);
Console.WriteLine(parsedData.Entities.Individuals[0].FullName);
Console.WriteLine(parsedData.Entities.Individuals[0].Created);
Console.WriteLine(parsedData.Entities.Individuals[0].Status);
Console.WriteLine(parsedData.Entities.Individuals[0].BlockchainAddresses);
Console.WriteLine(parsedData.Entities.Businesses[0].Uuid);
Console.WriteLine(parsedData.Entities.Businesses[0].BusinessType);
Console.WriteLine(parsedData.Entities.Businesses[0].Dba);
Console.WriteLine(parsedData.Pagination.ReturnedCount);
Console.WriteLine(parsedData.Pagination.TotalCount);
Console.WriteLine(parsedData.Pagination.CurrentPage);
Console.WriteLine(parsedData.Pagination.TotalPages);
Key | Type | Description | Mandatory |
---|---|---|---|
header | JSON object | Requires these keys in JSON format: created, app_handle. See the /check_handle endpoint for the complete list of fields in this object. | YES |
entity_type | String | The optional entity_type field is used to filter. Choose 'individual' or 'business' only. Example: individual | NO |
Responses
The success
attribute is a JSON key sent in the response body.
Status Code | status Attribute | Description |
---|---|---|
200 | true | Successfully retrieved and returned the entity list. |
400 | false | Bad request format. |
Updated 2 days ago