Resolve

Returns a DID document entry for a given DID in the Knox Registry Management Service.

rpc Resolve

registry_api.v1.Resolve

Returns a DID document entry for a given DID in the Knox Registry Management Service.

requests ResolveRequest

registry_api.v1.ResolveRequest

FieldTypeDescription
didstringW3C Decentralized Identifier (DID) of the wallet.
resolutionOptionResolutionOptionW3C metadata structure for did resolution
resp, _ := registryService.Resolve(ctx, &v1.ResolveRequest{
  Did: "did:method-name:zDIDMultibase58Encoded",
  ResolutionOption: &v1.ResolutionOption{
    Accept: v1.ResolutionOptionAccept_RESOLUTION_OPTION_ACCEPT_UNSPECIFIED,
  },
})
fmt.Println(resp)
const resolutionoption = new ResolutionOption();
resolutionoption.setAccept(ResolutionOptionAccept.RESOLUTION_OPTION_ACCEPT_JSON_LD);
const resolverequest = new ResolveRequest();
resolverequest.setDid("did:method-name:zDIDMultibase58Encoded");
resolverequest.setResolutionoption(resolutionoption);

service.resolve(resolverequest, (err, value:ResolveResponse|null) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
using System;
using Grpc.Core;
using RegistryApi.V1;

namespace main
{
  class Program
  {
    static void Main(string[] args)
    {
      Channel channel = new Channel("reg.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure); 
      var client = new RegistryService.RegistryServiceClient(channel); 
      var headers = new Metadata();
      var resolutionOption = new ResolutionOption{
        Accept = ResolutionOptionAccept.Resolution_option_accept_unspecified,
      };
      var resolveRequest = new ResolveRequest{
        Did = "did:method-name:zDIDMultibase58Encoded",
        ResolutionOption = resolutionOption,
      };
      var reply = client.Resolve(resolveRequest, headers);
      Console.WriteLine("Response: " + reply);
      channel.ShutdownAsync().Wait();
    }
  }
}
package demo;

import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import registry_api.v1.Registry.ResolutionOption;
import registry_api.v1.Registry.ResolutionOptionAccept;
import registry_api.v1.Registry.ResolveRequest;
import registry_api.v1.Registry.ResolveResponse;
import registry_api.v1.RegistryServiceGrpc;

public class App {
  public static void main(String[] args) {
    ManagedChannel channel = ManagedChannelBuilder
      .forAddress("reg.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
      .usePlaintext()
      .build();
    RegistryServiceGrpc.RegistryServiceBlockingStub blockStub =
        RegistryServiceGrpc.newBlockingStub(channel);
    
    ResolutionOption req_ResolutionOption =
        ResolutionOption.newBuilder()
          .setAccept(ResolutionOptionAccept.RESOLUTION_OPTION_ACCEPT_UNSPECIFIED)
          .build();
    ResolveRequest req_ResolveRequest =
        ResolveRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setResolutionOption(req_ResolutionOption)
          .build();
    ResolveResponse resp = blockStub.resolve(req_ResolveRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const resolutionoption = new ResolutionOption();
resolutionoption.setAccept(ResolutionOptionAccept.RESOLUTION_OPTION_ACCEPT_UNSPECIFIED);
const resolverequest = new ResolveRequest();
resolverequest.setDid("did:method-name:zDIDMultibase58Encoded");
resolverequest.setResolutionoption(resolutionoption);

service.resolve(resolverequest, (err, value) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;

use grpc-sdks::registry_api::v1::registry_service_client::RegistryServiceClient;
use grpc-sdks::registry_api::v1::ResolutionOption;
use grpc-sdks::registry_api::v1::ResolutionOptionAccept;
use grpc-sdks::registry_api::v1::ResolveRequest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let channel = Channel::from_static("reg.YOUR_SANDBOX_ID.knoxnetworks.io")
    .connect()
    .await?;
  let mut client = RegistryServiceClient::new(channel); 

  let request = tonic::Request::new(
    ResolveRequest{
      did: String::from("did:method-name:zDIDMultibase58Encoded"),
      resolution_option: Some(ResolutionOption{
        accept: ResolutionOptionAccept::ResolutionOptionAcceptUnspecified as i32
      })
    });
// sending request and waiting for response
  let response = client.resolve(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import registry_api.v1.Registry.ResolutionOption
import registry_api.v1.Registry.ResolutionOptionAccept
import registry_api.v1.Registry.ResolveRequest
import registry_api.v1.Registry.ResolveResponse
import registry_api.v1.RegistryServiceGrpc

fun main() {
    val channel = ManagedChannelBuilder
            .forAddress("reg.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
            .usePlaintext()
            .build()
    var blockStub = RegistryServiceGrpc.newBlockingStub(channel)
    
    val req_ResolutionOption = ResolutionOption.newBuilder()
          .setAccept(ResolutionOptionAccept.RESOLUTION_OPTION_ACCEPT_UNSPECIFIED)
          .build()
    val req_ResolveRequest = ResolveRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setResolutionOption(req_ResolutionOption)
          .build()
    val resp = blockStub.resolve(req_ResolveRequest)
    println(resp)
    channel.shutdown()
}


returns ResolveResponse

registry_api.v1.ResolveResponse

FieldTypeDescription
didResolutionMetadataResolutionMetadataResolution Metadata object, with defined timestamps and content type.
didDocumentStructA set of data containing mechanisms to verify the DID and discover related services.
didDocumentMetadataDidDocumentMetadataThis structure contains metadata about the DID document contained in the didDocument property
{
  "didResolutionMetadata": {
    "contentType": "MEDIA_TYPE",
    "duration": 1000,
    "didUrl": {
      "did": "did:method-name:zDIDMultibase58Encoded",
      "methodName": "EXAMPLE_METHOD_NAME",
      "methodSpecificId": "METHOD_SPECIFIC_IDENTIFIER"
    },
    "error": "OPTIONAL_ERROR_MESSAGE"
  },
  "didDocument": {},
  "didDocumentMetadata": {
    "created": {
      "seconds": 0,
      "nanos": 0
    },
    "updated": {
      "seconds": 0,
      "nanos": 0
    }
  }
}