Skip to content
PHP SDK for Factom Enterprise API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
FactomEnterpriseAPI.php
README.md

README.md

Factom-EnterpriseAPI-php

Integrate Factom blockchain in your PHP application with just a few lines of code.

Factom Enterprise API: https://api.de-facto.pro
API Reference: https://docs.api.de-facto.pro

Installation

  1. Include PHP class
require_once "FactomEnterpriseAPI.php";
  1. Define API access key to use API (you can request API key on https://api.de-facto.pro)
$factom = new Factom("your-API-key-here");

Examples of usage

  1. Create new Factom chain
$content = "Description of new chain";
$external_ids = ["Tag 1", "Tag 2"];
$factom->create_chain($content, $external_ids);
  1. Create new entry on the Factom chain
$chain_id = "e3413be4d7e479e1fe0d640d6f0e81bdc09057bf5f98f82dd7eb818c61e68716";
$content = "Just created new entry";
$external_ids = ["Single tag"]; // optional
$factom->create_entry($chain_id, $content, $external_ids);
  1. Read entry on the Factom blockchain
$entry_hash = "5532d29d7cd6f1939b38d855785e3bab2b3fe469c7575a24dd096ee4c6468fc3";
$factom->get_entry($entry_hash);
  1. Get API user information (usage stats & limits)
$factom->get_user();

Advanced examples

  1. Writing arrays/objects on the Factom blockchain as JSON
$chain_id = "e3413be4d7e479e1fe0d640d6f0e81bdc09057bf5f98f82dd7eb818c61e68716";
$content = ["foo"=>"bar", "bar"=>"foo"];
$factom->create_entry($chain_id, json_encode($content));

Support

Factom Enterprise API provided by De Facto — Factom Authority Node Operator

https://de-facto.pro
team@de-facto.pro

You can’t perform that action at this time.