M2M helper API to retrieve User object given a Decentralized Identifier (DID). API Key required for this call.
rpc GetUserByDID
GetUserByDID
user_api.v1.GetUserByDID
user_api.v1.GetUserByDID
M2M helper API to retrieve User object given a Decentralized Identifier (DID). API Key required for this call.
requests GetUserByDIDRequest
GetUserByDIDRequest
user_api.v1.GetUserByDIDRequest
user_api.v1.GetUserByDIDRequest
Field | Type | Description |
---|---|---|
did | string | W3C Decentralized Identifier (DID) of the wallet. |
resp, _ := userApiService.GetUserByDID(ctx, &v1.GetUserByDIDRequest{
Did: "did:method-name:zDIDMultibase58Encoded",
})
fmt.Println(resp)
const getuserbydidrequest = new GetUserByDIDRequest();
getuserbydidrequest.setDid("did:method-name:zDIDMultibase58Encoded");
service.getUserByDID(getuserbydidrequest, (err, value:GetUserByDIDResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using UserApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new UserApiService.UserApiServiceClient(channel);
var headers = new Metadata();
var getUserByDIDRequest = new GetUserByDIDRequest{
Did = "did:method-name:zDIDMultibase58Encoded",
};
var reply = client.GetUserByDID(getUserByDIDRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import user_api.v1.User.GetUserByDIDRequest;
import user_api.v1.User.GetUserByDIDResponse;
import user_api.v1.UserApiServiceGrpc;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
UserApiServiceGrpc.UserApiServiceBlockingStub blockStub =
UserApiServiceGrpc.newBlockingStub(channel);
GetUserByDIDRequest req_GetUserByDIDRequest =
GetUserByDIDRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.build();
GetUserByDIDResponse resp = blockStub.getUserByDID(req_GetUserByDIDRequest);
System.out.println(resp);
channel.shutdown();
}
}
const getuserbydidrequest = new GetUserByDIDRequest();
getuserbydidrequest.setDid("did:method-name:zDIDMultibase58Encoded");
service.getUserByDID(getuserbydidrequest, (err, value) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::user_api::v1::GetUserByDIDRequest;
use grpc-sdks::user_api::v1::user_api_service_client::UserApiServiceClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = UserApiServiceClient::new(channel);
let request = tonic::Request::new(
GetUserByDIDRequest{
did: String::from("did:method-name:zDIDMultibase58Encoded")
});
// sending request and waiting for response
let response = client.get_user_by_did(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import user_api.v1.User.GetUserByDIDRequest
import user_api.v1.User.GetUserByDIDResponse
import user_api.v1.UserApiServiceGrpc
fun main() {
val channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = UserApiServiceGrpc.newBlockingStub(channel)
val req_GetUserByDIDRequest = GetUserByDIDRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.build()
val resp = blockStub.getUserByDID(req_GetUserByDIDRequest)
println(resp)
channel.shutdown()
}
returns GetUserByDIDResponse
GetUserByDIDResponse
user_api.v1.GetUserByDIDResponse
user_api.v1.GetUserByDIDResponse
Field | Type | Description |
---|---|---|
user | User | User object of the subject. |
{
"user": {
"uuid": "UUID",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"role": 0,
"avatar": "AVATAR_URL",
"phone": "+1 555 555 5555",
"dids": [
"did:method-name:zDIDMultibase58Encoded",
"did:method-name:zDIDMultibase58Encoded"
],
"external_ids": [
{
"key": "KEY1",
"value": "VALUE1"
},
{
"key": "KEY2",
"value": "VALUE2"
}
],
"metadata": {
"fields": [
{
"key": "VALUE"
}
]
},
"account": "15436675"
}
}