English
  1. Home
  2. Security
  3. Unlock

Unlock

Remove password protection from PDF document

copy
Something went wrong, try again
copy
            
                    
        
Body parameter
Parameter VALUE DESCRIPTION

unlockRequest

Required

copy
UnlockRequest Unlock PDF file
UnlockRequest
Parameter VALUE DESCRIPTION

OwnerPasswordBase64

Required

string Base64 encrypted owner password

PdfBase64File

Required

close-icon
string Base64 encoded PDF document to process
copy Copy to clipboard
        
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.conholdate.cloud/v5.0/pdf/security/unlock"
  method := "POST"

  payload := strings.NewReader(`{
      "OwnerPasswordBase64": "Base64 encoded string...",
      "PdfBase64File": "Base64 encoded file...",
    }`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
                   
         
            
File file = new File("path/to/file/fileName.pdf");
byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(file));
String base64EncodedFile = new String(encoded, StandardCharsets.US_ASCII);

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, 
    "{" +
      "\"OwnerPasswordBase64\": \"Base64 encoded string...\"," +
      "\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
    "}");

Request request = new Request.Builder()
  .url("https://api.conholdate.cloud/v5.0/pdf/security/unlock")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();

Response response = client.newCall(request).execute();
                   
        
            
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.conholdate.cloud/v5.0/pdf/security/unlock',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
      "OwnerPasswordBase64": "Base64 encoded string...",
      "PdfBase64File": "Base64 encoded file...",
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                   
        
            
import requests
import json

url = "https://api.conholdate.cloud/v5.0/pdf/security/unlock"

json_data = json.dumps({
      "OwnerPasswordBase64": "Base64 encoded string...",
      "PdfBase64File": "Base64 encoded file...",
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=json_data)

print(response.text)
                   
        
            
curl --location --request POST 'https://api.conholdate.cloud/v5.0/pdf/security/unlock' \
--header 'Content-Type: application/json' \
--data-raw '{
      "OwnerPasswordBase64": "Base64 encoded string...",
      "PdfBase64File": "Base64 encoded file...",
}'
                   
        
            
require "uri"
require "json"
require "net/http"

url = URI("https://api.conholdate.cloud/v5.0/pdf/security/unlock")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
      "OwnerPasswordBase64": "Base64 encoded string...",
      "PdfBase64File": "Base64 encoded file...",
})

response = https.request(request)
puts response.read_body

                   
        
            
var client = new RestClient("https://api.conholdate.cloud/v5.0/pdf/security/unlock");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = "{" + 
      "\"OwnerPasswordBase64\": \"Base64 encoded string...\"," +
      "\"PdfBase64File\": \"" + base64EncodedFile + "\"," +
"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
                       
            
Overview

About Unlock Method

On this page, you can find detailed instructions on how to effectively use our cloud API to remove the owner's password from your PDF files in various programming languages, including Go, Java, PHP, Python, Curl, Ruby, and C#. Please note that our API does not crack passwords. The "Unlock" method of the Security API is designed to easily remove the owner's or user's password if they are no longer required.


Programming languages the API is compatible with

Our API uses the REST protocol, making it compatible with popular programming languages such as Go, Java, PHP, Python, Curl, Ruby, and C# etc.

Easy to use

Our API Reference and Guide is designed to be straightforward and easy to use, providing all the information you need to get started quickly. Additionally, our API Libraries come with their own set of documentation, making integration into your application a breeze. With our comprehensive resources, you can efficiently leverage our API to meet your needs.

Secure

At our company, we place a high priority on your security and privacy. To protect your private data, we never store it in our environment and offer isolated options. We understand the importance of keeping your information safe and take all necessary measures to ensure that it remains secure.
Unlock PDF File
clock
Add a File
To ensure seamless and precise protection of your PDF file using the "Unlock" method (Security API), it is crucial to confirm that the file you are working with matches the one specified in the method. This ensures that the appropriate password removing method (user or owner password) is used to effectively safeguard your file during processing.
arrow
clock
Run the Code
To run the code, copy and paste it into a file and execute it from the same directory where you added the necessary files. For further details, refer to our language-specific guides on how to get started.
arrow
clock
View the Result
To access the results of the "Unlock" method (Security API), you can simply open the file received as the output, which will be located in your project folder. If you opt to use the "Unlock" method online to remove password from your PDF file, the process will automatically generate a password-removed PDF file, which will be promptly downloaded for your convenience.
clock
How long does it takes to remove password from PDF file using "Unlock" method (Security API)?
Our Security API, particularly the "Unlock" method, is optimized for fast and efficient file processing. With our service, you can expect rapid results, often delivered within seconds, allowing you to swiftly remove password from your PDF fileand streamline your workflow for enhanced productivity.
clock
Is it safe to use "Unlock" method (Security API)?
Ensuring the safety and privacy of your data is our highest priority. As a company, we have implemented robust measures to secure your information. We do not store any files submitted for processing, and they are processed solely to provide you with the desired results. Your security and confidentiality are of utmost importance to us, and we take every precaution to safeguard your data throughout the entire process. It's important to note that our API does not crack passwords. The "Unlock" method of the Security API is designed to easily remove the owner's or user's password if they are no longer required.
clock
What output can I expect from the "Unlock" method (Security API)?
With our "Unlock" method (Security API), you can easily remove the password from your PDF document. It's important to note that we do not crack passwords, and our API only processes two types of passwords - the owner's password and the user's password, which was set by the owner. As a result of the processing, you will receive a password-free PDF document.
clock
How does method “Unlock” (Security API) works?
With our "Unlock" method (Security API), you can easily remove a password from your PDF file. Our user-friendly and seamless process allows you to effortlessly upload your file, click the "POST" button, and quickly receive the results, typically within seconds. The output will be password-free PDF file. To integrate this method into your project, simply copy and use the provided code examples in the programming language of your choice for smooth and efficient integration. Our API is designed to work seamlessly with popular programming languages like Go, Java, PHP, Python, Curl, Ruby, C#, and more, utilizing the REST protocol for smooth integration and compatibility.
FAQ

Frequently Asked Questions

We encourage you to review our Frequently Asked Questions (FAQ) section for answers to common inquiries. If you do not find the information you need, our dedicated support service is readily available to assist you with any additional questions or concerns. Don't hesitate to reach out for further assistance.