PHI Network Developer API
API for the PHI Network Blockchain project
More information: PHI Labs
Contact [email protected]
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
get /balance
get /balance/{phiId}
get /balance/transaction/{days}
get /balance/{phiId}/wallet
post /balance/{phiId}/wallet/{state}
Device
Phi
PhiWallet
get /wallet/switches/{deviceId}
get /walletSummary
post /wallet/amount/{deviceId}/{value}
post /wallet/amount/{deviceId}/{value}/timer/{timeunit}
post /wallet/switches/{deviceId}/{value}
post /wallet/switches/{deviceId}/{value}/timer/{minutes}
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 ApiResponseDevice
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 devicePhi
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
okPhiWallet
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 ApiResponseModels
[ Jump to Methods ]Table of Contents
ApiResponse
City
DeviceRegistrationInfo
DeviceState
amountphistatus
balanceSummary
balancephi
sendtransaction
transaction
transactionResponse
transactionbalance
walletState
walletSummary
walletphi
walletphistatus
amountphistatus
Up
sstatus of a single phi
balancephi
Up
a single balance phi