PHI Network api

PHI Network Developer API

API for the PHI Network Blockchain project
More information: PHI Labs
Version: 1.0.2
BasePath:/wp-json/wp/v2
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

Balance

Device

Phi

PhiWallet

Balance

Up
get /balance
(balanceSummary)

Return type

Example data

Content-Type: application/json
{
  "phi" : [ {
    "phi" : "phi",
    "inputPosition" : 6,
    "outputPosition" : 1,
    "name" : "name",
    "id" : 0
  }, {
    "phi" : "phi",
    "inputPosition" : 6,
    "outputPosition" : 1,
    "name" : "name",
    "id" : 0
  } ],
  "phistatus" : [ {
    "name" : "name",
    "id" : "id",
    "units" : "amount",
    "value" : 5.962133916683182,
    "timestamp" : "2000-01-23T04:56:07.000+00:00"
  }, {
    "name" : "name",
    "id" : "id",
    "units" : "amount",
    "value" : 5.962133916683182,
    "timestamp" : "2000-01-23T04:56:07.000+00:00"
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

ok balanceSummary

Up
get /balance/{phiId}
(getphibalance)

Path parameters

phiId (required)
Path Parameter

Return type

Example data

Content-Type: application/json
{
  "name" : "name",
  "id" : "id",
  "units" : "amount",
  "value" : 5.962133916683182,
  "timestamp" : "2000-01-23T04:56:07.000+00:00"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

phi balance amountphistatus

Up
get /balance/transaction/{days}
(gettransaction)

Path parameters

days (required)
Path Parameter — format: int32

Return type

Example data

Content-Type: application/json
{
  "city" : {
    "address" : "address",
    "name" : "name",
    "lon" : 1.4658129805029452,
    "id" : 0,
    "lat" : 6.027456183070403
  },
  "values" : [ {
    "date" : "2000-01-23T04:56:07.000+00:00",
    "balance" : {
      "high" : 3.616076749251911,
      "low" : 9.301444243932576,
      "time" : 1.2315135367772556,
      "day" : 4.145608029883936,
      "speed" : 7.386281948385884,
      "morning" : 2.027123023002322
    },
    "block" : 5.962133916683182,
    "time" : 5,
    "storage" : 7,
    "hashrate" : 2.3021358869347655,
    "send" : {
      "summary" : "summary",
      "icon" : "icon",
      "description" : "description"
    }
  }, {
    "date" : "2000-01-23T04:56:07.000+00:00",
    "balance" : {
      "high" : 3.616076749251911,
      "low" : 9.301444243932576,
      "time" : 1.2315135367772556,
      "day" : 4.145608029883936,
      "speed" : 7.386281948385884,
      "morning" : 2.027123023002322
    },
    "block" : 5.962133916683182,
    "time" : 5,
    "storage" : 7,
    "hashrate" : 2.3021358869347655,
    "send" : {
      "summary" : "summary",
      "icon" : "icon",
      "description" : "description"
    }
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

the transaction transactionResponse

Up
get /balance/{phiId}/wallet
(getwalletState)
gets the state of the wallet

Path parameters

phiId (required)
Path Parameter

Return type

Example data

Content-Type: application/json
{
  "id" : "id",
  "state" : "state"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

wallet state walletState

Up
post /balance/{phiId}/wallet/{state}
(setwalletState)
turns the wallet on or off

Path parameters

phiId (required)
Path Parameter
state (required)
Path Parameter

Return type

Example data

Content-Type: application/json
{
  "code" : 0,
  "message" : "everything is ok"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Sstatus of the operation ApiResponse

Device

Up
get /devices
(getDevices)
returns all registered devices

Query parameters

skip (optional)
Query Parameter — number of records to skip format: int32
limit (optional)
Query Parameter — max number of records to return format: int32

Return type

array[String]

Example data

Content-Type: application/json
[ "http://10.0.0.225:8080", "http://10.0.0.225:8080" ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

All the devices

Up
post /devices
(register)

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body DeviceRegistrationInfo (optional)
Body Parameter

Responses

200

successfully registered device

Phi

Up
get /phi
(getphi)

Return type

array[String]

Example data

Content-Type: application/json
[ "", "" ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

ok

Up
get /phi/{phiId}/quiet
(quietphi)

Path parameters

phiId (required)
Path Parameter

Responses

200

ok

PhiWallet

Up
get /wallet/switches/{deviceId}
(getSwitchState)

Path parameters

deviceId (required)
Path Parameter

Return type

Example data

Content-Type: application/json
{
  "level" : 0,
  "lastUpdate" : "2000-01-23T04:56:07.000+00:00",
  "name" : "name",
  "id" : "id"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

response DeviceState

Up
get /walletSummary
(getwalletSummary)

Return type

Example data

Content-Type: application/json
{
  "phi" : [ {
    "deviceType" : "dimmer",
    "phi" : "phi",
    "name" : "name",
    "id" : "id",
    "deviceId" : 0
  }, {
    "deviceType" : "dimmer",
    "phi" : "phi",
    "name" : "name",
    "id" : "id",
    "deviceId" : 0
  } ],
  "phistatus" : [ {
    "level" : 6,
    "lastUpdate" : "2000-01-23T04:56:07.000+00:00",
    "name" : "name",
    "id" : "id"
  }, {
    "level" : 6,
    "lastUpdate" : "2000-01-23T04:56:07.000+00:00",
    "name" : "name",
    "id" : "id"
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

ok walletSummary

Up
post /wallet/amount/{deviceId}/{value}
(setDimmer)

Path parameters

deviceId (required)
Path Parameter
value (required)
Path Parameter — format: int32

Return type

Example data

Content-Type: application/json
{
  "code" : 0,
  "message" : "everything is ok"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

response ApiResponse

Up
post /wallet/amount/{deviceId}/{value}/timer/{timeunit}
(setDimmerTimer)
sets a dimmer to a specific value on a timer

Path parameters

deviceId (required)
Path Parameter
value (required)
Path Parameter — format: int32
timeunit (required)
Path Parameter — format: int32

Query parameters

units (optional)
Query Parameter — default: milliseconds

Return type

Example data

Content-Type: application/json
{
  "code" : 0,
  "message" : "everything is ok"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

response ApiResponse

Up
post /wallet/switches/{deviceId}/{value}
(setSwitch)

Path parameters

deviceId (required)
Path Parameter
value (required)
Path Parameter

Return type

Example data

Content-Type: application/json
{
  "code" : 0,
  "message" : "everything is ok"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

response ApiResponse

Up
post /wallet/switches/{deviceId}/{value}/timer/{minutes}
(setSwitchTimer)
sets a switch to a specific value on a timer

Path parameters

deviceId (required)
Path Parameter
value (required)
Path Parameter
minutes (required)
Path Parameter — format: int32

Return type

Example data

Content-Type: application/json
{
  "code" : 0,
  "message" : "everything is ok"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

response ApiResponse

Models

[ Jump to Methods ]

Table of Contents

  1. ApiResponse
  2. City
  3. DeviceRegistrationInfo
  4. DeviceState
  5. amountphistatus
  6. balanceSummary
  7. balancephi
  8. sendtransaction
  9. transaction
  10. transactionResponse
  11. transactionbalance
  12. walletState
  13. walletSummary
  14. walletphi
  15. walletphistatus

ApiResponse Up

code (optional)
Integer format: int32
message (optional)
example: everything is ok

City Up

id (optional)
Long format: int64
name (optional)
lat (optional)
Double format: double
lon (optional)
Double format: double
address (optional)

DeviceRegistrationInfo Up

uri (optional)
String format: uri
example: http://10.0.0.220:8080
id (optional)
UUID format: uuid
example: 0729a580-2240-11e6-9eb5-0002a5d5c51b

DeviceState Up

id (optional)
name (optional)
lastUpdate (optional)
Date format: date-time
level (optional)
Integer format: int32

amountphistatus Up

sstatus of a single phi
id
String the unique identifier for the phi
name (optional)
String the name of the phi
value
Double the balance in the phi format: double
units (optional)
String the balance units
Enum:
celsius
amount
timestamp
Date the timestamp when the balance was measured format: date-time

balanceSummary Up

ok
phi (optional)
phistatus (optional)

balancephi Up

a single balance phi
id
Integer the unique identifier for the phi format: int32
name
inputPosition (optional)
Integer format: int32
outputPosition (optional)
Integer format: int32
phi (optional)

sendtransaction Up

summary (optional)
description (optional)
icon (optional)

transaction Up

date (optional)
Date format: date-time
block (optional)
Double format: double
time (optional)
Integer format: int32
hashrate (optional)
Double format: double
storage (optional)
Integer format: int32
balance (optional)
send (optional)

transactionResponse Up

city (optional)
values (optional)

transactionbalance Up

low (optional)
Double format: double
high (optional)
Double format: double
morning (optional)
Double format: double
day (optional)
Double format: double
speed (optional)
Double format: double
time (optional)
Double format: double

walletState Up

id (optional)
state (optional)

walletSummary Up

ok
phi (optional)
phistatus (optional)

walletphi Up

id (optional)
name (optional)
deviceId (optional)
Integer format: int32
deviceType (optional)
Enum:
dimmer
switch
phi (optional)

walletphistatus Up

the sstatus of the wallet phi.
id (optional)
name (optional)
lastUpdate (optional)
Date format: date-time
level (optional)
Integer format: int32