Update

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

rpc Update

registry_api.v1.Update

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

requests UpdateRequest

registry_api.v1.UpdateRequest

FieldTypeDescription
didstringW3C Decentralized Identifier (DID) of the wallet.
documentstringA set of data containing mechanisms to verify the DID and discover related services.
resp, _ := registryService.Update(ctx, &v1.UpdateRequest{
  Did: "did:method-name:zDIDMultibase58Encoded",
  Document: "DOCUMENT",
})
fmt.Println(resp)
const updaterequest = new UpdateRequest();
updaterequest.setDid("did:method-name:zDIDMultibase58Encoded");
updaterequest.setDocument("DOCUMENT");

service.update(updaterequest, (err, value:UpdateResponse|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 updateRequest = new UpdateRequest{
        Did = "did:method-name:zDIDMultibase58Encoded",
        Document = "DOCUMENT",
      };
      var reply = client.Update(updateRequest, 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.UpdateRequest;
import registry_api.v1.Registry.UpdateResponse;
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);
    
    UpdateRequest req_UpdateRequest =
        UpdateRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setDocument("DOCUMENT")
          .build();
    UpdateResponse resp = blockStub.update(req_UpdateRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const updaterequest = new UpdateRequest();
updaterequest.setDid("did:method-name:zDIDMultibase58Encoded");
updaterequest.setDocument("DOCUMENT");

service.update(updaterequest, (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::UpdateRequest;

#[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(
    UpdateRequest{
      did: String::from("did:method-name:zDIDMultibase58Encoded"),
      document: String::from("DOCUMENT")
    });
// sending request and waiting for response
  let response = client.update(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import registry_api.v1.Registry.UpdateRequest
import registry_api.v1.Registry.UpdateResponse
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_UpdateRequest = UpdateRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setDocument("DOCUMENT")
          .build()
    val resp = blockStub.update(req_UpdateRequest)
    println(resp)
    channel.shutdown()
}


returns UpdateResponse

registry_api.v1.UpdateResponse

{}