harensarma

API return Types

May 25th, 2021
1,264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <?php
  2. ## Register API
  3. /*------ CODE --------- */
  4.  
  5. ### Return Data:
  6. $data = [
  7.     'status'  => true, # or false
  8.    'message' => "OTP has been sent" ## or validation error
  9. ];
  10.  
  11.  
  12. ## Register API Verification
  13. /*------ CODE --------- */
  14.  
  15. ### Return Data:
  16. $data = [
  17.     'status'  => true, # or false
  18.    'message' => [
  19.         'userid' => 1, ## User ID of the User
  20.        'name'   => 'Udipta',
  21.     ] # or OTP error
  22. ];
  23.  
  24.  
  25. ## Login
  26. /*------ CODE --------- */
  27.  
  28. ### Return Data:
  29. $data = [
  30.     'status'  => true, # or false
  31.    'message' => "OTP has been sent" ## or validation error
  32. ];
  33.  
  34. ## Login API Verification
  35. /*------ CODE --------- */
  36.  
  37. ### Return Data:
  38. $data = [
  39.     'status'  => true, # or false
  40.    'message' => [
  41.         'userid' => 1, ## User ID of the User
  42.        'name'   => 'Udipta',
  43.     ] # or OTP error
  44. ];
  45.  
  46. ## User Profile Detail
  47. /*------ CODE --------- */
  48.  
  49. ### Return Data:
  50. $data = [
  51.     'status'  => true, # or false
  52.    'message' => [
  53.         'userid'  => 1, ## User ID of the User
  54.        'profile' => Users::find($id),
  55.     ],
  56. ];
  57.  
  58. ### List Coins and Funds of particular user:
  59. /*------ CODE --------- */
  60.  
  61. $coin_with_fund_array = [
  62.     'coin_name'      => 'ETH',
  63.     'coin_id'        => 1,
  64.     'wallet_balance' => 0.001,
  65. ];
  66. ## Return data
  67. $data = [
  68.     'status'  => true, # or false
  69.    'message' => [
  70.         'userid'  => 1, ## User ID of the User
  71.        'wallets' => $coin_with_fund_array,
  72.     ] # or OTP error
  73. ];
  74.  
  75.  
Advertisement
Add Comment
Please, Sign In to add comment