ResolveRepresentation

Returns a byte stream of a DID document instead of a map in the Knox Registry Management Service.

rpc ResolveRepresentation

registry_api.v1.ResolveRepresentation

Returns a byte stream of a DID document instead of a map in the Knox Registry Management Service.

requests ResolveRepresentationRequest

registry_api.v1.ResolveRepresentationRequest

FieldTypeDescription
didstringW3C Decentralized Identifier (DID) of the wallet.
resolutionOptionResolutionOptionW3C metadata structure for did resolution
resp, _ := registryService.ResolveRepresentation(ctx, &v1.ResolveRepresentationRequest{
  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_UNSPECIFIED);
const resolverepresentationrequest = new ResolveRepresentationRequest();
resolverepresentationrequest.setDid("did:method-name:zDIDMultibase58Encoded");
resolverepresentationrequest.setResolutionoption(resolutionoption);

service.resolveRepresentation(resolverepresentationrequest, (err, value:ResolveRepresentationResponse|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 resolveRepresentationRequest = new ResolveRepresentationRequest{
        Did = "did:method-name:zDIDMultibase58Encoded",
        ResolutionOption = resolutionOption,
      };
      var reply = client.ResolveRepresentation(resolveRepresentationRequest, 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.ResolveRepresentationRequest;
import registry_api.v1.Registry.ResolveRepresentationResponse;
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();
    ResolveRepresentationRequest req_ResolveRepresentationRequest =
        ResolveRepresentationRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setResolutionOption(req_ResolutionOption)
          .build();
    ResolveRepresentationResponse resp = blockStub.resolveRepresentation(req_ResolveRepresentationRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const resolutionoption = new ResolutionOption();
resolutionoption.setAccept(ResolutionOptionAccept.RESOLUTION_OPTION_ACCEPT_UNSPECIFIED);
const resolverepresentationrequest = new ResolveRepresentationRequest();
resolverepresentationrequest.setDid("did:method-name:zDIDMultibase58Encoded");
resolverepresentationrequest.setResolutionoption(resolutionoption);

service.resolveRepresentation(resolverepresentationrequest, (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::ResolutionOption;
use grpc-sdks::registry_api::v1::ResolutionOptionAccept;
use grpc-sdks::registry_api::v1::ResolveRepresentationRequest;
use grpc-sdks::registry_api::v1::registry_service_client::RegistryServiceClient;

#[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(
    ResolveRepresentationRequest{
      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_representation(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.ResolveRepresentationRequest
import registry_api.v1.Registry.ResolveRepresentationResponse
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_ResolveRepresentationRequest = ResolveRepresentationRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setResolutionOption(req_ResolutionOption)
          .build()
    val resp = blockStub.resolveRepresentation(req_ResolveRepresentationRequest)
    println(resp)
    channel.shutdown()
}


returns ResolveRepresentationResponse

registry_api.v1.ResolveRepresentationResponse

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