Download the PHP package 1000nettles/factom-api-php without Composer
On this page you can find all versions of the php package 1000nettles/factom-api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 1000nettles/factom-api-php
More information about 1000nettles/factom-api-php
Files in 1000nettles/factom-api-php
Package factom-api-php
Short Description A simple PHP wrapper for the Factom API
License MIT
Homepage https://github.com/1000nettles/factom-api-php
Informations about the package factom-api-php
factom-api-php
A Simple PHP Wrapper for any Factom API v2 calls (including calls to factomd and factom-walletd)
Find the Factom API reference documentation here: https://docs.factom.com/api
Installation
Using Composer:
composer require 1000nettles/factom-api-php
Normal Require:
How To Use
Launch any Factom Command-Line Apps
The PHP Factom API integration connects to a locally running instance of factomd or factom-walletd. When you run these locally or on your server, they run as service which lets you connect usually through http://localhost:8088 (factomd) or http://localhost:8089 (factom-walletd). You can find out more about running these services here - https://docs.factom.com/cli
For factomd, you may be able to connect to "courtesy nodes" instead such as http://courtesy-node.factom.com, however these are not guaranteed. I have not tested if there are API limits. For more information: https://docs.factom.com/#run-enterprise-wallet-online
Instantiate the Factom API Adapter
Notice we are supplying the full URL to version 2 of the API below.
If you want to interact with the API securely, make sure you're running factomd with TLS mode ON - ./factomd -tls true
. You also should pass in the location to your certificate when instantiating the adapter, and change the URL to HTTPS:
If you want to interact with the API with a username and password, make sure you're running factomd with a username and password defined - ./factomd -rpcuser <username> -rpcpass <password>
. You can run this with a certificate as well if you wish.
Run the API Method With Your Parameters!
API methods are outlined here: https://docs.factom.com/api
Firing GET Requests
Certain API methods use the GET method rather than POST. For example, the 'address' method within factom-walletd: https://docs.factom.com/api#address. You can run this easily:
That's all there is to it. If you are getting cURL issues, it may be because you do not have the PHP cURL lib installed.
Tests
Sorry! None right now.
Known Issues
- Currently if you are using a secure connection (TLS) and you provide the path to a certificate, we ignore cURL self-signing certificate warnings via setting
CURLOPT_SSL_VERIFYPEER
tofalse
. - The debug API endpoints are not accessible via this wrapper
All versions of factom-api-php with dependencies
ext-curl Version *