Ledgerlets API

File

fileHashIdGet

Once the file's has was submitted, it takes

Get the file's proof of existence status. The response contains the URL for the proof file. keep a copy of it. To proof that your file existed, make sure the HashID exist in the proof file, then get the SHA1 signature of the proof file and lookup the result on etherscan for example: shasum -a 256 README.md | xargs bash -c 'curl https://ledgerlets.com/API/File/$0' results with the following: {'status':'submitted','batchId':'ce2174c19cd510daf9ba25656f10225829efe8c1', 'downloadProofFileUrl':'https://ledgerletsstorprod.blob.core.windows.net/batches/ce2174c19cd510daf9ba25656f10225829efe8c1.txt'} The name of the proof file is also the ID of the transaction on the blockchain which can validated like so: https://etherscan.io/address/0xce2174c19cd510daf9ba25656f10225829efe8c1


/file/{HashId}

Usage and SDK Samples

curl -X GET "https://www.ledgerlets.com/API/file/{HashId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FileApi;

import java.io.File;
import java.util.*;

public class FileApiExample {

    public static void main(String[] args) {
        
        FileApi apiInstance = new FileApi();
        String hashId = hashId_example; // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)
        try {
            File result = apiInstance.fileHashIdGet(hashId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FileApi#fileHashIdGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FileApi;

public class FileApiExample {

    public static void main(String[] args) {
        FileApi apiInstance = new FileApi();
        String hashId = hashId_example; // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)
        try {
            File result = apiInstance.fileHashIdGet(hashId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FileApi#fileHashIdGet");
            e.printStackTrace();
        }
    }
}
String *hashId = hashId_example; // SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

FileApi *apiInstance = [[FileApi alloc] init];

// Once the file's has was submitted, it takes 
[apiInstance fileHashIdGetWith:hashId
              completionHandler: ^(File output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var LedgerletsApi = require('ledgerlets_api');

var api = new LedgerletsApi.FileApi()

var hashId = hashId_example; // {String} SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.fileHashIdGet(hashId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class fileHashIdGetExample
    {
        public void main()
        {
            
            var apiInstance = new FileApi();
            var hashId = hashId_example;  // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

            try
            {
                // Once the file's has was submitted, it takes 
                File result = apiInstance.fileHashIdGet(hashId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FileApi.fileHashIdGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\FileApi();
$hashId = hashId_example; // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

try {
    $result = $api_instance->fileHashIdGet($hashId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FileApi->fileHashIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FileApi;

my $api_instance = WWW::SwaggerClient::FileApi->new();
my $hashId = hashId_example; # String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

eval { 
    my $result = $api_instance->fileHashIdGet(hashId => $hashId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FileApi->fileHashIdGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FileApi()
hashId = hashId_example # String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

try: 
    # Once the file's has was submitted, it takes 
    api_response = api_instance.file_hash_id_get(hashId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FileApi->fileHashIdGet: %s\n" % e)

Parameters

Path parameters
Name Description
HashId*
String
SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)
Required

Responses

Status: 200 - successful operation

Status: 400 - Invalid status value


fileHashIdPost

Proof your file by creating a SHA256 and using it as the **HashId**

**HashId** should be replaced with the SHA256 of the file, for example: curl -X POST "https://ledgerlets.com/API/file/ab533a1d51391171190991f6f337b2baab69bdc79cf9b8f2c21228881ad41712" Or another way as a one-liner: --------- shasum -a 256 /tmp/your_file.txt | xargs bash -c 'curl -X POST https://ledgerlets.com/API/File/$0' ---------- Replace your file with /tmp/your_file.zip listed above Once the file is submitted, it takes a few minutes and the file's signature is added to list of hashes which is marked on the blockchain. Use the GET operation listed below with the same HashID to get the status and the proof file


/file/{HashId}

Usage and SDK Samples

curl -X POST "https://www.ledgerlets.com/API/file/{HashId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.FileApi;

import java.io.File;
import java.util.*;

public class FileApiExample {

    public static void main(String[] args) {
        
        FileApi apiInstance = new FileApi();
        String hashId = hashId_example; // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)
        try {
            File result = apiInstance.fileHashIdPost(hashId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FileApi#fileHashIdPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.FileApi;

public class FileApiExample {

    public static void main(String[] args) {
        FileApi apiInstance = new FileApi();
        String hashId = hashId_example; // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)
        try {
            File result = apiInstance.fileHashIdPost(hashId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FileApi#fileHashIdPost");
            e.printStackTrace();
        }
    }
}
String *hashId = hashId_example; // SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

FileApi *apiInstance = [[FileApi alloc] init];

// Proof your file by creating a SHA256 and using it as the **HashId**
[apiInstance fileHashIdPostWith:hashId
              completionHandler: ^(File output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var LedgerletsApi = require('ledgerlets_api');

var api = new LedgerletsApi.FileApi()

var hashId = hashId_example; // {String} SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.fileHashIdPost(hashId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class fileHashIdPostExample
    {
        public void main()
        {
            
            var apiInstance = new FileApi();
            var hashId = hashId_example;  // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

            try
            {
                // Proof your file by creating a SHA256 and using it as the **HashId**
                File result = apiInstance.fileHashIdPost(hashId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling FileApi.fileHashIdPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\FileApi();
$hashId = hashId_example; // String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

try {
    $result = $api_instance->fileHashIdPost($hashId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FileApi->fileHashIdPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::FileApi;

my $api_instance = WWW::SwaggerClient::FileApi->new();
my $hashId = hashId_example; # String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

eval { 
    my $result = $api_instance->fileHashIdPost(hashId => $hashId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling FileApi->fileHashIdPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.FileApi()
hashId = hashId_example # String | SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)

try: 
    # Proof your file by creating a SHA256 and using it as the **HashId**
    api_response = api_instance.file_hash_id_post(hashId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FileApi->fileHashIdPost: %s\n" % e)

Parameters

Path parameters
Name Description
HashId*
String
SHA256 value of a file (use: `shasum -a 256 [yourfile]` to get the value)
Required

Responses

Status: 200 - successful operation

Status: 400 - Invalid status value