Skip to main content

User Profile V2 APIโ€‹

This API returns the same user profile as v1 but in AES-CBC encrypted format for enhanced security.

๐Ÿ” Decryption Logicโ€‹

Use the function below to decrypt the encrypted fields.

โš ๏ธ Note: You need to obtain the sKey (secret key) from the support team.

function decryptWithAEScbc(sKey, str) {
const combined = CryptoJS.enc.Base64.parse(str); // Parse Base64 input
const extractedIv = CryptoJS.lib.WordArray.create(combined.words.slice(0, 4));
extractedIv.sigBytes = 16; // Extract IV (first 16 bytes)
const ciphertext = CryptoJS.lib.WordArray.create(combined.words.slice(4));
ciphertext.sigBytes = combined.sigBytes - 16; // Extract ciphertext
const key = CryptoJS.enc.Utf8.parse(sKey); // Convert key to WordArray

const decrypted = CryptoJS.AES.decrypt(
{ ciphertext },
key,
{ iv: extractedIv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }
);

return decrypted.toString(CryptoJS.enc.Utf8); // Return decrypted text
}

๐Ÿ”‘Header Parametersโ€‹

HeaderParameterTypeDescriptionExample / Enum
Content-Typecontent-typestringFormat of the request bodyapplication/json
Authorizationaccess_tokenstringToken for user authenticationBearer eyJhbGciOiJIUzI1NiIs...
x-api-keyx-api-keystringAPI key to authorize the request12345-abcde-67890-fghij

๐ŸŸข Response Status Code - 200 Okโ€‹

Content-Type: application/json

FieldTypeDescriptionExample / Enum
statusstringStatus of API call"success"
codestringResponse code for the user request"s-101"
messagestringMessage displayed when the API call is successful"Success Message"
datastringResponse data in encrypted format"ENCRYPTED_STRING"

Notes โš ๏ธโ€‹

  • You must contact the support team to obtain the correct AES key (sKey).
  • The encrypted data must be Base64-decoded before performing decryption.
  • Use AES-CBC mode with PKCS7 padding for decryption.
  • The first 16 bytes of the encoded string represent the Initialization Vector (IV).