Protocol for developing cloud service system
Sign Algorithm
Sign will generate Account, PWD, AppKey and once connected will
encrypt them with MD5.
To be more specific: Accountuserpwd123456789AppKey4516 will
become 9ee297a117f9cfe8054f78076ee64ea7 when it is 32-digit MD5
encrypted.
Notes: Account means user name, Pwd means password to login,
AppyKey is automatically acquired in the system
Acquiring machine group
Function description: acquire machine group according to the user name.
Application scope: data integrating
Invoking: Post
Function name: GetMachineGroup
Format of response: Json.
Verification required or not: Yes
Parameters for requesting:
Field name Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
Sign string Yes Sign
Data returned
Field name Type Description
MGID Guid Machine group number
MGName string Machine group name
MGManageUser String Administrator
Sample for requesting:
{
“Account”:user,
“Pwd”:123456,
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample for returned data
{
“Success”:” adopt”,
“ErrorCode”:””,
“Data”:[
{“MGID”:””,MGName:””,”MGManageUser”:””},
{“MGID”:””,MGName:””,”MGManageUser”:””},
…]
}
Acquiring machine information
Function description: acquire machine information according to the user name and
the machine group number.
Application scope: data integrating.
Invoking: Post.
Function name: GetMachine
Format of return: Json
Verification required or not: Yes
Parameters for requesting
Field name Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
MachineGroupID string Yes Machine group number
Sign string Yes Verification code
Data returned
Field name Type Description
MId String Machine ID
MiAlias string Machine Alias
MiAddress string Server Address
MiNoline int 0 means offline,1-4 means online, 4 means best signal
MiWork int 1 Idle 2 Busy 3 Not working 4 Fault
MiSize int Machine type
MiBuyTime Datetime Time of purchase
MiInsideTemp String Interior temperature
MiOuterTemp String Exterior temperature
MiLongitude float Longitude
MiLlatitude float Latitude
Enable bit True means the machine will not be locked
Sample for requesting
{
“Account”: “”,
“Pwd”:””,
“MachineGroupID”:””,
“Sign”:””
}
Sample of returned data
{
“Success”:” fail”,
“ErrorCode”:”1”,
“Data”:[{…..},{…..}]
}
Acquiring product type:
Description: acquire product type according to the user name.
Application scope: data integrating.
Invoking:Post
Function:GetProductType
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field name Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
Sign string Yes Sign
Data returned
Field name Type Description
PTypeID Int Product type number
PTypeName String Product type name
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:”1”,
“Data”:[{PTypeID:”1”,PTypeName:”饮料”},{…..}]
Acquiring product manufacturer information
Description: acquire manufacturer information according to user name.
Application scope: data integrating.
Invoking:Post
Function name:GetManufacturer
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field name Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
Sign string Yes Sign
Data returned
Field name Type Description
MiID String Manufacturer ID
MiNo string Manufacturer Number
MiName String Manufacturer Name
MiBusinessAddress String Manufacturer Address
MiBusinessPhone string Telephone number
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:”1”,
“Data”:[{…. },{…..}]
}
Acquiring product information
Description: acquire product information according to user name.
Application scope: data integrating
Invoking:Post
Function name:GetProduct
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field name Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
Pageindex int Yes When first request it is 1
Sign string Yes Sign
Data returned
Field name Type Description
PrID string Product ID
PrCode string Product code
PrName string Product name
PrSpecification string Product specification
PrRetailPrice decimal Product purchasing price
PrCostPrice decimal Product selling price
CiType int Product type code
Manufacturers string Manufacturer code
PrImgUrl String Product image URL
QualityPeriod String Product warranty
CreateDate DateTime Time when produce added
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“Pageindex”:1
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:””,
“PageCount”:3, //How many pages in total
“Data”:[{…. },{…..}]
}
Acquiring the records of the products the machine dispensed
Description: acquire the records of the products the machine dispensed according to
the user name.
Application scope: data integrating
Invoking:Post
Function name:GetTradeRecord
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
Pageindex int Yes When first request it is 1
MachineID string Yes Machine ID
StateTime datetime Yes Starting time
EndTime datetime Yes Ending time
Sign string Yes Sign
Data returned
Field Type Description
TrMachineID String Machine ID
TrPayType int Payment type
TrCardID string Physical card ID
TrCoilID string Slot number
TrPrID string Product ID
TrPrice decimal Selling price
TrResult Int Status of dispensing 0 success not 0
failed
Trprofit decimal Profit
TrTime datetime Time when machine was purchased
AddTime DateTime Loaded to server
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“Pageindex”:1,
“MachineID”:”1803290001”
“StateTime”:”2018-03-29:00:00:00”, Time period cannot be larger than 2 months
“EndTime”:”2018-03-30:00:00:00”,
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:””,
“PageCount”:3, //How many pages in total
“Data”:[{…. },{…..}]
}
Acquiring payment types:
Description: acquire product information according to the user name.
Application scope: data integrating
Invoking:Post
Function name:GetPayType
Format of return:Json
Verification required or not: Yes
Parameters for requsting
Field Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
Sign string Yes Sign
Data returned
Field Type Description
PtID int Type ID
PtName String Exact payment method
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:””,
“Data”:[
{……},
{……},
…]
}
Acquiring machine's slot information
Description: acquire machine's slot information.
Application scope: data integrating
Invoking:Post
Function name:GetCoil
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
MachineID string Yes Machine ID
Sign string Yes Verification code
Data returned
Field Type Description
SiMachineId String Machine ID
SiCoilId Int Slot number
SiBarCode string Product ID
SiCapacity Int Capacity
SiExtantQuantity Int Stock
SiPrice double Price on the machine: can be null
SiCustomPrice Double Price: can be null
WxDiscount Int Wechat Pay discount 100 means no discount
AliDiscount Int Alipay discount
AppDiscount int App pay discount
IDcardDiscount int Physical card discount
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“MachineID”: 1801200001
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:””,
“Data”:[
{……},
{……},
…]
}
Machine stock status
Description: acquire machine slot information
Application scope: data integrating
Invoking:Post
Function name:GetStock
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
MachineID string Yes Machine ID
Sign string Yes Verification code
Data returned
Field Type Description
SiMachineId string Machine ID
SiBarCode string Product ID
PrCode string Product code
PrName string Product name
SiCapacity Int Capacity
SiExtantQuantity int Stock
Stock int Sold quantity
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“MachineID”: 1801200001
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample for data returned
{
“Success”:” adopt”,
“ErrorCode”:””,
“Data”:[
{……},
{……},
…]
}
Records of loading the machine with products
Description: acquire machine's slot information
Application scope: data integrating
Invoking:Post
Function name:GetStockTradeRecord
Format of return:Json
Verification required or not: Yes
Parameters for requesting
Field Type Mandatory or not Description
Account string Yes User name
Pwd string Yes Password
MachineID string Yes Machine ID
StateTime datetime Yes Starting time
EndTime datetime Yes Ending time
Sign string Yes Sign
Data returned
Field Type Description
MachineID String Machine ID
BarCode string Product ID
PrCode string Product code
PrName string Produce name
Capacity int Quantity
Time datetime Time
Sample for requesting
{
“Account”:user,
“Pwd”:123456,
“Pageindex”:1,
“MachineID”:”1803290001”
“StateTime”:”2018-03-29:00:00:00”, Time period cannot be longer than 2 months
“EndTime”:”2018-03-30:00:00:00”,
“Sign”: “9ee297a117f9cfe8054f78076ee64ea7”
}
Sample of data returned
{
“Success”:” adopt”,
“ErrorCode”:””,
“Data”:[
{……},
{……},
…]
}
Returned data status
Status code Description
1 Verification failed
2 Interior server error
3 No access
4 Blacklist