Qeasy Cloud
Get Started
POSThttps://{数据中心地址}/k3cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.LoginByAppSecret.common.kdsvcAppID + AppSecret(Cookie 会话)

Third-party App Login (LoginByAppSecret)

金蝶云星空 WebAPI 登录接口,使用 AppID + AppSecret 完成第三方应用鉴权,登录成功后通过 Cookie 会话调用 ExecuteBillQuery 等业务接口。

## Overview LoginByAppSecret is the recommended authentication entry point of the Kingdee K3 Cloud WebAPI for third-party integrations. Instead of sending a plaintext password (ValidateUser), the caller authenticates with an AppID/AppSecret pair that is created in the Kingdee console under Open Service Cloud > OpenAPI > Third-party Applications, together with a proxy user whose permissions scope all subsequent API calls. ### How it works 1. Create a third-party application in K3 Cloud and note its AppID and AppSecret. Bind a proxy user to the application. 2. POST a JSON body containing acctID (the data-center/account-set id), username, appid, appsecret and lcid (2052 for Chinese) to this endpoint. 3. A LoginResultType of 1 indicates success. The response sets session cookies that must be replayed on every business API call such as ExecuteBillQuery; calls without the session cookie are rejected. 4. Sessions expire. A production integration should detect session-expired failures, re-login automatically, and serialize concurrent logins to avoid being throttled. ### Notes - All K3 Cloud WebAPI URLs end with .common.kdsvc and require Content-Type: application/json. - acctID is the account-set code, not the company name; find it in the login URL or the data-center manager. - For on-premise deployments, terminate TLS properly and configure the private base URL in the iPaaS connector.

Code examples

curl
curl -X POST "https://demo.ik3cloud.com/k3cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.LoginByAppSecret.common.kdsvc" \
  -H "Content-Type: application/json" \
  -c cookies.txt \
  -d '{"acctID":"5f3e2a1b9c","username":"apiuser","appid":"236541_secret_appid","appsecret":"b1f0xxxx","lcid":2052}'

Error codes

CodeMessageMeaning
-1LoginResultType=-1登录失败:账套、用户名或 AppID/AppSecret 不正确
500ResponseStatus.ErrorCode=500服务端处理异常,检查请求体 JSON 与接口地址