Steps include in Encrypted API execution:
JSON Request Payload :
{ "api-version": "1.0", "security-id": "5c45a01919eab5c4b0ce5484daf8105bc2bbb7bd0e958cb122864c67ac249322", "flow-id": "ZH0RKJvh", "calls": [ { "client-identifier": "7845sdwq", "start-time": "2022-01-23T08:02:53.311+05:30", "contact-numbers": [ "7016225597" ], "keys": [] } ] }
Base64 Encoded json payload:
Online site to convert normal text to base64: https://www.base64encode.org/ ewogICJhcGktdmVyc2lvbiI6ICIxLjAiLAogICJzZWN1cml0eS1pZCI6ICI1YzQ1YTAxOTE5ZWFiNWM0YjBjZTU0ODRkYWY4MTA1YmMyYmJiN2JkMGU5NThjYjEyMjg2NGM2N2FjMjQ5MzIyIiwKICAiZmxvdy1pZCI6ICJaSDBSS0p2aCIsCiAgImNhbGxzIjogWwogICAgewogICAgICAiY2xpZW50LWlkZW50aWZpZXIiOiAiNzg0NXNkd3EiLAogICAgICAic3RhcnQtdGltZSI6ICIyMDIyLTAxLTIzVDA4OjAyOjUzLjMxMSswNTozMCIsCiAgICAgICJjb250YWN0LW51bWJlcnMiOiBbCiAgICAgICAgIjcwMTYyMjU1OTciCiAgICAgIF0sCiAgICAgICJrZXlzIjogW10KICAgIH0KICBdCn0=
AES Encryption of base encoded JSON payload:
Need one key: You can generate any random key (6-8 digit) abcd1234 AES base64 encoded key - YWJjZDEyMzQ= Apply AES encryption on base64 encoded json payload using base64 encoded aes key
API to convert request payload to encrypted data:
URL:https://central-awsdev.phonon.io/kairos-apis/enc/outbound/encryptdata request: { "requestValue":"ewogICJhcGktdmVyc2lvbiI6ICIxLjAiLAogICJzZWN1cml0eS1pZCI6ICI1YzQ1YTAxOTE5ZWFiNWM0YjBjZTU0ODRkYWY4MTA1YmMyYmJiN2JkMGU5NThjYjEyMjg2NGM2N2FjMjQ5MzIyIiwKICAiZmxvdy1pZCI6ICJaSDBSS0p2aCIsCiAgImNhbGxzIjogWwogICAgewogICAgICAiY2xpZW50LWlkZW50aWZpZXIiOiAiNzg0NXNkd3EiLAogICAgICAic3RhcnQtdGltZSI6ICIyMDIyLTAxLTIzVDA4OjAyOjUzLjMxMSswNTozMCIsCiAgICAgICJjb250YWN0LW51bWJlcnMiOiBbCiAgICAgICAgIjcwMTYyMjU1OTciCiAgICAgIF0sCiAgICAgICJrZXlzIjogW10KICAgIH0KICBdCn0=", "aesKey":"abcd1234", "flowID":"ZH0RKJvh" } Response: { "flowID": "ZH0RKJvh", "requestEncryptedValue": "pIisitW+w8s2Dz4NfUm3EH2RnBU/X2HctqMmgheJI/dVsyDSKDPKBbydBLsQuNTqioA2wYjENo1EyH9ZXol3NNuWtR5yhcQFHPvcJGOQw7DCHe6FfRIFaAiYyz/dYMhVICrDKhmVyAcaZkBkFkjvE9IuvaIqNDb3fWRW2faO4+IRgYkh/701mAIqMYohFWWP+JmIbah+VpaQ6SoHYR+JjHNuXmKq8KkrCJOTlCyakX/u05vmWr/h8TQmgo+XLJaygrcQf2oJFreWqarFyk4CsQV4XhCoyia0PK7r6Wb1f5qC3oofPG3dE1mYrya+96bVcBVFj0MCFQvLRUQ7LLNAkf0XfWMFNVOtoBd7iGHY7K8jvX46sQ1jA3SDpcVwMsP/OtQCK1r0oClRCBjWo6C0BIwVomstjSdGvIM4buwSgBQUIri4deAaFFmR0yOIIJyF/Ytg+h2aWnOTK0LLC6TNpHhmyWxwTd0QJnoUT4ob11BgOBqYigCnQTCWzhslcK6veeuxADmiykq/36SxIgispNigMW8nUTEhiP+b9TyKPsIl1fxMRFsVvtWKbyK78/mNWbCUic3bpOX+i6M7l+pdFg==", "requestDigitalSignatureValue": "dlUetVwjP4GFx6064lHMrXLtKYx+A7+TKHZQvhmJ60Rbxc1lV4eslwG47OglT/zqyrpa56/9LSnd0HjF6gp3eqTIsaKqXUv9eFXp8IgxR7NIjwebnVNW0LxYmgMgtwaC7CKwOlHjudLxFtAnEhow4G5Kua5jhIoKGQsZ/EHRbDwJpEmw5hDF+VX9xjbsQo5trWu7+jjqCaa2S+186FGPQwDGldu13/LP4s7Ly7bZgds0ozOqceRFAUtAUUiMXn6kaRJeqWgPSakBskEy8H3+cFiXOh7NBEykkne3JJkjMIDrFprHY76ofnZXO3AMXdN3uxjtzYMC5ApnGDB+YIkrj6yVid1+6/U9JYNf521ifVigpEhcWqMVdDibbRCKz3movmPWtRPisJvAZ6XBmKvE1YK3lGGaB4/DtkU0oc3F67JwbiVfQ9jaeuRW3cHVXZ9+VL0MdEPLrq/9xrgBg4gfS6BmHya3ogr67dhsRQ5TLpgGYvmhQpPKnnYaB4qesxdpk+UpL0cOuG3TWiT+HgLvj7JM7hOjJK8ANIizf514KggFpa4i6ZC7Ld/f0ugjzzJh+C8YVblFAIRWBaFMJT1z+9xFLS3IIQf388k5F5aNnD3Hi2Wsb33ESAkDK5X+I4YfXJIXXoMbyFB2izsVBA0FgS1XJML0DPaDJFp338r+pVE=" }
After AES encryption request JSON payload:
pIisitW+w8s2Dz4NfUm3EH2RnBU/X2HctqMmgheJI/dVsyDSKDPKBbydBLsQuNTqioA2wYjENo1EyH9ZXol3NNuWtR5yhcQFHPvcJGOQw7DCHe6FfRIFaAiYyz/dYMhVICrDKhmVyAcaZkBkFkjvE9IuvaIqNDb3fWRW2faO4+IRgYkh/701mAIqMYohFWWP+JmIbah+VpaQ6SoHYR+JjHNuXmKq8KkrCJOTlCyakX/u05vmWr/h8TQmgo+XLJaygrcQf2oJFreWqarFyk4CsQV4XhCoyia0PK7r6Wb1f5qC3oofPG3dE1mYrya+96bVcBVFj0MCFQvLRUQ7LLNAkf0XfWMFNVOtoBd7iGHY7K8jvX46sQ1jA3SDpcVwMsP/OtQCK1r0oClRCBjWo6C0BIwVomstjSdGvIM4buwSgBQUIri4deAaFFmR0yOIIJyF/Ytg+h2aWnOTK0LLC6TNpHhmyWxwTd0QJnoUT4ob11BgOBqYigCnQTCWzhslcK6veeuxADmiykq/36SxIgispNigMW8nUTEhiP+b9TyKPsIl1fxMRFsVvtWKbyK78/mNWbCUic3bpOX+i6M7l+pdFg==
After RSA encryption on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HY7K8jvX46sQ1jA3SDpcVwMsP/OtQCK1r0oClRCBjWo6C0BIwVomstjSdGvIM4buwSgBQUIri4deAaFFmR0yOIIJyF/Ytg+h2aWnOTK0LLC6TNpHhmyWxwTd0QJnoUT4ob11BgOBqYigCnQTCWzhslcK6veeuxADmiykq/36SxIgispNigMW8nUTEhiP+b9TyKPsIl1fxMRFsVvtWKbyK78/mNWbCUic3bpOX+i6M7l+pdFg==", "requestDigitalSignatureValue": "ClKdnVq3RBlzOiVaOU83prMrq9JfABjK+oYZcMI/Odcs+rmsxV9u8rlScdX1CQDNA2cyLSSVDLbcA0oB2MTikVTorsohjI0c9NxnxpAOw/jCQmepb6Ix9FIoJo+B3rjyxiwBR8MHLc+1cL1eNaKexx+TVgtjKZjLfu85efnkupZ65Vo80xuMqY+VE4lyKAIswMvWqvpBbhMBsbBsq5Po6GZATTf+A76Mo42k4N43V/gPdysZ8IcP6Wi1bLm+jcZuudsD1zrbPebnRxGlZZqKOBmQhe1iPxdQ3DViZEZzjEoCSWIUqhC5wwyFdmRbH3HuUdWV7qg7te9kOxy2RWnEep1vfd/60Gpvl7GrUvS1sSq20wDCELz7tKbL3YQAUgwMpwtAxDVweo+a26Ko4lcKNhMcwpCItmQqSQkByWlJCEb10edNuxtxup4LtDF/kH1mNWnwNYvnxo3OVyL9k3OBzdBqAzKO7aSEY8Hm1WZorSksEqxQ1z0OUQZFvrJFWsEH3opDGU2TS11VHgl9pg7BTDZpnXvZiIBFivB2Coa61EgBiROoVdaHBb8rF9Cy4kN8bcye3hZQh5Oq37/wJLDjEefisXpRm4qfQMtSZ6Yb/kLs3TD6+75m9LggYSXrxSmPlbrjWGY0tXBzN8hGW0xRhURuYESuDYH3L6WpG1JNZ54=", "flowID": "ZH0RKJvh" }
Invoke kairos API:
Sample API for Outbound flow. URl: https://central-awsdev.phonon.io/kairos-apis/enc/outbound/create Request: { "requestEncryptedValue": "pIisitW+w8s2Dz4NfUm3EH2RnBU/X2HctqMmgheJI/dVsyDS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GU2TS11VHgl9pg7BTDZpnXvZiIBFivB2Coa61EgBiROoVdaHBb8rF9Cy4kN8bcye3hZQh5Oq37/wJLDjEefisXpRm4qfQMtSZ6Yb/kLs3TD6+75m9LggYSXrxSmPlbrjWGY0tXBzN8hGW0xRhURuYESuDYH3L6WpG1JNZ54=", "flowID": "ZH0RKJvh" }
Take flowid: ZH0RKJvh
Fetch public-private key of a given flow. (ZH0RKJvh_public.key,ZH0RKJvh_private.key) (Path of keys: /home/PHONON/)RSA decryption of digital signature:
service will use: ZH0RKJvh_private.key for decryption service will get AES base64 encoded key: YWJjZDEyMzQ=
AES decryption using AES base64encoded key: YWJjZDEyMzQ=
AES Decrypted json request payload: ewogICJhcGktdmVyc2lvbiI6ICIxLjAiLAogICJzZWN1cml0eS1pZCI6ICI1YzQ1YTAxOTE5ZWFiNWM0YjBjZTU0ODRkYWY4MTA1YmMyYmJiN2JkMGU5NThjYjEyMjg2NGM2N2FjMjQ5MzIyIiwKICAiZmxvdy1pZCI6ICJaSDBSS0p2aCIsCiAgImNhbGxzIjogWwogICAgewogICAgICAiY2xpZW50LWlkZW50aWZpZXIiOiAiNzg0NXNkd3EiLAogICAgICAic3RhcnQtdGltZSI6ICIyMDIyLTAxLTIzVDA4OjAyOjUzLjMxMSswNTozMCIsCiAgICAgICJjb250YWN0LW51bWJlcnMiOiBbCiAgICAgICAgIjcwMTYyMjU1OTciCiAgICAgIF0sCiAgICAgICJrZXlzIjogW10KICAgIH0KICBdCn0=
The original request JSON payload
Service wil apply base64 decode on AES decrypted request payload and get orginal JSON request payload. { "api-version": "1.0", "security-id": "5c45a01919eab5c4b0ce5484daf8105bc2bbb7bd0e958cb122864c67ac249322", "flow-id": "ZH0RKJvh", "calls": [ { "client-identifier": "7845sdwq", "start-time": "2022-01-23T08:02:53.311+05:30", "contact-numbers": [ "7016225597" ], "keys": [] } ] }
Once the service will receive a normal SON request payload it will apply a normal API process on it and revert the appropriate response.
Steps include in Generate public and private Key For RSA encryption :
Request Parameters:
URL | https://central.phonon.io/kairos-apis/enc/outbound/generateKeyPair |
---|---|
Method | POST |
Body | JSON |
Headers | Content-Type: application/json |
Auth | None |
Payload Schema:
{ "flow-id": "<8 character alphanumeric>" }
Sample Payload:
{ "flow-id": "ZH0RKJvh" }
Request Parameters Explanation:
flow-id
: Get the 8 characters alphanumeric Flow ID from the ‘Edit Flow’ page of any Outbound/Outbound Dialer Flow
Response:
{ "response": "RSA Encryption key pair generated.", "responseCode": "200" }
<flowID>_public.key and <flowID>_private.key stored at path “home/PHONON” on the server.
All Error Codes:
Status Code | Status Message | Status Name | |
---|---|---|---|
1 | 400 | Invalid Format | INVALID_FORMAT |
2 | 201 | Checksum Repeated | CHECKSUM_REPEATED |
3 | 302 | Empty Call List | EMPTY_CALL_LIST |
4 | 500 | Failure | FAILURE |
5 | 301 | Invalid Flow ID | INVALID_FLOW_ID |
6 | 401 | IP Not Whitelisted | IP_NOT_WHITELISTED |
7 | 402 | Phone Not Whitelisted | PHONE_NOT_WHITELISTED |
8 | 202 | Invalid Security ID | INVALID_SECURITY_ID |
9 | 200 | Success | SUCCESS |
10 | 203 | API Version not Supported | INVALID_API_VERSION |
11 | 204 | Invalid SMS Gateway | INVALID_GATEWAY_ID |
12 | 205 | Invalid Contact Number | INVALID_CONTACT_NUMBER |
13 | 206 | Failure from Gateway | FAILURE_FROM_GATEWAY |
14 | 207 | DID Not Mapped | DID_NOT_MAPPED |
15 | 208 | No Mask Available | NO_MASK_AVAILABLE |
16 | 209 | Partial Success | PARTIAL_SUCCESS |
17 | 210 | Invalid Mandatory Parameters | INVALID_MANDATORY_PARAMETERS |
18 | 303 | Max Data List Size Exceeded | MAX_DATA_LIST_SIZE_EXCEEDED |
19 | 211 | Validity Expired | VALIDITY_EXPIRED |
20 | 212 | Insufficient Balance | INSUFFICIENT_BALANCE |
21 | 304 | Invalid Flow Version | INVALID_FLOW_VERSION |
22 | 213 | No Data Available | NO_DATA_AVAILABLE |
Add Comment