{"id":19922661,"url":"https://github.com/lasvegascoder/api","last_synced_at":"2025-03-01T10:16:45.961Z","repository":{"id":141255354,"uuid":"98512724","full_name":"LasVegasCoder/API","owner":"LasVegasCoder","description":"API Caller is a private PHP Class that is capable of calling any API endpoint and return the response ","archived":false,"fork":false,"pushed_at":"2020-03-23T00:39:10.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T00:13:28.477Z","etag":null,"topics":["api","api-caller","api-client","api-documentation","api-gateway","api-rest","api-server","api-service","api-wrapper","encrypted-data","php"],"latest_commit_sha":null,"homepage":"http://api.hosts.city","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LasVegasCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-27T08:31:37.000Z","updated_at":"2020-03-23T00:39:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fce9482-98e1-4a44-a46b-95c864cfb6c0","html_url":"https://github.com/LasVegasCoder/API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasVegasCoder%2FAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasVegasCoder%2FAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasVegasCoder%2FAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasVegasCoder%2FAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasVegasCoder","download_url":"https://codeload.github.com/LasVegasCoder/API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241348358,"owners_count":19948164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-caller","api-client","api-documentation","api-gateway","api-rest","api-server","api-service","api-wrapper","encrypted-data","php"],"created_at":"2024-11-12T22:11:49.323Z","updated_at":"2025-03-01T10:16:45.940Z","avatar_url":"https://github.com/LasVegasCoder.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/94efe4cd8f0a476196f38594459cfd57)](https://app.codacy.com/manual/LasVegasCoder/API?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=LasVegasCoder/API\u0026utm_campaign=Badge_Grade_Dashboard)\n\nPrinceAPICaller is a private PHP Class written for the simplicity of calling different API\n\n\tSupport various methods: \n\tPOST|GET|, (PUT|DEL|) are optional.\n\nYou can also encrypt your data before sending it across the protected or non protected connection.\n\nWith this Class, you will not find any better API Caller Class.  \nLet me demonstrate the usage: \n\n\tUsage:\n\t\t\tAssuming you want to call Amazon;\n\t\t\tcreate index.php or include this class where you wanted to use it;\n\t\t\nStep #1 Downoad this class:\n\n\twget https://github.com/LasVegasCoder/API/blob/master/APICall.php\n\tInclude it in your application, for example create emplty test.php\n\t\u003c?php\n\t//Include the class\n\tinclude_once(\"APICall.php\");\n\t\n\t//Instantial the class for new app with the name $my_app\n\t$my_app = new PrinceAPICaller();  \n\t\n\t//Call the Endpoint API\n      \t$result = $my_app-\u003e_sendRequest('http://amazon.com/whatever/path/api/or/webpage');\n\t\n\t//Print results.\n      \tprint_r( $result );\n\t\t\n\t?\u003e\n\nOr use this to pass `data` or `parameters` to another resources.\n\t\n\t//Create the params to pass.\t\n        $data = array( 'username' =\u003e 'MyUsername', 'password' =\u003e 'Mypassword' );\n\t\n\t//Send request to endpoint\n        $my_app-\u003e_sendRequest('http://amazon.com/whatever/path/api/or/webpage', $data );\n\t\t\t\nTo use get other method other than 'POST', just pass the METHOD into the Constructor\neg. To Call google with GET method, just pass 'GET' into the constructor like this:\n\t\n\t//Instantiate the Class with GET Method\n        $my_app = new PrinceAPICaller('GET');\n\t\n\t// Send request to the endpoint\n        $result = $my_app-\u003e_sendRequest('http//google.com');\n\t\n\t//Print result\n        print_r( $result );\n\t\t\nAdded encrypt options, this way you can encrypt your client data from your app, \nbrowser etc before sending it to server side process.\n\t\t\n\t\tFor example: User sending a form from your app or webpage, for a strong security;\n\t\t\n\t\ta.) Form data is encrypted:\n\t\tb.) Encrypted Form data is sent to your server over non-encrypted or encryped connection.\n\t\tc.) Server received and decrypt the encrypted FormData, then process it.\n\t\t\nWith SSL/Ciphers exploits, I decided to do `private` encryption of `Sensitive DATA` \nif any hacker get any sniffed DATA over network or internet due to vulunerability, \nthe stolen data will be useless for them, unless they can get the `key to decrypt` that `stolen DATA` \n(Which is only known and randomly changed, updated on auto from the server).\n\t\t\nLet me demonstrate how to send encrypt sensitive data and send it wire. \n\n\tFor example:\n\t//Data to encrypt is an array of data:\n\t\n\t      $DataToEncrypt = array(\n\t\t'username' =\u003e $username,\n\t\t'password' =\u003e $password,\n\t\t'email' =\u003e $email,\n\t\t'payment' =\u003e array(\n\t\t  'paymentid' =\u003e $paymentID,\n\t\t  'creditcard' =\u003e $creditcard,\n\t\t  'expiredate' =\u003e $expire,\n\t\t  'billing' =\u003e $billing\n\t\t),\n\t\t'status' =\u003e $status\n\t      );\n\t\n\t//Store EncrytedDATA is a variable. That is what is going to be sent to the server.\n\t// The Server know the key to decpryt it.\n      $EncryptedDATA = EncryptIt( $DataToEncrypt, null, 'myGreatSecreteKey' );\n      \n      //See the encrypted data as it will appear to attacker, if compromised or sniffed.\n      print_r($EncryptedDATA);\n\t\t\n\n\tNow you can send $EncryptedDATA to Server and use 'myGreatSecreteKey' to Decrypt it \n\tfrom the server before processing.\n\t\t\n\t\tSo on your server:\n\t\t//receive incoming data;\n\t\t$incomingData = $_REQUEST['form_data'];\n\n\t\t//Decrypt the encrypted data\n\t\t$Decrypted = DecryptIt( $incomingData, null, 'myGreatSecreteKey' );\n\n\t\t//Process the decrypted data;\n\t\tprint_r(  $Decrypted );\n\t\t  \nThis is very useful when you are concerned about network sniffing, hacking, etc.  \nEven if attacker get your encrypted data, \nit is completely useless unless he/she know your secret key to the data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasvegascoder%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasvegascoder%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasvegascoder%2Fapi/lists"}