{"id":27999234,"url":"https://github.com/voximplant/apiclient-php","last_synced_at":"2025-05-08T22:57:22.342Z","repository":{"id":34925110,"uuid":"190153341","full_name":"voximplant/apiclient-php","owner":"voximplant","description":"Voximplant Management API PHP client library","archived":false,"fork":false,"pushed_at":"2025-04-21T09:58:26.000Z","size":740,"stargazers_count":9,"open_issues_count":4,"forks_count":9,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-08T22:57:09.411Z","etag":null,"topics":["management-api","voximplant"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voximplant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2019-06-04T07:39:45.000Z","updated_at":"2025-04-21T09:58:28.000Z","dependencies_parsed_at":"2024-06-10T14:10:39.792Z","dependency_job_id":"499380e3-58d7-483b-b09b-e5a40c4508de","html_url":"https://github.com/voximplant/apiclient-php","commit_stats":{"total_commits":34,"total_committers":3,"mean_commits":"11.333333333333334","dds":0.2647058823529411,"last_synced_commit":"e6f28055918a478ee0c0eaa9fc9bd897838733ce"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fapiclient-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fapiclient-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fapiclient-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fapiclient-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voximplant","download_url":"https://codeload.github.com/voximplant/apiclient-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160791,"owners_count":21863627,"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":["management-api","voximplant"],"created_at":"2025-05-08T22:57:21.380Z","updated_at":"2025-05-08T22:57:22.335Z","avatar_url":"https://github.com/voximplant.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Voximplant API client library\n\n#### Version 3.1.0\n\n## Prerequisites\n\nIn order to use the Voximplant PHP SDK, you need the following:\n\n1. A developer account. If you don't have one, [sign up here](https://manage.voximplant.com/auth/sign_up).\n1. A private API key. There are 2 options to obtain it:\n    1. Either generate it in the [Voximplant Control panel](https://manage.voximplant.com/settings/service_accounts)\n    1. Or call the [CreateKey](https://voximplant.com/docs/references/httpapi/rolesystem#createkey) HTTP API method with\n       the specified [authentication parameters](https://voximplant.com/docs/howtos/integration/httpapi/auth). You'll\n       receive a response with the __result__ field in it. Save the __result__ value in a file (since we don't store the\n       keys, save it securely on your side).\n\n## How to use\n\nTo install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:\n\n```json \n{\n  \"require\": {\n    \"voximplant/apiclient-php\": \"*@dev\"\n  }\n}\n```\n\nThen run\n\n```bash\ncomposer install\n```\n\nNext, specify the path to the file with the __result__ value either in the constructor or using the environment.\n\n__constructor__:\n\n```php\n$voxApi = new VoximplantApi('path/to/private/api/key.json');\n```\n\n__env__:\n\n```php\n$_ENV['VOXIMPLANT_CREDENTIALS_PATH'] = 'path/to/private/api/key.json';\n```\n\nFrom now on you have access to the SDK methods.\n\n## Examples\n\n### Start a scenario\n\n```php\nuse Voximplant\\VoximplantApi;\nuse Voximplant\\Resources\\Params\\StartScenariosParams;\n\n// Create API Object\n$voxApi = new VoximplantApi('path/to/private/api/key.json');\n\n/**\n * @param array $params (See below)\n * rule_id - The rule ID.\n * script_custom_data - The script custom data (like a script argument). Can be accessed in JS scenario via the VoxEngine.customData() method\n */\n$params = new StartScenariosParams();\n\n$params-\u003erule_id = 1;\n$params-\u003escript_custom_data = 'mystr';\n\n// Start the scripts from the account.\n$result = $voxApi-\u003eScenarios-\u003eStartScenarios($params);\n\n// Show result\nprint_r($result);\n```\n\n### Send an SMS\n\n```php\nuse Voximplant\\VoximplantApi;\nuse Voximplant\\Resources\\Params\\SendSmsMessageParams;\n\n// Create API Object\n$voxApi = new VoximplantApi('path/to/private/api/key.json');\n\n/**\n * @param array $params (See below)\n * source - The source phone number.\n * destination - The destination phone number.\n * sms_body - The message.\n */\n$params = new SendSmsMessageParams();\n\n$params-\u003esource = '447443332211';\n$params-\u003edestination = '447443332212';\n$params-\u003esms_body = 'Test message';\n\n// Send the SMS message with text \"Test message\" from the phone number 447443332211 to the phone number 447443332212.\n$result = $voxApi-\u003eSMS-\u003eSendSmsMessage($params);\n\n// Show result\nprint_r($result);\n```\n\n### Get a call history item\n\n```php\nuse Voximplant\\VoximplantApi;\nuse Voximplant\\Resources\\Params\\GetCallHistoryParams;\n\n// Create API Object\n$voxApi = new VoximplantApi('path/to/private/api/key.json');\n\n/**\n * @param array $params (See below)\n * from_date - The from date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss\n * to_date - The to date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss\n * count - The max returning record count.\n * timezone - The selected timezone or the 'auto' value (will be used the account location).\n */\n$params = new GetCallHistoryParams();\n\n$params-\u003efrom_date = '2012-01-01 00:00:00';\n$params-\u003eto_date = '2014-01-01 00:00:00';\n$params-\u003ecount = 1;\n$params-\u003etimezone = 'Etc/GMT';\n\n// Get the first call session history record from the 2012-01-01 00:00:00 UTC to the 2014-01-01 00:00:00 UTC\n$result = $voxApi-\u003eHistory-\u003eGetCallHistory($params);\n\n// Show result\nprint_r($result);\n```\n\n### Get the transaction history\n\n```php\nuse Voximplant\\VoximplantApi;\nuse Voximplant\\Resources\\Params\\GetTransactionHistoryParams;\n\n// Create API Object\n$voxApi = new VoximplantApi('path/to/private/api/key.json');\n\n/**\n * @param array $params (See below)\n * from_date - The from date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss\n * to_date - The to date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss\n * count - The max returning record count.\n * transaction_type - The transaction type list. The following values are possible: periodic_charge, resource_charge, money_distribution, subscription_charge, subscription_installation_charge, card_periodic_payment, card_overrun_payment, card_payment, robokassa_payment, gift, add_money, subscription_cancel, adjustment, wire_transfer, refund.\n * timezone - The selected timezone or the 'auto' value (will be used the account location).\n */\n$params = new GetTransactionHistoryParams();\n\n$params-\u003efrom_date = '2012-01-01 00:00:00';\n$params-\u003eto_date = '2014-01-01 00:00:00';\n$params-\u003ecount = 3;\n$params-\u003etransaction_type = array (\n    0 =\u003e 'gift',\n    1 =\u003e 'money_distribution',\n);\n$params-\u003etimezone = 'Etc/GMT';\n\n// Get the three transactions record from the 2012-01-01 00:00:00 UTC to the 2014-01-01 00:00:00 UTC with the 'gift' or 'money_distribution' types.\n$result = $voxApi-\u003eHistory-\u003eGetTransactionHistory($params);\n \n// Show result\nprint_r($result);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoximplant%2Fapiclient-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoximplant%2Fapiclient-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoximplant%2Fapiclient-php/lists"}