{"id":36381305,"url":"https://github.com/didww/didww-api-3-php-sdk","last_synced_at":"2026-02-27T22:29:11.002Z","repository":{"id":38429815,"uuid":"163860373","full_name":"didww/didww-api-3-php-sdk","owner":"didww","description":"PHP SDK for DIDWW API 3","archived":false,"fork":false,"pushed_at":"2026-02-27T14:56:15.000Z","size":393,"stargazers_count":12,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-02-27T19:40:55.682Z","etag":null,"topics":["api-client","didww","didww-api","json-api","php-sdk","voip"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/didww.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-01-02T15:49:24.000Z","updated_at":"2026-02-27T14:56:20.000Z","dependencies_parsed_at":"2024-07-27T09:54:32.646Z","dependency_job_id":null,"html_url":"https://github.com/didww/didww-api-3-php-sdk","commit_stats":{"total_commits":76,"total_committers":6,"mean_commits":"12.666666666666666","dds":0.631578947368421,"last_synced_commit":"5ed07fdffecb27f642f86ff103755782f4f8c686"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/didww/didww-api-3-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didww%2Fdidww-api-3-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didww%2Fdidww-api-3-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didww%2Fdidww-api-3-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didww%2Fdidww-api-3-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/didww","download_url":"https://codeload.github.com/didww/didww-api-3-php-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didww%2Fdidww-api-3-php-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29917598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-client","didww","didww-api","json-api","php-sdk","voip"],"created_at":"2026-01-11T14:56:53.383Z","updated_at":"2026-02-27T22:29:10.996Z","avatar_url":"https://github.com/didww.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP client for DIDWW API v3.\n\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/didww/didww-api-3-php-sdk.svg)](https://packagist.org/packages/didww/didww-api-3-php-sdk)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/didww/didww-api-3-php-sdk.svg)](https://packagist.org/packages/didww/didww-api-3-php-sdk)\n![Tests](https://github.com/didww/didww-api-3-php-sdk/workflows/Tests/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/didww/didww-api-3-php-sdk/badge.svg?branch=master)](https://coveralls.io/github/didww/didww-api-3-php-sdk?branch=master)\n\n## About DIDWW API v3\n\nThe DIDWW API provides a simple yet powerful interface that allows you to fully integrate your own applications with DIDWW services. An extensive set of actions may be performed using this API, such as ordering and configuring phone numbers, setting capacity, creating SIP trunks and retrieving CDRs and other operational data.\n\nThe DIDWW API v3 is a fully compliant implementation of the [JSON API specification](http://jsonapi.org/format/).\n\nRead more https://doc.didww.com/api\n\n## Requirements\n\n- PHP 8.2+\n\n## Installation\n\n```sh\ncomposer require didww/didww-api-3-php-sdk\n```\n\n## Usage\n\n```php\n$credentials = new Didww\\Credentials('YOUR_API_KEY', 'sandbox');\nDidww\\Configuration::configure($credentials, ['timeout' =\u003e 20]);\n\n// Check balance\n$balance = Didww\\Item\\Balance::find()-\u003egetData();\necho \"Balance: \" . $balance-\u003egetTotalBalance();\n\n// List DID groups with stock keeping units\n$didGroups = Didww\\Item\\DidGroup::all([\n    'include' =\u003e 'stock_keeping_units',\n    'filter' =\u003e ['area_name' =\u003e 'Acapulco'],\n])-\u003egetData();\n```\n\nFor more examples visit [examples/](examples/).\n\nFor details on obtaining your API key please visit https://doc.didww.com/api#introduction-api-keys\n\n## Examples\n\n- Source code: [examples/](examples/)\n- How to run: [examples/README.md](examples/README.md)\n\n## Configuration\n\n```php\n// Sandbox\n$credentials = new Didww\\Credentials('YOUR_API_KEY', 'sandbox');\nDidww\\Configuration::configure($credentials, ['timeout' =\u003e 20]);\n\n// Production\n$credentials = new Didww\\Credentials('YOUR_API_KEY', 'production');\nDidww\\Configuration::configure($credentials, ['timeout' =\u003e 20]);\n```\n\n### Environments\n\n| Environment | Base URL |\n|-------------|----------|\n| `production` | `https://api.didww.com/v3` |\n| `sandbox` | `https://sandbox-api.didww.com/v3` |\n\n## Resources\n\n### Read-Only Resources\n\n```php\n// Countries\n$countries = Didww\\Item\\Country::all()-\u003egetData();\n$country = Didww\\Item\\Country::find('uuid')-\u003egetData();\n\n// Regions\n$regions = Didww\\Item\\Region::all()-\u003egetData();\n\n// Cities\n$cities = Didww\\Item\\City::all()-\u003egetData();\n\n// Areas\n$areas = Didww\\Item\\Area::all()-\u003egetData();\n\n// NANPA Prefixes\n$prefixes = Didww\\Item\\NanpaPrefix::all()-\u003egetData();\n\n// POPs (Points of Presence)\n$pops = Didww\\Item\\Pop::all()-\u003egetData();\n\n// DID Group Types\n$types = Didww\\Item\\DidGroupType::all()-\u003egetData();\n\n// DID Groups (with stock keeping units)\n$groups = Didww\\Item\\DidGroup::all(['include' =\u003e 'stock_keeping_units'])-\u003egetData();\n\n// Available DIDs\n$available = Didww\\Item\\AvailableDid::all([\n    'include' =\u003e 'did_group.stock_keeping_units',\n])-\u003egetData();\n\n// Proof Types\n$proofTypes = Didww\\Item\\ProofType::all()-\u003egetData();\n\n// Public Keys\n$publicKeys = Didww\\Item\\PublicKey::all()-\u003egetData();\n\n// Requirements\n$requirements = Didww\\Item\\Requirement::all()-\u003egetData();\n\n// Balance (singleton)\n$balance = Didww\\Item\\Balance::find()-\u003egetData();\n```\n\n### DIDs\n\n```php\n// List DIDs\n$dids = Didww\\Item\\Did::all()-\u003egetData();\n\n// Update DID - assign trunk and capacity\n$did = Didww\\Item\\Did::find('uuid')-\u003egetData();\n$did-\u003esetDescription('Updated');\n$did-\u003esetCapacityLimit(20);\n$did-\u003esetVoiceInTrunk(Didww\\Item\\VoiceInTrunk::build('trunk-uuid'));\n$did-\u003esave();\n```\n\n### Voice In Trunks\n\n```php\nuse Didww\\Enum\\CliFormat;\nuse Didww\\Enum\\Codec;\nuse Didww\\Enum\\MediaEncryptionMode;\nuse Didww\\Enum\\SstRefreshMethod;\nuse Didww\\Enum\\TransportProtocol;\n\n// Create SIP trunk\n$sip = new Didww\\Item\\Configuration\\Sip([\n    'host' =\u003e 'sip.example.com',\n    'port' =\u003e 5060,\n    'codec_ids' =\u003e Didww\\Item\\Configuration\\Base::getDefaultCodecIds(),\n    'transport_protocol_id' =\u003e TransportProtocol::UDP,\n    'sst_refresh_method_id' =\u003e SstRefreshMethod::INVITE,\n    'media_encryption_mode' =\u003e MediaEncryptionMode::DISABLED,\n    'rerouting_disconnect_code_ids' =\u003e Didww\\Item\\Configuration\\Base::getDefaultReroutingDisconnectCodeIds(),\n]);\n\n$trunk = new Didww\\Item\\VoiceInTrunk();\n$trunk-\u003esetName('My SIP Trunk');\n$trunk-\u003esetCliFormat(CliFormat::E164);\n$trunk-\u003esetRingingTimeout(30);\n$trunk-\u003esetConfiguration($sip);\n\n$trunkDocument = $trunk-\u003esave();\n$trunk = $trunkDocument-\u003egetData();\n\n// Update trunk\n$trunk-\u003esetDescription('Updated');\n$trunk-\u003esave();\n\n// Delete trunk\n$trunk-\u003edelete();\n```\n\n### Voice In Trunk Groups\n\n```php\n$group = new Didww\\Item\\VoiceInTrunkGroup();\n$group-\u003esetName('Primary Group');\n$group-\u003esetCapacityLimit(50);\n$groupDocument = $group-\u003esave();\n```\n\n### Voice Out Trunks\n\n```php\nuse Didww\\Enum\\OnCliMismatchAction;\n\n$trunk = new Didww\\Item\\VoiceOutTrunk();\n$trunk-\u003esetName('My Outbound Trunk');\n$trunk-\u003esetAllowedSipIps(['0.0.0.0/0']);\n$trunk-\u003esetOnCliMismatchAction(OnCliMismatchAction::REPLACE_CLI);\n$trunk-\u003esetDefaultDid(Didww\\Item\\Did::build('did-uuid'));\n$trunkDocument = $trunk-\u003esave();\n```\n\n### Orders\n\n```php\nuse Didww\\Enum\\CallbackMethod;\n\n// Order by SKU\n$order = new Didww\\Item\\Order([\n    'allow_back_ordering' =\u003e true,\n    'items' =\u003e [\n        new Didww\\Item\\OrderItem\\Did(['sku_id' =\u003e 'sku-uuid', 'qty' =\u003e 2]),\n    ],\n]);\n$order-\u003esetCallbackUrl('https://example.com/callback');\n$order-\u003esetCallbackMethod(CallbackMethod::POST);\n$orderDocument = $order-\u003esave();\n\n// Order available DID\n$order = new Didww\\Item\\Order([\n    'items' =\u003e [\n        new Didww\\Item\\OrderItem\\AvailableDid([\n            'sku_id' =\u003e 'sku-uuid',\n            'available_did_id' =\u003e 'available-did-uuid',\n        ]),\n    ],\n]);\n\n// Order reserved DID\n$order = new Didww\\Item\\Order([\n    'items' =\u003e [\n        new Didww\\Item\\OrderItem\\ReservationDid([\n            'sku_id' =\u003e 'sku-uuid',\n            'did_reservation_id' =\u003e 'reservation-uuid',\n        ]),\n    ],\n]);\n\n// Order capacity\n$order = new Didww\\Item\\Order([\n    'items' =\u003e [\n        new Didww\\Item\\OrderItem\\Capacity([\n            'capacity_pool_id' =\u003e 'pool-uuid',\n            'qty' =\u003e 1,\n        ]),\n    ],\n]);\n```\n\n### DID Reservations\n\n```php\n$reservation = new Didww\\Item\\DidReservation();\n$reservation-\u003esetDescription('Reserved for client');\n$reservation-\u003esetAvailableDid(Didww\\Item\\AvailableDid::build('available-did-uuid'));\n$reservationDocument = $reservation-\u003esave();\n\n// Delete reservation\n$reservation-\u003edelete();\n```\n\n### Shared Capacity Groups\n\n```php\n$group = new Didww\\Item\\SharedCapacityGroup();\n$group-\u003esetName('Shared Group');\n$group-\u003esetSharedChannelsCount(20);\n$group-\u003esetCapacityPool(Didww\\Item\\CapacityPool::build('pool-uuid'));\n$groupDocument = $group-\u003esave();\n```\n\n### Identities\n\n```php\nuse Didww\\Enum\\IdentityType;\n\n$identity = new Didww\\Item\\Identity([\n    'first_name' =\u003e 'John',\n    'last_name' =\u003e 'Doe',\n    'phone_number' =\u003e '12125551234',\n    'identity_type' =\u003e IdentityType::PERSONAL,\n]);\n$identity-\u003esetCountry(Didww\\Item\\Country::build('country-uuid'));\n$identityDocument = $identity-\u003esave();\n```\n\n### Addresses\n\n```php\n$address = new Didww\\Item\\Address();\n$address-\u003esetCityName('New York');\n$address-\u003esetPostalCode('10001');\n$address-\u003esetAddress('123 Main St');\n$address-\u003esetIdentity(Didww\\Item\\Identity::build('identity-uuid'));\n$address-\u003esetCountry(Didww\\Item\\Country::build('country-uuid'));\n$addressDocument = $address-\u003esave();\n```\n\n### Exports\n\n```php\nuse Didww\\Enum\\ExportType;\n\n$export = new Didww\\Item\\Export();\n$export-\u003esetExportType(ExportType::CDR_IN);\n$export-\u003esetFilterYear('2025');\n$export-\u003esetFilterMonth('01');\n$exportDocument = $export-\u003esave();\n\n// Download the export when completed\n$export = $exportDocument-\u003egetData();\n$export-\u003edownload('/tmp/export.csv');\n```\n\n## Filtering, Sorting, and Pagination\n\n```php\n$regionsDocument = Didww\\Item\\Region::all([\n    'filter' =\u003e ['country.id' =\u003e 'uuid', 'name' =\u003e 'Arizona'],\n    'include' =\u003e 'country',\n    'sort' =\u003e 'name',\n    'page' =\u003e ['size' =\u003e 25, 'number' =\u003e 1],\n]);\n$regions = $regionsDocument-\u003egetData();\n```\n\n## Enums\n\nThe SDK provides PHP 8.2+ backed enum classes for all API option fields (for example `CallbackMethod`, `IdentityType`, `OrderStatus`, `ExportType`, `CliFormat`, `OnCliMismatchAction`, `MediaEncryptionMode`, `TransportProtocol`, `Codec`, and more).\n\n```php\nuse Didww\\Enum\\CallbackMethod;\nuse Didww\\Enum\\IdentityType;\n\n$order = new Didww\\Item\\Order();\n$order-\u003esetCallbackMethod(CallbackMethod::POST);\n\n$identity = new Didww\\Item\\Identity();\n$identity-\u003esetIdentityType(IdentityType::BUSINESS);\n```\n\nAll setters accept both enum constants and raw string/integer values for backward compatibility:\n\n```php\nuse Didww\\Enum\\OnCliMismatchAction;\n\n// Both are equivalent\n$trunk-\u003esetOnCliMismatchAction(OnCliMismatchAction::REPLACE_CLI);\n$trunk-\u003esetOnCliMismatchAction('replace_cli');\n```\n\n### Available Enums\n\n| Enum | Backing Type | Values |\n|------|-------------|--------|\n| `CliFormat` | `string` | `RAW`, `E164`, `LOCAL` |\n| `IdentityType` | `string` | `PERSONAL`, `BUSINESS` |\n| `OrderStatus` | `string` | `PENDING`, `CANCELED`, `COMPLETED` |\n| `CallbackMethod` | `string` | `POST`, `GET` |\n| `ExportType` | `string` | `CDR_IN`, `CDR_OUT` |\n| `ExportStatus` | `string` | `PENDING`, `PROCESSING`, `COMPLETED` |\n| `AddressVerificationStatus` | `string` | `PENDING`, `APPROVED`, `REJECTED` |\n| `MediaEncryptionMode` | `string` | `DISABLED`, `SRTP_SDES`, `SRTP_DTLS`, `ZRTP` |\n| `StirShakenMode` | `string` | `DISABLED`, `ORIGINAL`, `PAI`, `ORIGINAL_PAI`, `VERSTAT` |\n| `OnCliMismatchAction` | `string` | `SEND_ORIGINAL_CLI`, `REJECT_CALL`, `REPLACE_CLI` |\n| `DefaultDstAction` | `string` | `ALLOW_ALL`, `REJECT_ALL` |\n| `VoiceOutTrunkStatus` | `string` | `ACTIVE`, `BLOCKED` |\n| `Feature` | `string` | `VOICE_IN`, `VOICE_OUT`, `T38`, `SMS_IN`, `SMS_OUT` |\n| `AreaLevel` | `string` | `WORLDWIDE`, `COUNTRY`, `AREA`, `CITY` |\n| `Codec` | `int` | `TELEPHONE_EVENT(6)`, `G723(7)`, `G729(8)`, `PCMU(9)`, `PCMA(10)`, ... |\n| `TransportProtocol` | `int` | `UDP(1)`, `TCP(2)`, `TLS(3)` |\n| `RxDtmfFormat` | `int` | `RFC_2833(1)`, `SIP_INFO(2)`, `RFC_2833_OR_SIP_INFO(3)` |\n| `TxDtmfFormat` | `int` | `DISABLED(0)`, `RFC_2833(1)`, `SIP_INFO_RELAY(2)`, `SIP_INFO_DTMF(4)` |\n| `SstRefreshMethod` | `int` | `INVITE(1)`, `UPDATE(2)`, `UPDATE_FALLBACK_INVITE(3)` |\n| `ReroutingDisconnectCode` | `int` | 47 SIP error codes (56-108, 1505) |\n\n## File Encryption\n\nThe SDK provides an `Encrypt` utility for encrypting files before upload, using RSA-OAEP + AES-256-CBC (matching DIDWW's encryption requirements).\n\n```php\n$publicKeys = Didww\\Item\\PublicKey::all()-\u003egetData();\n$fingerprint = Didww\\Encrypt::calculateFingerprint($publicKeys);\n$encrypted = Didww\\Encrypt::encrypt($fileContents, $publicKeys);\n```\n\n## Webhook Signature Validation\n\nValidate incoming webhook callbacks from DIDWW using HMAC-SHA1 signature verification.\n\n```php\n$validator = new Didww\\Callback\\RequestValidator('YOUR_API_KEY');\n\n$valid = $validator-\u003evalidate(\n    $requestUrl,      // full original URL\n    $payloadParams,   // array of payload key-value pairs\n    $signature         // value of X-DIDWW-Signature header\n);\n```\n\n## Trunk Configuration Types\n\n| Type | Class |\n|------|-------|\n| SIP | `Didww\\Item\\Configuration\\Sip` |\n| PSTN | `Didww\\Item\\Configuration\\Pstn` |\n\n## Order Item Types\n\n| Type | Class |\n|------|-------|\n| DID | `Didww\\Item\\OrderItem\\Did` |\n| Available DID | `Didww\\Item\\OrderItem\\AvailableDid` |\n| Reservation DID | `Didww\\Item\\OrderItem\\ReservationDid` |\n| Capacity | `Didww\\Item\\OrderItem\\Capacity` |\n| Generic | `Didww\\Item\\OrderItem\\Generic` |\n\n## All Supported Resources\n\n| Resource | Class | Operations |\n|----------|-------|------------|\n| Country | `Didww\\Item\\Country` | list, find |\n| Region | `Didww\\Item\\Region` | list, find |\n| City | `Didww\\Item\\City` | list, find |\n| Area | `Didww\\Item\\Area` | list, find |\n| NanpaPrefix | `Didww\\Item\\NanpaPrefix` | list, find |\n| Pop | `Didww\\Item\\Pop` | list, find |\n| DidGroupType | `Didww\\Item\\DidGroupType` | list, find |\n| DidGroup | `Didww\\Item\\DidGroup` | list, find |\n| AvailableDid | `Didww\\Item\\AvailableDid` | list, find |\n| ProofType | `Didww\\Item\\ProofType` | list, find |\n| PublicKey | `Didww\\Item\\PublicKey` | list, find |\n| Requirement | `Didww\\Item\\Requirement` | list, find |\n| SupportingDocumentTemplate | `Didww\\Item\\SupportingDocumentTemplate` | list, find |\n| Balance | `Didww\\Item\\Balance` | find |\n| Did | `Didww\\Item\\Did` | list, find, update, delete |\n| VoiceInTrunk | `Didww\\Item\\VoiceInTrunk` | list, find, create, update, delete |\n| VoiceInTrunkGroup | `Didww\\Item\\VoiceInTrunkGroup` | list, find, create, update, delete |\n| VoiceOutTrunk | `Didww\\Item\\VoiceOutTrunk` | list, find, create, update, delete |\n| VoiceOutTrunkRegenerateCredential | `Didww\\Item\\VoiceOutTrunkRegenerateCredential` | create |\n| DidReservation | `Didww\\Item\\DidReservation` | list, find, create, delete |\n| CapacityPool | `Didww\\Item\\CapacityPool` | list, find |\n| SharedCapacityGroup | `Didww\\Item\\SharedCapacityGroup` | list, find, create, update, delete |\n| Order | `Didww\\Item\\Order` | list, find, create |\n| Export | `Didww\\Item\\Export` | list, find, create |\n| Address | `Didww\\Item\\Address` | list, find, create, delete |\n| AddressVerification | `Didww\\Item\\AddressVerification` | list, create |\n| Identity | `Didww\\Item\\Identity` | list, find, create, delete |\n| EncryptedFile | `Didww\\Item\\EncryptedFile` | list, find, delete |\n| PermanentSupportingDocument | `Didww\\Item\\PermanentSupportingDocument` | create, delete |\n| Proof | `Didww\\Item\\Proof` | create, delete |\n| RequirementValidation | `Didww\\Item\\RequirementValidation` | create |\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/didww/didww-api-3-php-sdk\n\n## License\n\nThe package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidww%2Fdidww-api-3-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdidww%2Fdidww-api-3-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidww%2Fdidww-api-3-php-sdk/lists"}