wendyguo | Posts: 74

how to create a package with document visibility by rest API

0 votes

I'd like to know how to set document visibility when create a package by using REST API? could you please share a sample code?

Thanks

Wendy


Duo_Liang | Posts: 3776

Reply to: how to create a package with document visibility by rest API

0 votes

Hi Wendy,

 

Document visibility is not part of the package JSON, therefore you need a separate API to specify it:
POST /api/packages/{packageId}/documents/visibility

Accept: application/json

Content-Type: application/json

Authorization: Basic api_key

 

{
  "configurations": [
    {
      "documentUid": "doc1",
      "roleUids": [
        "Signer1"
      ]
    },
    {
      "documentUid": "doc2",
      "roleUids": [
        "Signer2"
      ]
    }
  ]
}

 

Duo


Duo_Liang | Posts: 3776

Reply to: how to create a package with document visibility by rest API

0 votes

Here is the equivalent code in Java SDK:

 

        DocumentVisibility visibility = DocumentVisibilityBuilder.newDocumentVisibility()
                .addConfiguration(DocumentVisibilityConfigurationBuilder.newDocumentVisibilityConfiguration("doc1").withSignerIds(Arrays.asList("Signer1","Signer2")))
                .addConfiguration(DocumentVisibilityConfigurationBuilder.newDocumentVisibilityConfiguration("doc2").withSignerIds(Arrays.asList("Signer1","Signer2")))
                .build();

        eslClient.configureDocumentVisibility(new PackageId("package_id"), visibility);

 

Duo


Eric | Posts: 3

Reply to: how to create a package with document visibility by rest API

0 votes

 

 


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off