Resource redaction annotation fills black rectangle with fixed position (used if you want to hide some text)
API usage
There are steps that usage of GroupDocs.Annotation Cloud consists of:
Upload input document into cloud storage and other files, like image annotation (using File API)
Add annotation(s)
Download document with annotations (using File API)
HTTP POST ~/annotation/add
Swagger UI lets you call this REST API directly from the browser.
cURL example
# First get JSON Web Token# Replace CLIENT_ID and CLIENT_SECRET with your own credentials.curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"# cURL example to add annotation into documentcurl -v "https://api.groupdocs.cloud/v2.0/annotation/add"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer $JWT_TOKEN"\
-d '
{
'"'"'FileInfo'"'"': {
'"'"'FilePath'"'"': '"'"'annotationdocs/one-page.docx'"'"'
},
'"'"'OutputPath'"'"': '"'"'Output/output.docx'"'"',
'"'"'Annotations'"'"': [
{
'"'"'Type'"'"': '"'"'ResourcesRedaction'"'"',
'"'"'Text'"'"': '"'"'This is resource redaction annotation'"'"',
'"'"'CreatorName'"'"': '"'"'Anonym A.'"'"',
'"'"'Box'"'"': {
'"'"'X'"'"': 100,
'"'"'Y'"'"': 100,
'"'"'Width'"'"': 100,
'"'"'Height'"'"': 100
},
'"'"'PageNumber'"'"': 0,
'"'"'Replies'"'"': [
{
'"'"'Comment'"'"': '"'"'First comment'"'"',
'"'"'RepliedOn'"'"': '"'"'2020-10-02T06:52:01.376Z'"'"'
},
{
'"'"'Comment'"'"': '"'"'Second comment'"'"',
'"'"'RepliedOn'"'"': '"'"'2020-10-02T06:52:01.376Z'"'"'
}
],
'"'"'CreatedOn'"'"': '"'"'2020-10-02T06:52:01.376Z'"'"'
}
]
}
'
# First get JSON Web Token# Replace CLIENT_ID and CLIENT_SECRET with your own credentials.curl.exe-v"https://api.groupdocs.cloud/connect/token"`-XPOST`-d"grant_type=client_credentials&client_id=$env:CLIENT_ID&client_secret=$env:CLIENT_SECRET"`-H"Content-Type: application/x-www-form-urlencoded"`-H"Accept: application/json"# cURL example to add annotation into documentcurl.exe-v"https://api.groupdocs.cloud/v2.0/annotation/add"`-XPOST`-H"Content-Type: application/json"`-H"Accept: application/json"`-H"Authorization: Bearer $env:JWT_TOKEN"`-d"{
'FileInfo': {
'FilePath': 'annotationdocs/one-page.docx'
},
'OutputPath': 'Output/output.docx',
'Annotations': [
{
'Type': 'ResourcesRedaction',
'Text': 'This is resource redaction annotation',
'CreatorName': 'Anonym A.',
'Box': {
'X': 100,
'Y': 100,
'Width': 100,
'Height': 100
},
'PageNumber': 0,
'Replies': [
{
'Comment': 'First comment',
'RepliedOn': '2020-10-02T06:52:01.376Z'
},
{
'Comment': 'Second comment',
'RepliedOn': '2020-10-02T06:52:01.376Z'
}
],
'CreatedOn': '2020-10-02T06:52:01.376Z'
}
]
}"
rem First get JSON Web Tokenrem Replace CLIENT_ID and CLIENT_SECRET with your own credentials.curl -v "https://api.groupdocs.cloud/connect/token"^
-X POST ^
-d "grant_type=client_credentials&client_id=%CLIENT_ID%&client_secret=%CLIENT_SECRET%"^
-H "Content-Type: application/x-www-form-urlencoded"^
-H "Accept: application/json"rem cURL example to add annotation into documentcurl -v "https://api.groupdocs.cloud/v2.0/annotation/add"^
-X POST ^
-H "Content-Type: application/json"^
-H "Accept: application/json"^
-H "Authorization: Bearer %JWT_TOKEN%"^
-d "{\"FileInfo\":{\"FilePath\":\"annotationdocs/one-page.docx\"},\"OutputPath\":\"Output/output.docx\",\"Annotations\":[{\"Type\":\"ResourcesRedaction\",\"Text\":\"This is resource redaction annotation\",\"CreatorName\":\"Anonym A.\",\"Box\":{\"X\":100,\"Y\":100,\"Width\":100,\"Height\":100},\"PageNumber\":0,\"Replies\":[{\"Comment\":\"First comment\",\"RepliedOn\":\"2020-10-02T06:52:01.376Z\"},{\"Comment\":\"Second comment\",\"RepliedOn\":\"2020-10-02T06:52:01.376Z\"}],\"CreatedOn\":\"2020-10-02T06:52:01.376Z\"}]}"
The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-dotnet-samplesstringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudstringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyAppSid,MyAppKey);varapiInstance=newAnnotateApi(configuration);varfileInfo=newFileInfo{FilePath="one-page.docx"};AnnotationInfo[]annotations={newAnnotationInfo{Box=newRectangle{X=100,Y=100,Width=100,Height=100},PageNumber=0,Type=AnnotationInfo.TypeEnum.ResourcesRedaction,Text="This is resource redaction annotation",CreatorName="Anonym A.",CreatedOn=DateTime.Now,Replies=newList<AnnotationReplyInfo>{newAnnotationReplyInfo{Comment="First comment",RepliedOn=DateTime.Now},newAnnotationReplyInfo{Comment="Second comment",RepliedOn=DateTime.Now}}},};varoptions=newAnnotateOptions{FileInfo=fileInfo,Annotations=annotations.ToList(),OutputPath="Output/output.docx"};varlink=apiInstance.Annotate(newAnnotateRequest(options));Console.WriteLine("AddResourcesRedactionAnnotation: resources redaction Annotation added: "+link.Title);
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-java-samples
StringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
StringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyAppSid,MyAppKey);AnnotateApiapiInstance=newAnnotateApi(configuration);// Create annotation/s.
AnnotationInfo[]annotations=newAnnotationInfo[1];annotations[0]=newAnnotationInfo();Rectangler=newRectangle();r.setX(100.0);r.setY(100.0);r.setWidth(200.0);r.setHeight(100.0);annotations[0].setBox(r);annotations[0].setPageNumber(0);annotations[0].setType(TypeEnum.RESOURCESREDACTION);annotations[0].setText("This is resources redaction annotation");annotations[0].setCreatorName("Anonym A.");// Create request object.
FileInfofileInfo=newFileInfo();fileInfo.setFilePath("Annotationdocs\\one-page.docx");AnnotateOptionsoptions=newAnnotateOptions();options.setFileInfo(fileInfo);options.setAnnotations(Arrays.asList(annotations));options.setOutputPath("Output/one-page-annotated.docx");AnnotateRequestrequest=newAnnotateRequest(options);// Executing api method.
AnnotationApiLinkresult=apiInstance.annotate(request);System.out.println("AddResourcesRedactionAnnotation: Resources redaction Annotation added: "+result.getTitle());
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-php-samples
useGroupDocs\Annotation\Model;useGroupDocs\Annotation\Model\Requests;$AppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Annotation\Configuration();$configuration->setAppSid($AppSid);$configuration->setAppKey($AppKey);$apiInstance=newGroupDocs\Annotation\AnnotateApi($configuration);$a=newGroupDocs\Annotation\Model\AnnotationInfo();$pt=newGroupDocs\Annotation\Model\Point();$pt->setX(1);$pt->setY(1);$a->setAnnotationPosition($pt);$box=newGroupDocs\Annotation\Model\Rectangle();$box->setX(100);$box->setY(100);$box->setWidth(200);$box->setHeight(100);$a->setBox($box);$a->setPageNumber(0);$a->setType(GroupDocs\Annotation\Model\AnnotationInfo::TYPE_RESOURCES_REDACTION);$a->setText("This is resource redaction annotation");$a->setCreatorName("Anonym A.");$fileInfo=newGroupDocs\Annotation\Model\FileInfo();$fileInfo->setFilePath("annotationdocs\\one-page.docx");$options=newGroupDocs\Annotation\Model\AnnotateOptions();$options->setFileInfo($fileInfo);$options->setAnnotations([$a]);$options->setOutputPath("Output\\output.docx");$request=newGroupDocs\Annotation\Model\Requests\annotateRequest($options);$result=$apiInstance->annotate($request);echo"AddResourcesRedactionAnnotation: Resource redaction Annotation added: ".$result->getHref();
// For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-node-samples
global.annotation_cloud=require("groupdocs-annotation-cloud");global.appSid="XXXX-XXXX-XXXX-XXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.appKey="XXXXXXXXXXXXXXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.annotateApi=annotation_cloud.AnnotateApi.fromKeys(appSid,appKey);leta1=newannotation_cloud.AnnotationInfo();a1.box=newannotation_cloud.Rectangle();a1.box.x=100;a1.box.y=100;a1.box.width=200;a1.box.height=100;a1.pageNumber=0;a1.type=annotation_cloud.AnnotationInfo.TypeEnum.ResourcesRedaction;a1.text="This is Resources Redaction annotation";a1.creatorName="Anonym A.";letfileInfo=newannotation_cloud.FileInfo();fileInfo.filePath="annotationdocs\\one-page.docx";letoptions=newannotation_cloud.AnnotateOptions();options.fileInfo=fileInfo;options.annotations=[a1];options.outputPath="Output/output.docx";letresult=awaitannotateApi.annotate(newannotation_cloud.AnnotateRequest(options));console.log("AddResourcesRedactionAnnotation: Resources Redaction Annotation added: "+result.href);
# For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-python-samplesimportgroupdocs_annotation_cloudapp_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloudapp_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloudapi=groupdocs_annotation_cloud.AnnotateApi.from_keys(app_sid,app_key)a1=groupdocs_annotation_cloud.AnnotationInfo()a1.box=groupdocs_annotation_cloud.Rectangle()a1.box.x=100a1.box.y=100a1.box.width=200a1.box.height=100a1.page_number=0a1.type="ResourcesRedaction"a1.text="This is resource redaction annotation"a1.creator_name="Anonym A."file_info=FileInfo()file_info.file_path="annotationdocs\\one-page.docx"options=AnnotateOptions()options.file_info=file_infooptions.annotations=[a1]options.output_path="Output\\output.docx"request=AnnotateRequest(options)result=api.annotate(request)print("AddResourcesRedactionAnnotation: resource redaction Annotation added: "+result['href'])
# For complete examples and data files, please go to https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-ruby-samplesrequire'groupdocs_annotation_cloud'$app_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud$app_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud$api=GroupDocsAnnotationCloud::AnnotateApi.from_keys($app_sid,$app_key)$a1=GroupDocsAnnotationCloud::AnnotationInfo.new$a1.box=GroupDocsAnnotationCloud::Rectangle.new$a1.box.x=100$a1.box.y=100$a1.box.width=200$a1.box.height=100$a1.page_number=0$a1.font_color=1201033$a1.font_size=12$a1.opacity=0.7$a1.type="ResourcesRedaction"$a1.text="This is resource redaction annotatio"$a1.creator_name="Anonym A."file_info=GroupDocsAnnotationCloud::FileInfo.new()file_info.file_path="annotationdocs\\one-page.docx"options=GroupDocsAnnotationCloud::AnnotateOptions.new()options.file_info=file_infooptions.annotations=[$a1]options.output_path="Output/output.docx"$request=GroupDocsAnnotationCloud::AnnotateRequest.new(options)# Executing an API.result=$api.annotate($request)puts("AddResourcesRedactionAnnotation: resource redaction Annotation added: "+result.href)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.