- API使用:
l API需要參數
API入口:http://s3api.demo.ttgrasp.com.cn/FxApi/ApiGateway.Gspx
參數名稱 |
說明 |
AppId |
應用程序ID,現在默認傳輸:A001 |
AppSecret |
應用程序Key,現在默認傳輸:94626B9C-4B74-49F3-98CF-952475E3F027 |
Version |
ERP程序版本,1.2 |
TimeStamp |
請求時間戳 |
Sign |
簽名,目前只用於請求綁定時的簽名驗證,MD5加密content |
Token |
身份令牌 |
MethodType |
請求方式,POST/GET |
ContentType |
HTTP請求類型,application/x-www-form-urlencoded |
AESKey |
加密業務參數的key,傳輸過程中用對方的公鑰加密 |
UserId |
操作員ID,現在默認傳輸:2 |
Content |
業務參數 |
Method |
被調用的方法(規範:註冊服務+方法名) |
舉例:
- 請求綁定:
輸入參數 |
值 |
AppId |
A001 |
AppSecret |
94626B9C-4B74-49F3-98CF-952475E3F027 |
Version |
1.2 |
TimeStamp |
2019-08-28 14:00:000 |
Sign |
74DD72C7F9BCEEB7E66F61D8E922251D |
MethodType |
POST |
ContentType |
application/x-www-form-urlencoded |
UserId |
2 |
Content |
{"clientpublickey":"BgIAAACkAABSU0ExAAQAAAEAAQAJhiLn7du5H+n5Cob7Co+Iutgz7zg543bsjH+Uff/0BM8qrN0k0gPRVv7hoJTZMVnBz/rHJwTIUfxNyYtpkEeOC5I584s6MOnjyIgEpIhIeQdt8jQpYU8alkT9va73Ec8AMSYXDkZs6SyXlJ7Km0y1mcG6Qlk7IpOxvrJiE4aWzQ=="} |
Method |
FxApi.ApiBinding |
輸出參數 |
值 |
Code |
1 |
Msg |
"綁定接口成功!" |
AESKey |
需要使用RSA私鑰解密得到 |
Result |
AES加密的密文,解密後格式: {"serverpublickey":"xxxxxxxxxxxx","appsecret":"xxxxxxxxxxxx"} |
- 分發token:
輸入參數 |
值 |
AppId |
A001 |
AppSecret |
bqIhOTU1TMS7LH7xJDQl+MprOlIRCJH+1v26CVhwLt40qwjFlFKjCcd9ovbpRAeLnTa2v8Ou3wu4+TO6wsQbZ70mFvXJVu1yBzwyXQiN8Q8aVzsQFS0Md79squAvxHfmTyrw+DqLJfzb0/Dp6kgI/0OfnlzyiXDUWkj1f9HfBRU= |
Version |
1.2 |
TimeStamp |
2019-08-28 14:00:000 |
MethodType |
POST |
ContentType |
application/x-www-form-urlencoded |
UserId |
2 |
Method |
FxApi.AllocateToken |
輸出參數 |
值 |
Code |
1 |
Msg |
"分發Token成功!" |
AESKey |
需要使用RSA私鑰解密得到 |
Result |
AES加密的密文,解密後格式: {"token":"xxxxxxxxxxxx","tokenexpiredate":"xxxxxxxxxxxx"} |
- API CODE:
Code |
值 |
描述 |
Success |
1 |
成功 |
ExceptionError |
2 |
發生異常 |
AppIdError |
3 |
應用程序ID錯誤,身份驗證失敗 |
AppSecretError |
4 |
身份驗證失敗(應用程序Key不匹配) |
TokenError |
5 |
身份令牌token錯誤 |
SignValidateFailed |
6 |
簽名驗證失敗 |
ContentTypeError |
7 |
HTTP請求Content-Type錯誤 |
VersionIsEmpty |
8 |
版本缺失 |
TimeStampIsEmpty |
9 |
時間戳缺失 |
ApiMethodIsEmpty |
10 |
請求的Api方法缺失 |
ParseApiMethodFailed |
11 |
解析Api方法失敗 |
ApiMethodNotExists |
12 |
請求的Api方法不存在 |
ApiMethodParameterError |
13 |
業務參數缺失或者解析參數失敗 |
MethodTypeError |
14 |
HTTP請求錯誤 |
ExecuteFailed |
15 |
調用接口方法執行失敗 |
ContentIsEmpty |
16 |
請求業務參數缺失 |
SignIsEmpty |
17 |
簽名缺失 |
TimeStampFormatError |
18 |
時間戳格式不正確 |
AppIdIsEmpty |
19 |
應用程序ID缺失 |
AppSecretIsEmpty |
20 |
應用程序Key缺失 |
TokenIsEmpty |
21 |
身份令牌缺失 |
ApiBindingException |
22 |
綁定接口異常 |
AllocateTokenException |
23 |
分發Token異常 |
RefreshTokenException |
24 |
刷新Token異常 |
TokenExpired |
25 |
Token過期 |
銷售出庫單:
(FxApi.SaleBill.Save)保存:
返回code |
返回msg |
調用方法路徑 |
MsgType.WithRecode |
"【{0}】單據編號重複,不能保存過賬。是否由系統自動生成新的單據編號?" |
GetBillCode之後調用save方法 |
MsgType.WithMinDiscountConfirm |
"該商品折扣小於折扣下限!" |
無交互,只是彈頁面提示 |
MsgType.WithBillConfirm |
售價、成本價、最近進價控制等 |
點確定後調用save方法 |
MsgType.WithAlarmStock |
庫存上下限 |
點確定後調用save方法 |
MsgType.WithVirtualStockConfirm |
虛擬庫存 |
點確定後調用save方法 |
MsgType.WithBillConfirm |
信用額度 |
點確定後調用save方法 |
(FxApi.SaleBill.Pass)過賬(包括save的驗證):
返回code |
返回msg |
調用方法路徑 |
MsgType.WithRecode |
"【{0}】單據編號重複,不能保存過賬。是否由系統自動生成新的單據編號?" |
GetBillCode之後調用save方法 |
MsgType.WithMinDiscountConfirm |
"該商品折扣小於折扣下限!" |
無交互,只是彈頁面提示 |
MsgType.WithBillConfirm |
售價、成本價、最近進價控制等 |
點確定後調用save方法 |
MsgType.WithAlarmStock |
庫存上下限 |
點確定後調用save方法 |
MsgType.WithVirtualStockConfirm |
虛擬庫存 |
點確定後調用save方法 |
MsgType.WithBillConfirm |
信用額度 |
點確定後調用save方法 |
MsgType.WithCostPriceInput |
零成本控制 |
頁面input之後調用save方法 |
API-20190905業務參數列表