{"id":43060640,"url":"https://github.com/sentdm/sent-dm-php","last_synced_at":"2026-03-12T00:07:58.024Z","repository":{"id":334716284,"uuid":"1142459513","full_name":"sentdm/sent-dm-php","owner":"sentdm","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-31T17:13:44.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T22:48:29.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sentdm.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":"SECURITY.md","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":"2026-01-26T12:48:42.000Z","updated_at":"2026-01-31T10:18:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sentdm/sent-dm-php","commit_stats":null,"previous_names":["sentdm/sent-dm-php"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sentdm/sent-dm-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentdm%2Fsent-dm-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentdm%2Fsent-dm-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentdm%2Fsent-dm-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentdm%2Fsent-dm-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sentdm","download_url":"https://codeload.github.com/sentdm/sent-dm-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentdm%2Fsent-dm-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29084088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2026-01-31T12:02:54.423Z","updated_at":"2026-03-12T00:07:58.017Z","avatar_url":"https://github.com/sentdm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sent Dm PHP API library\n\nThe Sent Dm PHP library provides convenient access to the Sent Dm REST API from any PHP 8.1.0+ application.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## Documentation\n\nThe REST API documentation can be found on [docs.sent.dm](https://docs.sent.dm).\n\n## Installation\n\n\u003c!-- x-release-please-start-version --\u003e\n\n```\ncomposer require \"sentdm/sent-dm-php 0.9.0\"\n```\n\n\u003c!-- x-release-please-end --\u003e\n\n## Usage\n\nThis library uses named parameters to specify optional arguments.\nParameters with a default value must be set by name.\n\n```php\n\u003c?php\n\nuse SentDm\\Client;\n\n$client = new Client(apiKey: getenv('SENT_DM_API_KEY') ?: 'My API Key');\n\n$response = $client-\u003emessages-\u003esend(\n  channel: ['sms', 'whatsapp'],\n  template: [\n    'id' =\u003e '7ba7b820-9dad-11d1-80b4-00c04fd430c8',\n    'name' =\u003e 'order_confirmation',\n    'parameters' =\u003e ['name' =\u003e 'John Doe', 'order_id' =\u003e '12345'],\n  ],\n  to: ['+14155551234', '+14155555678'],\n);\n\nvar_dump($response-\u003edata);\n```\n\n### Value Objects\n\nIt is recommended to use the static `with` constructor `TemplateDefinition::with(body: (object)[], ...)`\nand named parameters to initialize value objects.\n\nHowever, builders are also provided `(new TemplateDefinition)-\u003ewithBody((object)[])`.\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `SentDm\\Core\\Exceptions\\APIException` will be thrown:\n\n```php\n\u003c?php\n\nuse SentDm\\Core\\Exceptions\\APIConnectionException;\nuse SentDm\\Core\\Exceptions\\RateLimitException;\nuse SentDm\\Core\\Exceptions\\APIStatusException;\n\ntry {\n  $response = $client-\u003emessages-\u003esend();\n} catch (APIConnectionException $e) {\n  echo \"The server could not be reached\", PHP_EOL;\n  var_dump($e-\u003egetPrevious());\n} catch (RateLimitException $e) {\n  echo \"A 429 status code was received; we should back off a bit.\", PHP_EOL;\n} catch (APIStatusException $e) {\n  echo \"Another non-200-range status code was received\", PHP_EOL;\n  echo $e-\u003egetMessage();\n}\n```\n\nError codes are as follows:\n\n| Cause            | Error Type                     |\n| ---------------- | ------------------------------ |\n| HTTP 400         | `BadRequestException`          |\n| HTTP 401         | `AuthenticationException`      |\n| HTTP 403         | `PermissionDeniedException`    |\n| HTTP 404         | `NotFoundException`            |\n| HTTP 409         | `ConflictException`            |\n| HTTP 422         | `UnprocessableEntityException` |\n| HTTP 429         | `RateLimitException`           |\n| HTTP \u003e= 500      | `InternalServerException`      |\n| Other HTTP error | `APIStatusException`           |\n| Timeout          | `APITimeoutException`          |\n| Network error    | `APIConnectionException`       |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, \u003e=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `maxRetries` option to configure or disable this:\n\n```php\n\u003c?php\n\nuse SentDm\\Client;\n\n// Configure the default for all requests:\n$client = new Client(requestOptions: ['maxRetries' =\u003e 0]);\n\n// Or, configure per-request:\n$result = $client-\u003emessages-\u003esend(\n  channel: ['sms'],\n  template: [\n    'id' =\u003e '7ba7b820-9dad-11d1-80b4-00c04fd430c8',\n    'name' =\u003e 'order_confirmation',\n    'parameters' =\u003e ['name' =\u003e 'John Doe', 'order_id' =\u003e '12345'],\n  ],\n  to: ['+14155551234'],\n  requestOptions: ['maxRetries' =\u003e 5],\n);\n```\n\n## Advanced concepts\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra*` parameters of the same name overrides the documented parameters.\n\n```php\n\u003c?php\n\n$response = $client-\u003emessages-\u003esend(\n  channel: ['sms'],\n  template: [\n    'id' =\u003e '7ba7b820-9dad-11d1-80b4-00c04fd430c8',\n    'name' =\u003e 'order_confirmation',\n    'parameters' =\u003e ['name' =\u003e 'John Doe', 'order_id' =\u003e '12345'],\n  ],\n  to: ['+14155551234'],\n  requestOptions: [\n    'extraQueryParams' =\u003e ['my_query_parameter' =\u003e 'value'],\n    'extraBodyParams' =\u003e ['my_body_parameter' =\u003e 'value'],\n    'extraHeaders' =\u003e ['my-header' =\u003e 'value'],\n  ],\n);\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```php\n\u003c?php\n\n$response = $client-\u003erequest(\n  method: \"post\",\n  path: '/undocumented/endpoint',\n  query: ['dog' =\u003e 'woof'],\n  headers: ['useful-header' =\u003e 'interesting-value'],\n  body: ['hello' =\u003e 'world']\n);\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) PHPDoc type definitions to be non-breaking changes.\n\n## Requirements\n\nPHP 8.1.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/sentdm/sent-dm-php/tree/main/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentdm%2Fsent-dm-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsentdm%2Fsent-dm-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentdm%2Fsent-dm-php/lists"}