To use the gRPC functions, download the protocol buffer file from the proto directory corresponding to the desired version.
curl -O -L https://raw.githubusercontent.com/smswithoutborders/SMSwithoutborders-BE/feature/grpc_api/protos/v1/vault.protoIf you're using Python, install the necessary dependencies from
requirements.txt. For other languages, see
Supported languages.
Tip
it's recommended to set up a virtual environment to isolate your project's dependencies.
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtIf you're using Python, compile the gRPC files with protoc to generate the
necessary Python files. For other languages, see
Supported languages.
python -m grpc_tools.protoc -I protos/v1 --python_out=. --grpc_python_out=. protos/v1/vault.protoDATA_ENCRYPTION_KEY_PRIMARY_FILE=/path/to/encryption.key \
HMAC_KEY_FILE=/path/to/hashing.key \
KEYSTORE_PATH=/path/to/key_store \
SQLITE_DATABASE_PATH=/path/to/local.db \
GRPC_PORT=6000 \
GRPC_HOST=127.0.0.1 \
python3 grpc_server.pyDATA_ENCRYPTION_KEY_PRIMARY_FILE=/path/to/encryption.key \
HMAC_KEY_FILE=/path/to/hashing.key \
KEYSTORE_PATH=/path/to/key_store \
SQLITE_DATABASE_PATH=/path/to/local.db \
GRPC_INTERNAL_PORT=6099 \
GRPC_HOST=127.0.0.1 \
python3 grpc_internal_server.pyThese functions are exposed to external clients for interaction with the vault.
An entity represents a user or client in the vault.
Before creating an entity, you must prove ownership of the phone number you intend to use. This step ensures the security and authenticity of the entity creation process.
requestCreateEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the entity (optional). It should be in E164 format. e.g., +237123456789. |
| email_address | string | The email address associated with the entity (optional). |
| country_code | string | The ISO 3166-1 alpha-2 code associated with the phone number. e.g., CM for Cameroon. |
| password | string | A secure password for the entity. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| client_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
| captcha_token | string | The captcha token to be verified. |
responseCreateEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| requires_ownership_proof | bool | An indicator if proof of ownership is required. true if required, false otherwise. |
| next_attempt_timestamp | int32 | The next available time to request another proof of ownership (in Unix seconds) if the first attempt fails. |
| message | string | A response message from the server. |
methodCreateEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/CreateEntity <payload.jsonSample payload.json
{
"country_code": "CM",
"phone_number": "+237123456789",
"email_address": "mail@example.com",
"password": "Password@123",
"client_publish_pub_key": "x25519 client publish public key",
"client_device_id_pub_key": "x25519 client device_id public key"
}Sample response
{
"requiresOwnershipProof": true,
"message": "OTP sent successfully. Check your phone for the code.",
"nextAttemptTimestamp": 1717323582
}Warning
Ensure that you have completed the Initiate Creation step before executing this step.
requestCreateEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the entity (optional). It should be in E164 format. e.g., +237123456789. |
| email_address | string | The email address associated with the entity (optional). |
| country_code | string | The ISO 3166-1 alpha-2 code associated with the phone number. e.g., CM for Cameroon. |
| password | string | A secure password for the entity. |
| ownership_proof_response | string | The proof response from the previous step. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| client_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
responseCreateEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| server_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| server_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
| long_lived_token | string | A token for the authenticated session, to be used for subsequent requests. |
methodCreateEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/CreateEntity <payload.jsonSample payload.json
{
"country_code": "CM",
"phone_number": "+237123456789",
"email_address": "mail@example.com",
"password": "Password@123",
"client_publish_pub_key": "x25519 client publish public key",
"client_device_id_pub_key": "x25519 client device_id public key",
"ownership_proof_response": "123456"
}Sample response
{
"longLivedToken": "long_lived_token",
"serverPublishPubKey": "x25519 server publish public key",
"serverDeviceIdPubKey": "x25519 server publish public key",
"message": "Entity created successfully"
}An entity represents a user or client in the vault.
Warning
Repeated incorrect password attempts will trigger a dynamic rate limit and
return an UNAVAILABLE status code for this function.
This step involves verifying the phone number and password, triggering a proof of ownership for the phone number.
requestAuthenticateEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the entity (optional). It should be in E164 format. e.g., +237123456789. |
| email_address | string | The email address associated with the entity (optional). |
| password | string | A secure password for the entity. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| client_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
| captcha_token | string | The captcha token to be verified. |
responseAuthenticateEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| requires_ownership_proof | bool | An indicator if proof of ownership is required. true if required, false otherwise. |
| requires_password_reset | bool | An indicator if a user must reset their password. true if required, false otherwise. |
| next_attempt_timestamp | int32 | The next available time to request another proof of ownership (in Unix seconds) if the first attempt fails. |
| message | string | A response message from the server. |
methodAuthenticateEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/AuthenticateEntity <payload.jsonSample payload.json
{
"phone_number": "+237123456789",
"email_address": "mail@example.com",
"password": "Password@123",
"client_publish_pub_key": "x25519 client publish public key",
"client_device_id_pub_key": "x25519 client device_id public key"
}Sample response
{
"requiresOwnershipProof": true,
"message": "OTP sent successfully. Check your phone for the code.",
"nextAttemptTimestamp": 1717323582
}Warning
Ensure that you have completed the Initiate Authentication step before executing this step.
requestAuthenticateEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the entity (optional). It should be in E164 format. e.g., +237123456789. |
| email_address | string | The email address associated with the entity (optional). |
| password | string | A secure password for the entity. |
| ownership_proof_response | string | The proof response from the previous step. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| client_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
responseAuthenticateEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| server_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| server_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
| long_lived_token | string | A token for the authenticated session, to be used for subsequent requests. |
methodAuthenticateEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/AuthenticateEntity <payload.jsonSample payload.json
{
"phone_number": "+237123456789",
"email_address": "mail@example.com",
"password": "Password@123",
"client_publish_pub_key": "x25519 client publish public key",
"client_device_id_pub_key": "x25519 client device_id public key",
"ownership_proof_response": "123456"
}Sample response
{
"longLivedToken": "long_lived_token",
"serverPublishPubKey": "x25519 server publish public key",
"serverDeviceIdPubKey": "x25519 server publish public key",
"message": "Entity authenticated successfully!"
}An entity represents a user or client in the vault.
Before creating a bridge entity, you must prove ownership of the phone number you intend to use. This step ensures security and authenticity in the entity creation process.
requestCreateBridgeEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the bridge entity. It should be in E164 format, e.g., +237123456789. |
| country_code | string | The ISO 3166-1 alpha-2 code associated with the phone number. e.g., CM for Cameroon. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
responseCreateBridgeEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates whether the operation was successful. true or false. |
methodCreateBridgeEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the 17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/CreateBridgeEntity <payload.jsonSample payload.json
{
"country_code": "CM",
"phone_number": "+237123456789",
"client_publish_pub_key": "x25519 client publish public key"
}Sample response
{
"success": true,
"message": "Bridge entity created successfully."
}Warning
Ensure that you have completed the Initiate Bridge Creation step before executing this step.
requestCreateBridgeEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the bridge entity. It should be in E164 format. e.g., +237123456789. |
| country_code | string | The ISO 3166-1 alpha-2 code associated with the phone number. e.g., CM for Cameroon. |
| ownership_proof_response | string | The proof response from the previous step. |
responseCreateBridgeEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates whether the operation was successful. true or false. |
methodCreateBridgeEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the 17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/CreateBridgeEntity <payload.jsonSample payload.json
{
"country_code": "CM",
"phone_number": "+237123456789",
"ownership_proof_response": "123456"
}Sample response
{
"success": true,
"message": "Bridge entity creation completed successfully."
}An entity represents a user or client in the vault.
requestAuthenticateBridgeEntityRequest
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the bridge entity. |
responseAuthenticateBridgeEntityResponse
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates whether authentication was successful. |
methodAuthenticateBridgeEntity
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/AuthenticateBridgeEntity <payload.jsonSample payload.json
{
"phone_number": "+237123456789"
}Sample response
{
"success": true,
"message": "Bridge entity authenticated successfully."
}This method retrieves the stored tokens for a given entity.
requestListEntityStoredTokensRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| long_lived_token | string | The long-lived token for the authenticated session, used to identify the entity. |
Optional fields:
| Field | Type | Description |
|---|---|---|
| migrate_to_device | bool | Indicates if the token should be removed from the cloud and sent to the device. |
responseListEntityStoredTokensResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| stored_tokens | array | A list of stored tokens. Each token object may contain various fields. See Token Object for details. |
| message | string | A response message from the server. |
messageToken
| Field | Type | Description |
|---|---|---|
| platform | string | The platform associated with the token. |
| account_identifier | string | The unique identifier of the account associated with the token. |
| account_tokens | map<string, string> | Contains the access, refresh, and ID tokens with keys: access_token, refresh_token, and id_token. |
| is_stored_on_device | bool | Indicates if the token is already stored on the device. |
methodListEntityStoredTokens
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d '{"long_lived_token": "long_lived_token"}' \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/ListEntityStoredTokensSample response
{
"stored_tokens": [
{
"account_identifier": "my_x_handle",
"platform": "x"
},
{
"account_identifier": "example@gmail.com",
"platform": "gmail"
}
],
"message": "Tokens retrieved successfully."
}This function deletes an entity.
Warning
Ensure all stored tokens associated with this entity have been revoked before
using this function. Failure to do so will result in a FAILED_PRECONDITION
error.
requestDeleteEntityRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| long_lived_token | string | The long-lived token for the authenticated session. |
responseDeleteEntityResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates if the operation was successful. |
methodDeleteEntity
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d '{"long_lived_token": "long_lived_token"}' \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/DeleteEntitySample response
{
"message": "Entity deleted successfully.",
"success": true
}In case of forgotten passwords, they can be reset with the following steps.
This step involves verifying the phone number, triggering a proof of ownership for the phone number.
requestResetPasswordRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the entity (optional). It should be in E164 format. e.g., +237123456789. |
| email_address | string | The email address associated with the entity (optional). |
| new_password | string | A new secure password for the entity. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| client_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
| captcha_token | string | The captcha token to be verified. |
responseResetPasswordResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| requires_ownership_proof | bool | An indicator if proof of ownership is required. true if required, false otherwise. |
| next_attempt_timestamp | int32 | The next available time to request another proof of ownership (in Unix seconds) if the first attempt fails. |
| message | string | A response message from the server. |
methodResetPassword
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/ResetPassword <payload.jsonSample payload.json
{
"phone_number": "+237123456789",
"email_address": "mail@example.com",
"new_password": "Password@123",
"client_publish_pub_key": "x25519 client publish public key",
"client_device_id_pub_key": "x25519 client device_id public key"
}Sample response
{
"requiresOwnershipProof": true,
"message": "OTP sent successfully. Check your phone for the code.",
"nextAttemptTimestamp": 1717323582
}Warning
Ensure that you have completed the Initiate Reset step before executing this step.
requestResetPasswordRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| phone_number | string | The phone number associated with the entity (optional). It should be in E164 format. e.g., +237123456789. |
| email_address | string | The email address associated with the entity (optional). |
| new_password | string | A new secure password for the entity. |
| ownership_proof_response | string | The proof response from the previous step. |
| client_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| client_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
responseResetPasswordResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| server_publish_pub_key | string | An X25519 public key for publishing, base64 encoded. |
| server_device_id_pub_key | string | An X25519 public key for device ID, base64 encoded. |
| long_lived_token | string | A token for the authenticated session, to be used for subsequent requests. |
methodResetPassword
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/ResetPassword <payload.jsonSample payload.json
{
"phone_number": "+237123456789",
"email_address": "mail@example.com",
"new_password": "Password@123",
"client_publish_pub_key": "x25519 client publish public key",
"client_device_id_pub_key": "x25519 client device_id public key",
"ownership_proof_response": "123456"
}Sample response
{
"longLivedToken": "long_lived_token",
"serverPublishPubKey": "x25519 server publish public key",
"serverDeviceIdPubKey": "x25519 server publish public key",
"message": "Password reset successfully!"
}This method updates the password for a given entity.
Warning
Repeated incorrect password attempts will trigger a dynamic rate limit and
return an UNAVAILABLE status code for this function.
requestUpdateEntityPasswordRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| long_lived_token | string | The long-lived token for the authenticated session, used to identify the entity. |
| current_password | string | The current password of the entity. |
| new_password | string | The new password of the entity. |
responseUpdateEntityPasswordResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates if the operation was successful. |
methodUpdateEntityPassword
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/UpdateEntityPassword <payload.jsonSample payload.json
{
"current_password": "current_password",
"long_lived_token": "long_lived_token",
"new_password": "new_password."
}Sample response
{
"message": "Password updated successfully.",
"success": true
}These functions handle internal operations and are not directly exposed to external clients.
This step involves storing tokens securely for the authenticated entity.
requestStoreEntityTokenRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| long_lived_token | string | The long-lived token for the authenticated session. |
| token | string | The token to be stored. |
| platform | string | The platform from which the token is being issued. (e.g., "gmail"). |
| account_identifier | string | The identifier of the account associated with the token. |
Optional fields:
| Field | Type | Description |
|---|---|---|
| code_verifier | string | A cryptographic random string used in the PKCE flow. |
responseStoreEntityTokenResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | boolean | Indicates if the operation was successful. |
methodStoreEntityToken
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/StoreEntityToken <payload.jsonSample payload.json
{
"long_lived_token": "long_lived_token",
"authorization_code": "oauth2_code",
"platform": "gmail",
"protocol": "oauth2"
}Sample response
{
"message": "Token stored successfully.",
"success": true
}This function retrieves an entity's access token.
requestGetEntityAccessTokenRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| device_id or phone_number or long_lived_token | string | The unique identifier of the device or the phone number or the long lived token used by the entity. |
| platform | string | The platform from which the token is being issued. (e.g., "gmail"). |
| account_identifier | string | The identifier of the account associated with the token. |
responseGetEntityAccessTokenResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates if the operation was successful. |
| token | string | The retrieved token associated with the entity for the specified platform. |
methodGetEntityAccessToken
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d '{"device_id": "device_id", "platform": "gmail", "account_identifier": "sample@mail.com"}' \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/GetEntityAccessTokenSample response
{
"message": "Successfully fetched tokens",
"success": true,
"token": "retrieved_token"
}This function handles decrypting payload content.
requestDecryptPayloadRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| device_id or phone_number | string | The unique identifier of the device or the phone number used by the entity. |
| payload_ciphertext | string | The encrypted payload ciphertext that needs to be decrypted. |
responseDecryptPayloadResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates if the operation was successful. |
| payload_plaintext | string | The decrypted payload plaintext. |
methodDecryptPayload
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d '{"device_id": "device_id", "payload_ciphertext": "encrypted_payload"}' \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/DecryptPayloadSample response
{
"message": "Successfully decrypted payload",
"success": true,
"payload_plaintext": "Decrypted payload content"
}This function handles the encryption of payload content.
requestEncryptPayloadRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| device_id | string | The unique identifier of the device used by the entity. |
| payload_plaintext | string | The plaintext payload content to be encrypted. |
responseEncryptPayloadResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| payload_ciphertext | string | The encrypted payload ciphertext. |
| success | bool | Indicates if the operation was successful. |
methodEncryptPayload
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d '{"device_id": "device_id", "payload_plaintext": "plaintext_payload"}' \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/EncryptPayloadSample response
{
"message": "Successfully encrypted payload.",
"payload_ciphertext": "encrypted_payload",
"success": true
}This function updates tokens associated with an entity.
requestUpdateEntityTokenRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| device_id or phone_number | string | The unique identifier of the device or the phone number used by the entity. |
| token | string | The new token to be updated for the entity. |
| platform | string | The platform from which the token is being updated. (e.g., "gmail"). |
| account_identifier | string | The identifier of the account associated with the token. |
responseUpdateEntityTokenResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates if the operation was successful. |
methodUpdateEntityToken
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d '{"device_id": "device_id", "token": "new_token", "platform": "gmail", "account_identifier": "sample@mail.com"}' \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/UpdateEntityTokenSample response
{
"message": "Token updated successfully.",
"success": true
}This function deletes tokens associated with an entity.
requestDeleteEntityTokenRequest
Important
The table lists only the required fields for this step. Other fields will be ignored.
| Field | Type | Description |
|---|---|---|
| long_lived_token | string | The long-lived token for the authenticated session. |
| platform | string | The platform from which the token is being updated. (e.g., "gmail"). |
| account_identifier | string | The identifier of the account associated with the token. |
responseDeleteEntityTokenResponse
Important
The table lists only the fields that are populated for this step. Other fields may be empty, omitted, or false.
| Field | Type | Description |
|---|---|---|
| message | string | A response message from the server. |
| success | bool | Indicates if the operation was successful. |
methodDeleteEntityToken
Tip
The examples below use grpcurl.
Note
Here is what a successful response from the server looks like.
The server would return a status code of 0 OK if the API transaction goes
through without any friction. Otherwise, it will return any other code out of
the
17 codes supported by gRPC.
Sample request
grpcurl -plaintext \
-d @ \
-proto protos/v1/vault.proto \
localhost:6000 vault.v1.Entity/DeleteEntityToken <payload.jsonSample payload.json
{
"long_lived_token": "long_lived_token",
"platform": "gmail",
"account_identifier": "sample@mail.com"
}Sample response
{
"message": "Token deleted successfully.",
"success": true
}