Skip to content

Commit e58135d

Browse files
Pull request #25: feature/EOA-5903-FS-IntellegenceCloud
Merge in SDK/php_telesign_enterprise from feature/EOA-5903-FS-IntellegenceCloud to developer Squashed commit of the following: commit 49dcf031d393a38935d4f14cc769bad75ebb8536 Merge: c5aa7c5 e8fbbf0 Author: Juan Camilo Martinez <jmartinez@telesign.com> Date: Thu Jan 15 10:58:52 2026 -0500 Solve issues merge commit c5aa7c56233a56edda07818cac6e3ad50f8f29a0 Author: MousumiMohanty <@telesign.com> Date: Tue Oct 28 12:33:55 2025 +0530 Added support for Intelligence Cloud to use the new endpoint + Removed Legacy PID Score
1 parent e8fbbf0 commit e58135d

File tree

8 files changed

+33
-47
lines changed

8 files changed

+33
-47
lines changed

RELEASE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
5.0.0
2+
- Added support for Intelligence Cloud to use the new endpoint
3+
- Removed Legacy PID Score
4+
15
4.0.3
26
- Added config.php to Composer’s autoload classmap to prevent file-loading errors on case-sensitive systems, while maintaining compatibility with existing integrations.
37

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"require": {
1818
"php": "^7.2.5 || ^8.0",
19-
"telesign/telesign": "^3.0 || ^4.0"
19+
"telesign/telesign": "^3.0 || ^4.0 || ^5.0"
2020
},
2121
"require-dev": {
2222
"phpunit/phpunit": "^8",

examples/phoneid_score/1_check_phone_number_risk_level.php

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
require __DIR__ . "/../../vendor/autoload.php";
4+
5+
use telesign\enterprise\sdk\score\ScoreClient;
6+
7+
$customer_id = getenv('CUSTOMER_ID') ?? 'FFFFFFFF-EEEE-DDDD-1234-AB1234567890';
8+
$api_key = getenv('API_KEY') ?? 'ABC12345yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==';
9+
10+
$phone_number = getenv('PHONE_NUMBER') ?? '11234567890';
11+
$account_lifecycle_event= getenv('ACCOUNT_LIFECYCLE_EVENT') ?? 'create';
12+
13+
$scoreClient = new ScoreClient($customer_id, $api_key);
14+
$response = $scoreClient->score($phone_number, $account_lifecycle_event, [
15+
"account_id" => "my_account_id",
16+
"email_address" => "user@example.com",
17+
"originating_ip" => "8.8.8.8"
18+
]);
19+
if ($response->ok) {
20+
echo "Phone number $phone_number has a '{$response->json["risk"]["level"]}' risk level"
21+
. " and the recommendation is to '{$response->json["risk"]["recommendation"]}' the transaction.";
22+
}
23+
else {
24+
echo "Failed to get risk score for phone number $phone_number.";
25+
}

src/phoneid/PhoneIdClient.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
class PhoneIdClient extends _PhoneIdClient {
1717

1818
const PHONEID_STANDARD_RESOURCE = "/v1/phoneid/standard/%s";
19-
const PHONEID_SCORE_RESOURCE = "/v1/phoneid/score/%s";
2019
const PHONEID_LIVE_RESOURCE = "/v1/phoneid/live/%s";
2120
const PHONEID_GET_INFO_PATH = "/v1/phoneid/%s";
2221
const PHONEID_GET_INFO_PATH_ALT = "/v1/phoneid";
@@ -37,18 +36,6 @@ function standard ($phone_number, array $params = []) {
3736
return $this->get(sprintf(self::PHONEID_STANDARD_RESOURCE, $phone_number), $params);
3837
}
3938

40-
/**
41-
* Score is an API that delivers reputation scoring based on phone number intelligence, traffic patterns, machine
42-
* learning, and a global data consortium.
43-
*
44-
* See https://developer.telesign.com/docs/rest_api-phoneid-score for detailed API documentation.
45-
*/
46-
function score ($phone_number, $ucid, array $other = []) {
47-
return $this->get(sprintf(self::PHONEID_SCORE_RESOURCE, $phone_number), array_merge($other, [
48-
"ucid" => $ucid
49-
]));
50-
}
51-
5239
/**
5340
* The PhoneID Live API delivers insights such as whether a phone is active or disconnected, a device is reachable
5441
* or unreachable and its roaming status.

src/score/ScoreClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
class ScoreClient extends _ScoreClient {
1212

13-
function __construct ($customer_id, $api_key, $rest_endpoint = "https://rest-ww.telesign.com", ...$other) {
13+
function __construct ($customer_id, $api_key, $rest_endpoint = "https://detect.telesign.com", ...$other) {
1414
$sdk_version_origin = Config::getVersion('telesign/telesignenterprise');
1515
$sdk_version_dependency = Config::getVersion('telesign/telesign');
1616
parent::__construct($customer_id, $api_key, $rest_endpoint, "php_telesign_enterprise", $sdk_version_origin, $sdk_version_dependency, ...$other);

test/phoneid/PhoneIdClientTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ final class PhoneIdClientTest extends ClientTest {
1212

1313
function getRequestExamples () {
1414
return [
15-
[
16-
PhoneIdClient::class,
17-
"score",
18-
[
19-
self::EXAMPLE_PHONE_NUMBER,
20-
self::EXAMPLE_UCID,
21-
[ "optional_param" => "123" ]
22-
],
23-
"uri" => self::EXAMPLE_REST_ENDPOINT . "/v1/phoneid/score/" . self::EXAMPLE_PHONE_NUMBER . "?optional_param=123&ucid=" . self::EXAMPLE_UCID,
24-
[]
25-
],
2615
[
2716
PhoneIdClient::class,
2817
"live",

test/score/ScoreClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ function getRequestExamples () {
2020
self::EXAMPLE_ACCOUNT_LIFECYCLE_EVENT,
2121
[ "optional_param" => "123" ]
2222
],
23-
self::EXAMPLE_REST_ENDPOINT . "/v1/score/" . self::EXAMPLE_PHONE_NUMBER,
23+
self::EXAMPLE_REST_ENDPOINT . "/intelligence/phone",
2424
[
25+
"phone_number" => self::EXAMPLE_PHONE_NUMBER,
2526
"account_lifecycle_event" => self::EXAMPLE_ACCOUNT_LIFECYCLE_EVENT,
2627
"optional_param" => "123"
2728
]
2829
]
2930
];
3031
}
31-
3232
}

0 commit comments

Comments
 (0)