Skip to content

v0.0.21

apea-proto

apea/base/v1/base.proto

Error

NameNumberDescription
None0
TokenInvalid1001token無效
IdentityInvalid1002身分證不合規
PhoneDuplicated1003電話號碼重複註冊
IsLocked1004已被鎖定,禁止操作
ClientNotFound1005查無用戶紀錄
TWIDInvalid1006TWID驗證失敗
IdentityVerifiedButNotValid1007該身分證已經過驗證,但驗證不通過
PhoneExistButIdentityNotMatch1008該電話號碼已有驗證紀錄,但輸入的身分證字號不符合紀錄
ClientHasPhoneButInputNotMatch1009該用戶有驗證紀錄,但輸入的電話號碼不符合
ClientAlreadyExist1010用戶已有驗證紀錄
PhoneNotMatch1011電話號碼不符

apea/health/v1/health.proto

HealthCheckRequest

FieldTypeLabelDescription
servicestring

HealthCheckResponse

FieldTypeLabelDescription
statusHealthCheckResponse.ServingStatus

HealthCheckResponse.ServingStatus

NameNumberDescription
SERVING_STATUS_UNSPECIFIED0
SERVING_STATUS_SERVING1
SERVING_STATUS_NOT_SERVING2
SERVING_STATUS_SERVICE_UNKNOWN3Used only by the Watch method.

HealthService

Method NameRequest TypeResponse TypeDescription
CheckHealthCheckRequestHealthCheckResponse
WatchHealthCheckRequestHealthCheckResponse stream

apea/twid/v1/twid_command.proto

ChangeApeaClientIDRequest

FieldTypeLabelDescription
app_tokenstring
prev_apea_client_idstring當前的 apea_client_id
next_apea_client_idstring新的 apea_client_id

ChangeApeaClientIDResponse

error -> Internal | Error_TokenInvalid | Error_ClientNotFound | Error_ClientAlreadyExist

DeleteApeaClientIDRequest

FieldTypeLabelDescription
app_tokenstring
apea_client_idstring要刪除的 apea_client_id
phonestring要刪除的 apea_client_id 所對應電話號碼

DeleteApeaClientIDResponse

error -> Internal | Error_TokenInvalid

DeleteAppClientIDRequest

FieldTypeLabelDescription
app_tokenstring
app_client_idstring要刪除的 app_client_id

DeleteAppClientIDResponse

error -> Internal | Error_TokenInvalid | Error_ClientNotFound

UnlockClientRequest

FieldTypeLabelDescription
app_tokenstring
apea_client_idstring要移除失敗紀錄的 apea_client_id

UnlockClientResponse

error -> Internal | Error_TokenInvalid | Error_ClientNotFound

ValidateRequest

FieldTypeLabelDescription
app_tokenstring
apea_client_idstring和電話號碼關聯的平台id (ex: pan 的 phone_id)
app_client_idstring平台id下的子id(ex: pan 的 object_id)若是內部平台,不可為空
identitystring要驗證的身分證,如果是內部平台可為空
phonestring要驗證的電話號碼
ip_addressstring發出請求的 IP,平台端需提供,如果是內部IP則不限制驗證次數

ValidateResponse

error -> Internal | InvalidArgument | Error_TokenInvalid | Error_IsLocked | Error_ClientHasPhoneButInputNotMatch | Error_PhoneExistButIdentityNotMatch | Error_IdentityVerifiedButNotValid | Error_PhoneDuplicated | Error_TWIDInvalid

TWIDCommand

Method NameRequest TypeResponse TypeDescription
ValidateValidateRequestValidateResponse若 24 小時內驗證 TWID 失敗達 3 次以上,則從第3次驗證時間點起算 24 小時內不可再驗證,且會紀錄永久性失敗紀錄 1 次。 若永久性失敗紀錄達 3 次以上,則該 apea_client_id 將永遠不可再驗證。 若 apea_client_id 已有驗證紀錄、但 app_client_id 尚未註冊,會直接新增關聯。(但輸入的身分證和電話號碼需與資料庫相符)。 若 apea_client_id 尚未有驗證紀錄、但指定的電話號碼已有驗證紀錄,且請求方為內部平台,則可跳過身分證驗證。 若 apea_client_id 尚未有驗證紀錄、但指定的電話號碼已有驗證紀錄且在同一個平台已有其他 apea_client_id 綁定,會報錯。 若指定的身分證已驗證、但指定的電話號碼尚未紀錄,且該身分證當前搭配的電話號碼在 2 隻以下,則會直接沿用該身分證的驗證狀態。(若指定的電話為第3隻或以上,需發實際驗證請求給 TWID)。 若有經過實際 TWID 驗證,會紀錄 twid_log(包含IP、參數和來自 TWID 的 response)。 每一筆 Validate 請求不論成功失敗,都會有 apea_log。
UnlockClientUnlockClientRequestUnlockClientResponse解除指定 apea_client_id 的永久性失敗紀錄
ChangeApeaClientIDChangeApeaClientIDRequestChangeApeaClientIDResponse變更電話號碼關聯的 apea_client_id
DeleteApeaClientIDDeleteApeaClientIDRequestDeleteApeaClientIDResponse刪除指定 apea_client_id 和電話號碼的相關紀錄
DeleteAppClientIDDeleteAppClientIDRequestDeleteAppClientIDResponse刪除指定 app_client_id 的相關紀錄

apea/twid/v1/twid_query.proto

GetVerifiedPhoneRequest

FieldTypeLabelDescription
app_tokenstring
apea_client_idstring要查詢的 apea_client_id

GetVerifiedPhoneResponse

error -> Internal | InvalidArgument | Error_TokenInvalid | Error_ClientNotFound | Error_IdentityInvalid

FieldTypeLabelDescription
phonestring電話號碼

StatusRequest

FieldTypeLabelDescription
app_tokenstring
app_client_idstring要查詢的 app_client_id

StatusResponse

error -> Internal | Error_TokenInvalid

FieldTypeLabelDescription
is_verifiedboolmember_id 不正確、該 member 沒有查詢記錄,都會是 false

TWIDQuery

Method NameRequest TypeResponse TypeDescription
StatusStatusRequestStatusResponse查詢指定 app_client_id 的 TWID 驗證狀態
GetVerifiedPhoneGetVerifiedPhoneRequestGetVerifiedPhoneResponse查詢指定 apea_client_id 有通過 TWID 驗證的電話號碼

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)