• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unable to upload template Document to adobe Sign using RestApi

New Here ,
Nov 24, 2021 Nov 24, 2021

Copy link to clipboard

Copied

Not Able to upload document to adobe Sign By using Rest Api
EndPoint :https://api.na1.adobesign.com/api/rest/v6/transientDocuments

Am trying like below

HttpHeaders headers=new HttpHeaders();
String token="Bearer "+getAccessToken();
headers.set("Authorization",token);
headers.setContentType(MediaType.MULTIPART_FORM_DATA);

HttpHeaders pdfHeaders=new HttpHeaders();
pdfHeaders.setContentType(MediaType.APPLICATION_PDF);
String fileName=consentFormDto.getFile().getOriginalFilename();
ByteArrayResource byteArrayResource=new ByteArrayResource(consentFormDto.getFile().getBytes()){
@Override
public String getFilename(){
return fileName;
}
};
HttpEntity<ByteArrayResource> pdfEntity=new HttpEntity<>(byteArrayResource,pdfHeaders);
MultiValueMap<String,Object> requestParts=new LinkedMultiValueMap<>();
requestParts.add("File",pdfEntity);
String url="https://api.na1.adobesign.com:443/api/rest/v6/transientDocuments";
HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(requestParts, headers);
String response = restTemplate.postForObject(url, requestEntity, String.class);

Attching error stack also

Please help to resolve This issue

TOPICS
Send documents

Views

254

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation