Bỏ qua để đến nội dung

gRPC Reference

Hợp đồng gRPC sinh tự động từ proto/. Mô tả lấy từ comment trong file .proto (tiếng Anh). Tải file tại justo-proto.zip.

rpc GetChallenge(google.protobuf.Empty) returns (justo.common.StandardResponse);
rpc InitSession(auth.InitSessionRequest) returns (justo.common.StandardResponse);
rpc AuthLogout(google.protobuf.Empty) returns (justo.common.StandardResponse);
rpc VerifyEmail(justo.identity.VerifyEmailRequest) returns (justo.common.StandardResponse);
rpc VerifyOtpEmail(justo.identity.VerifyOtpEmailRequest) returns (justo.common.StandardResponse);
rpc VerifyPhone(justo.identity.VerifyPhoneRequest) returns (justo.common.StandardResponse);
rpc VerifyOtpPhone(justo.identity.VerifyOtpPhoneRequest) returns (justo.common.StandardResponse);
rpc Register(justo.identity.RegisterRequest) returns (justo.common.StandardResponse);
rpc RegisterBasicInfo(justo.identity.RegisterBasicInfoRequest) returns (justo.common.StandardResponse);
rpc CreatePinCode(justo.identity.CreatePinCodeRequest) returns (justo.common.StandardResponse);
rpc SelectUpgradeOption(justo.identity.SelectUpgradeOptionRequest) returns (justo.common.StandardResponse);
rpc VerifyPassword(justo.identity.VerifyPasswordRequest) returns (justo.common.StandardResponse);
rpc SocialNonce(google.protobuf.Empty) returns (justo.common.StandardResponse);
rpc SocialLogin(justo.identity.SocialLoginRequest) returns (justo.common.StandardResponse);
rpc EnrollFace(justo.identity.EnrollFaceRequest) returns (justo.common.StandardResponse);
rpc SendEmail(smtm.gateway.v1.SendEmailRequest) returns (smtm.gateway.v1.SendMessageResponse);

Send raw email

rpc SendEmailTemplate(smtm.gateway.v1.SendEmailTemplateRequest) returns (smtm.gateway.v1.SendMessageResponse);

Send email using a predefined template

rpc SendSMS(smtm.gateway.v1.SendSMSRequest) returns (smtm.gateway.v1.SendMessageResponse);

Send raw SMS

rpc SendSMSTemplate(smtm.gateway.v1.SendSMSTemplateRequest) returns (smtm.gateway.v1.SendMessageResponse);

Send SMS using a template

rpc SendWhatsApp(smtm.gateway.v1.SendWhatsAppRequest) returns (smtm.gateway.v1.SendMessageResponse);

Send raw WhatsApp message

rpc SendWhatsAppTemplate(smtm.gateway.v1.SendWhatsAppTemplateRequest) returns (smtm.gateway.v1.SendMessageResponse);

Send WhatsApp message using a template

rpc ListMessages(smtm.gateway.v1.ListMessagesRequest) returns (smtm.gateway.v1.ListMessagesResponse);

List messages with pagination and filtering

rpc GetMessageDetail(smtm.gateway.v1.GetMessageDetailRequest) returns (smtm.gateway.v1.GetMessageDetailResponse);

Get message detail by tracking_id

rpc GetTemplate(smtm.gateway.v1.GetTemplateRequest) returns (smtm.common.v1.TemplateInfo);

Get template by ID

rpc GetTemplateByName(smtm.gateway.v1.GetTemplateByNameRequest) returns (smtm.common.v1.TemplateInfo);

Get template by Name

rpc ListTemplates(smtm.gateway.v1.ListTemplatesRequest) returns (smtm.gateway.v1.ListTemplatesResponse);

List templates

rpc CheckSuppression(smtm.gateway.v1.CheckSuppressionRequest) returns (smtm.gateway.v1.CheckSuppressionResponse);

Check if a recipient is suppressed

rpc SendPushNotification(smtm.gateway.v1.SendPushNotificationRequest) returns (smtm.gateway.v1.SendPushNotificationResponse);

Send a push notification to devices / users

rpc SendPushNotificationTemplate(smtm.gateway.v1.SendPushNotificationTemplateRequest) returns (smtm.gateway.v1.SendPushNotificationResponse);

Send a push notification rendered from a template

rpc SendPushNotificationBatch(smtm.gateway.v1.SendPushNotificationBatchRequest) returns (smtm.gateway.v1.SendPushNotificationBatchResponse);

Send one event notification to many devices / users

rpc RegisterDevice(smtm.gateway.v1.RegisterDeviceRequest) returns (smtm.gateway.v1.RegisterDeviceResponse);

Register a device for push notifications

Field Type Số Mô tả
code int32 1 Business result code. 0 is success; 1000-1999 are auth and attestation errors; 2000-2999 are identity errors.
message string 2 Debug or display text. Clients must not branch on it.
payload google.protobuf.Any 3 Generic payload message wrapped as Any. Null when empty or error.
Field Type Số Mô tả
challenge_jwt string 1 EdDSA JWT signed with the preshare key. Claim challenge is 32 random bytes (base64), exp = iat + 5 minutes.

JSON Web Key (RFC 7517) for an EC P-256 public key. x and y are base64url without padding (32 bytes each, 43 characters).

Field Type Số Mô tả
kty string 1 Key type. Must be “EC”.
crv string 2 Curve. Must be “P-256”.
x string 3
y string 4
d string 5 Private part. Must be absent in a client certificate.
alg string 6 Optional JWS algorithm. When set, must be “ES256”.

Certificate of the client for the JWT factor. ECDSA P-256 public key (ES256).

Field Type Số Mô tả
public_key auth.JWK 1
algorithm string 2 Key type, required, must be “P-256”. Not the JWT header alg.
scopes string 3 Comma-separated scopes, e.g. “read,write,admin”.

Client certificate for the ECDH key exchange with P-256.

Field Type Số Mô tả
public_key auth.JWK 1
algorithm string 2 Key type, required, must be “P-256”. Not the JWT header alg.
salt bytes 3 SA: client salt, 32 bytes, used with ECDH to derive the AES-256-GCM key (HKDF-SHA256).

Proof of device identity. Platform decides which fields are required: IOS uses challenge_jwt, x_key_id and x_challenge_response; ANDROID uses android_token.

Field Type Số Mô tả
platform string 1
device_uuid string 2 Device identifier, 1 to 32 characters.
challenge_jwt string 3 IOS only. JWT from GET /v1/attestation/get-challenge, expires after 5 minutes.
x_key_id string 4 IOS only. App Attest key ID.
x_challenge_response string 5 IOS only. Attestation object, base64.
android_token string 6 ANDROID only. Android attestation token.
Field Type Số Mô tả
user_id string 1 Hex-encoded user ID. Empty for a new, unidentified flow.
client_jwt_cert auth.CertificateJWT 2
client_sensitive_jwt_cert auth.CertificateJWT 3
client_p256_cert auth.CertificateP256 4
attestation auth.AttestationChallenge 5

Claim payload carried inside InitSessionPayload.jwt_token.

Field Type Số Mô tả
session_id string 1
public_key bytes 2 Server ECDH public key, raw uncompressed P-256 point: 0x04 || X || Y (65 bytes).
algorithm string 3 Defaults to “P-256” when empty. Key type, not the JWT header alg.
salt bytes 4 SB ciphertext: AES-256-GCM(key, SB, aad = session_id), encoded as nonce || ciphertext || tag (60 bytes).
Field Type Số Mô tả
jwt_token string 1 JWT signed with the preshare key (Ed25519).
Field Type Số Mô tả
id string 1
display_name string 2
next_step justo.common.Step 3
phone string 4
Field Type Số Mô tả
email string 1
Field Type Số Mô tả
next_step justo.common.Step 1
otp_id string 2
Field Type Số Mô tả
otp_id string 1
otp string 2
Field Type Số Mô tả
next_step justo.common.Step 1
phone string 2
Field Type Số Mô tả
phone string 1
Field Type Số Mô tả
next_step justo.common.Step 1
otp_id string 2
Field Type Số Mô tả
otp_id string 1
otp string 2
Field Type Số Mô tả
next_step justo.common.Step 1
salt string 2 Deprecated: ‘salt’ is no longer used directly; use ‘jwtToken’ instead.
jwt_token string 3 JWT token for the session containing ‘salt’ and the user’s authentication information
Field Type Số Mô tả
password string 1
Field Type Số Mô tả
next_step justo.common.Step 1
Field Type Số Mô tả
given_name string 1
paternal_surname string 2
maternal_surname string 3
date_of_birth string 4
gender justo.common.Gender 5
Field Type Số Mô tả
next_step justo.common.Step 1
Field Type Số Mô tả
pin_code string 1
Field Type Số Mô tả
next_step justo.common.Step 1
Field Type Số Mô tả
password string 1
Field Type Số Mô tả
next_step justo.common.Step 1
phone string 2
Field Type Số Mô tả
session_id string 1 Deprecated: no longer used.
Field Type Số Mô tả
nonce string 1
expires_at string 2
Field Type Số Mô tả
provider string 1
id_token string 2
Field Type Số Mô tả
face bytes 1
face_wide_angle bytes 2
face_3d bytes 3
content_type string 4
Field Type Số Mô tả
next_step justo.common.Step 1
biometric_id string 2
Field Type Số Mô tả
upgrade_option justo.common.UpgradeOption 1
Field Type Số Mô tả
next_step justo.common.Step 1
Field Type Số Mô tả
filename string 1
content_type string 2
content bytes 3

MessageItem represents a summary record of a sent message.

Field Type Số Mô tả
tracking_id string 1
status smtm.common.v1.MessageStatus 2
sender string 3
receiver string 4
subject string 5
created_at int64 6
sent_at int64 7
read_at int64 8
channel smtm.common.v1.MessageChannel 9
type smtm.common.v1.MessageType 10
delivery_status smtm.common.v1.DeliveryStatus 11
Field Type Số Mô tả
provider string 1
provider_msg_id string 2
Field Type Số Mô tả
fail_reason string 1
Field Type Số Mô tả
bounce_type string 1
Field Type Số Mô tả
feedback_type string 1
feedback_id string 2
Field Type Số Mô tả
reject_reason string 1
Field Type Số Mô tả
provider string 1
provider_msg_id string 2
Field Type Số Mô tả
id string 1
message_id string 2
event_type string 3
timestamp int64 4 Event occurrence timestamp in Unix epoch milliseconds
created_at int64 5 Event ingestion timestamp in Unix epoch milliseconds
sent_metadata smtm.common.v1.SentEventMetadata 6
failed_metadata smtm.common.v1.FailedEventMetadata 7
bounced_metadata smtm.common.v1.BouncedEventMetadata 8
complained_metadata smtm.common.v1.ComplainedEventMetadata 9
rejected_metadata smtm.common.v1.RejectedEventMetadata 10
dispatched_metadata smtm.common.v1.DispatchedEventMetadata 11
Field Type Số Mô tả
limit int32 1
last_id string 2
total int64 3

SuppressionItem represents a suppressed recipient record across all services.

Field Type Số Mô tả
id string 1
message_id string 2
receiver string 3
type smtm.common.v1.MessageType 4
reason string 5
source string 6
raw_payload string 7
created_at int64 8
updated_at int64 9

TemplateInfo represents core template details shared across services.

Field Type Số Mô tả
template_id string 1
name string 2
subject string 3
body string 4
description string 5
channel smtm.common.v1.MessageChannel 6
is_active bool 7
type smtm.common.v1.MessageType 8
required_vars repeated string 9
created_at int64 10
updated_at int64 11
var_positions map<string, int32> 12
button_var_positions map<string, int32> 13

SendMessageResponse represents the unified response for all message dispatch RPCs.

Field Type Số Mô tả
tracking_ids map<string, string> 1
Field Type Số Mô tả
sender string 1
receivers repeated string 2
subject string 3
body string 4
channel smtm.common.v1.MessageChannel 5
attachments repeated smtm.common.v1.Attachment 6
Field Type Số Mô tả
sender string 1
template_id string 2
vars map<string, string> 3
receivers repeated string 4
attachments repeated smtm.common.v1.Attachment 5
template_name string 6
Field Type Số Mô tả
sender string 1
receivers repeated string 2
body string 3
channel smtm.common.v1.MessageChannel 4
Field Type Số Mô tả
receivers repeated string 1
template_id string 2
vars map<string, string> 3
sender string 4
template_name string 5
Field Type Số Mô tả
receivers repeated string 1
body string 2
channel smtm.common.v1.MessageChannel 3
sender string 4
Field Type Số Mô tả
receivers repeated string 1
template_id string 2
vars map<string, string> 3
sender string 4
client_id string 5
template_name string 6
Field Type Số Mô tả
last_id string 1
client_id string 2
receiver string 3
type smtm.common.v1.MessageType 4
status string 5
channel smtm.common.v1.MessageChannel 6
from_time int64 7
to_time int64 8
limit int32 9
tracking_id string 10
delivery_status string 11
Field Type Số Mô tả
items repeated smtm.common.v1.MessageItem 1
pagination smtm.common.v1.Pagination 2
Field Type Số Mô tả
tracking_id string 1
Field Type Số Mô tả
tracking_id string 1
status smtm.common.v1.MessageStatus 2
delivery_status smtm.common.v1.DeliveryStatus 3
sender string 4
receiver string 5
subject string 6
body string 7
channel smtm.common.v1.MessageChannel 8
type smtm.common.v1.MessageType 9
client_id string 10
template_id string 11
vars map<string, string> 12
provider_used string 13
created_at int64 15
events repeated smtm.common.v1.MessageEvent 16
Field Type Số Mô tả
template_id string 1
Field Type Số Mô tả
name string 1
Field Type Số Mô tả
name string 1
type smtm.common.v1.MessageType 2
channel smtm.common.v1.MessageChannel 3
is_active bool 4
Field Type Số Mô tả
items repeated smtm.common.v1.TemplateInfo 1
total_count int64 2
Field Type Số Mô tả
receiver string 1
type smtm.common.v1.MessageType 2
Field Type Số Mô tả
is_suppressed bool 1
item smtm.common.v1.SuppressionItem 2

PushOptions are optional delivery options, mapped by the worker onto the APNs headers / FCM message fields.

Field Type Số Mô tả
ttl_seconds int32 1 Time-to-live in seconds (max 2419200 = 4 weeks). 0 = default. A notification still undelivered after its TTL is dropped instead of retried.
priority smtm.gateway.v1.PushPriority 2
badge int32 3
sound string 4
collapse_key string 5 Replaces an earlier undelivered notification with the same key (max 64 bytes).
android_channel_id string 6 Android notification channel ID.

SkippedPushTarget is a requested target that was not sent to. Exactly one of device_id / user_id is set.

Field Type Số Mô tả
device_id string 1
user_id string 2
reason string 3 DEVICE_NOT_FOUND | DEVICE_INACTIVE | DEVICE_TOKEN_MISSING | DEVICE_PLATFORM_UNSUPPORTED | USER_NO_ACTIVE_DEVICE
Field Type Số Mô tả
title string 3
body string 4
data map<string, string> 5 Custom key/value payload delivered to the app.
channel smtm.common.v1.MessageChannel 6 Defaults to MESSAGE_CHANNEL_NOTIFICATION; decides the queue deadline.
options smtm.gateway.v1.PushOptions 7
token string 9 Direct device token (FCM registration token) without device registry lookup.
project_id string 10 Target Firebase project ID (acts as the sender of the push notification).

smtm.gateway.v1.SendPushNotificationTemplateRequest

Phần tiêu đề “smtm.gateway.v1.SendPushNotificationTemplateRequest”
Field Type Số Mô tả
device_ids repeated string 1
user_ids repeated string 2
template_id string 3 Push template: its subject is the title, its body the body. The message channel comes from the template.
vars map<string, string> 4
data map<string, string> 5
options smtm.gateway.v1.PushOptions 6
event_id string 7
Field Type Số Mô tả
tracking_ids map<string, string> 1
skipped repeated smtm.gateway.v1.SkippedPushTarget 2
duplicated_count int32 3 Targets not sent again because their event_id was already sent.

SendPushNotificationBatchRequest sends one shared content to many targets for an event. Give either title/body (raw) or template_id/vars (template).

Field Type Số Mô tả
event_id string 1 Idempotency key of the event. Retrying a request with the same event_id never sends a device the same event twice, and reuses the same batch.
event_name string 2
device_ids repeated string 3
user_ids repeated string 4
title string 5
body string 6
template_id string 7
vars map<string, string> 8
data map<string, string> 9
channel smtm.common.v1.MessageChannel 10
options smtm.gateway.v1.PushOptions 11
Field Type Số Mô tả
batch_id string 1
accepted_count int32 2
skipped_count int32 3
duplicated_count int32 4
tracking_ids map<string, string> 5
skipped repeated smtm.gateway.v1.SkippedPushTarget 6
Field Type Số Mô tả
platform string 1 Platform of the device: “ios” or “android”
token string 2 Device token from APNs (iOS) or FCM (Android)
user_id string 3 User ID of the device owner (caller’s user system)
is_dev bool 4 For iOS only: true = development environment, false = production
project_id string 5 For Android only: Firebase project ID (empty = use default project)
Field Type Số Mô tả
device_id string 1 Device ID assigned by Noah (used to address this device in future push requests)
Giá trị Số Mô tả
STEP_UNSPECIFIED 0
STEP_BASIC_INFO 1
STEP_CREATE_PIN_CODE 2
STEP_VERIFY_EMAIL_OTP 3
STEP_VERIFY_PHONE 4
STEP_VERIFY_PHONE_OTP 5
STEP_CREATE_ACCOUNT 6
STEP_LOGIN_PASSWORD 7
STEP_COMPLETED 8
STEP_OLD_PASSWORD 9
STEP_ENROLL_FACE 10
STEP_SELECT_UPGRADE_OPTION 11
STEP_HOME 12
Giá trị Số Mô tả
GENDER_UNSPECIFIED 0
GENDER_MALE 1
GENDER_FEMALE 2
GENDER_OTHER 3
Giá trị Số Mô tả
UPGRADE_OPTION_UNSPECIFIED 0
UPGRADE_OPTION_WALLET 1
UPGRADE_OPTION_WALLET_BANKAOOL 2
UPGRADE_OPTION_UPGRADE_LATER 3

MessageType enum for delivery medium (EMAIL/SMS/WHATSAPP)

Giá trị Số Mô tả
MESSAGE_TYPE_UNSPECIFIED 0
MESSAGE_TYPE_EMAIL 1
MESSAGE_TYPE_SMS 2
MESSAGE_TYPE_WHATSAPP 3
MESSAGE_TYPE_NOTIFICATION_FCM 4
MESSAGE_TYPE_NOTIFICATION_APNS 5
Giá trị Số Mô tả
MESSAGE_CHANNEL_UNSPECIFIED 0
MESSAGE_CHANNEL_OTP 1
MESSAGE_CHANNEL_NOTIFICATION 2
MESSAGE_CHANNEL_MARKETING 3
Giá trị Số Mô tả
CONTENT_TYPE_UNSPECIFIED 0
CONTENT_TYPE_PLAIN_TEXT 1
CONTENT_TYPE_HTML 2
CONTENT_TYPE_MARKDOWN 3
Giá trị Số Mô tả
MESSAGE_STATUS_UNSPECIFIED 0
MESSAGE_STATUS_PENDING 1
MESSAGE_STATUS_PROCESSING 2
MESSAGE_STATUS_SUCCESS 3
MESSAGE_STATUS_FAIL 4
MESSAGE_STATUS_SUPPRESSED 5

DeliveryStatus is the consolidated, provider-agnostic downstream tracking state reported by async webhooks (AWS SES event notifications, WhatsApp Cloud API status callbacks) after MessageStatus is already SUCCESS.

Giá trị Số Mô tả
DELIVERY_STATUS_UNSPECIFIED 0
DELIVERY_STATUS_SENT 1
DELIVERY_STATUS_DELIVERED 2
DELIVERY_STATUS_READ 3
DELIVERY_STATUS_CLICKED 4
DELIVERY_STATUS_BOUNCED 5
DELIVERY_STATUS_COMPLAINED 6
DELIVERY_STATUS_REJECTED 7
Giá trị Số Mô tả
PUSH_PRIORITY_UNSPECIFIED 0
PUSH_PRIORITY_NORMAL 1
PUSH_PRIORITY_HIGH 2