# telesign/php_telesign architecture

> Architecture diagram of the GitHub repository telesign/php_telesign, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/telesign/php_telesign
- Repository: https://github.com/telesign/php_telesign

## Overview

The Telesign Self-service PHP SDK exposes PHP clients for messaging, voice, phone intelligence, and risk scoring. An integrating application calls a service-specific client method; that client builds an API request through the shared REST client, which authenticates and sends it to Telesign and wraps the HTTP response. Separate utilities can verify callback signatures. The graph reflects the sampled client and transport code and README-described authentication; route-map details are not expanded because generated route sources were not provided.

Main entry points: [`src/rest/RestClient.php`](https://github.com/telesign/php_telesign/blob/master/src/rest/RestClient.php) (REST Client), [`src/rest/Response.php`](https://github.com/telesign/php_telesign/blob/master/src/rest/Response.php) (Response Wrapper), [`src/messaging/MessagingClient.php`](https://github.com/telesign/php_telesign/blob/master/src/messaging/MessagingClient.php) (Messaging Client), [`src/voice/VoiceClient.php`](https://github.com/telesign/php_telesign/blob/master/src/voice/VoiceClient.php) (Voice Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_communications["Communications"]
  node_messaging["Messaging Client"]
  node_voice["Voice Client<br/>[VoiceClient.php]"]
end

subgraph group_intelligence["Identity And Risk"]
  node_phoneid["PhoneID Client<br/>[PhoneIdClient.php]"]
  node_score["Score Client<br/>[ScoreClient.php]"]
end

subgraph group_transport["HTTP Transport"]
  node_rest["REST Client<br/>[RestClient.php]"]
  node_response["Response Wrapper<br/>[Response.php]"]
  node_routes["Route Loader"]
end

subgraph group_utilities["SDK Utilities"]
  node_utilities["SDK Utilities<br/>[util.php]"]
  node_config["Version Config<br/>[config.php]"]
end

node_application(("Integrating App"))
node_http["Guzzle HTTP"]
node_telesign{{"Telesign APIs"}}
node_callback(("Callback Sender"))

node_application -->|"calls send/status"| node_messaging
node_application -->|"calls call/status"| node_voice
node_application -->|"requests phone data"| node_phoneid
node_application -->|"requests risk score"| node_score
node_messaging -->|"posts or gets"| node_rest
node_voice -->|"posts or gets"| node_rest
node_phoneid -->|"posts"| node_rest
node_score -->|"posts"| node_rest
node_rest -->|"sends HTTP request"| node_http
node_http -->|"transfers request"| node_telesign
node_http -->|"returns HTTP response"| node_rest
node_rest -->|"wraps response"| node_response
node_response -->|"returns result"| node_messaging
node_response -->|"returns result"| node_voice
node_response -->|"returns result"| node_phoneid
node_response -->|"returns result"| node_score
node_messaging -->|"loads route map"| node_routes
node_voice -->|"loads route map"| node_routes
node_phoneid -->|"loads route map"| node_routes
node_score -->|"loads route map"| node_routes
node_rest -->|"reads SDK version"| node_config
node_application -->|"uses helpers"| node_utilities
node_callback -->|"delivers callback"| node_application
node_application -->|"verifies callback signature"| node_utilities

click node_messaging "https://github.com/telesign/php_telesign/blob/master/src/messaging/MessagingClient.php"
click node_voice "https://github.com/telesign/php_telesign/blob/master/src/voice/VoiceClient.php"
click node_phoneid "https://github.com/telesign/php_telesign/blob/master/src/phoneid/PhoneIdClient.php"
click node_score "https://github.com/telesign/php_telesign/blob/master/src/score/ScoreClient.php"
click node_rest "https://github.com/telesign/php_telesign/blob/master/src/rest/RestClient.php"
click node_response "https://github.com/telesign/php_telesign/blob/master/src/rest/Response.php"
click node_routes "https://github.com/telesign/php_telesign/blob/master/src/rest/RouteAutoLoader.php"
click node_utilities "https://github.com/telesign/php_telesign/blob/master/src/util.php"
click node_config "https://github.com/telesign/php_telesign/blob/master/src/config.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_messaging,node_voice toneBlue
class node_phoneid,node_score toneAmber
class node_rest,node_response,node_routes,node_telesign toneMint
class node_utilities,node_config toneRose
class node_application,node_http,node_callback toneIndigo
```

## Components

### Communications

- [Messaging Client](https://github.com/telesign/php_telesign/blob/master/src/messaging/MessagingClient.php): `src/messaging/MessagingClient.php`
- [Voice Client](https://github.com/telesign/php_telesign/blob/master/src/voice/VoiceClient.php): `src/voice/VoiceClient.php`

### Identity And Risk

- [PhoneID Client](https://github.com/telesign/php_telesign/blob/master/src/phoneid/PhoneIdClient.php): `src/phoneid/PhoneIdClient.php`
- [Score Client](https://github.com/telesign/php_telesign/blob/master/src/score/ScoreClient.php): `src/score/ScoreClient.php`

### HTTP Transport

- [REST Client](https://github.com/telesign/php_telesign/blob/master/src/rest/RestClient.php): `src/rest/RestClient.php`
- [Response Wrapper](https://github.com/telesign/php_telesign/blob/master/src/rest/Response.php): `src/rest/Response.php`
- [Route Loader](https://github.com/telesign/php_telesign/blob/master/src/rest/RouteAutoLoader.php): `src/rest/RouteAutoLoader.php`

### SDK Utilities

- [SDK Utilities](https://github.com/telesign/php_telesign/blob/master/src/util.php): `src/util.php`
- [Version Config](https://github.com/telesign/php_telesign/blob/master/src/config.php): `src/config.php`

### Other components

- **Integrating App**
- **Guzzle HTTP**
- **Telesign APIs**
- **Callback Sender**

## Connections

- Integrating App → Messaging Client: calls send/status
- Integrating App → Voice Client: calls call/status
- Integrating App → PhoneID Client: requests phone data
- Integrating App → Score Client: requests risk score
- Messaging Client → REST Client: posts or gets
- Voice Client → REST Client: posts or gets
- PhoneID Client → REST Client: posts
- Score Client → REST Client: posts
- REST Client → Guzzle HTTP: sends HTTP request
- Guzzle HTTP → Telesign APIs: transfers request
- Guzzle HTTP → REST Client: returns HTTP response
- REST Client → Response Wrapper: wraps response
- Response Wrapper → Messaging Client: returns result
- Response Wrapper → Voice Client: returns result
- Response Wrapper → PhoneID Client: returns result
- Response Wrapper → Score Client: returns result
- Messaging Client → Route Loader: loads route map
- Voice Client → Route Loader: loads route map
- PhoneID Client → Route Loader: loads route map
- Score Client → Route Loader: loads route map
- REST Client → Version Config: reads SDK version
- Integrating App → SDK Utilities: uses helpers
- Callback Sender → Integrating App: delivers callback
- Integrating App → SDK Utilities: verifies callback signature
