(sms->messages)
- create - Create Message
- list - List Messages
- delete - Delete Message
- get - Get Message
- update - Update Message
Create Message
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\SmsMessagesAddRequest(
message: new Components\MessageInput(
from: '+15017122661',
to: '+15017122662',
body: 'Hi! How are you doing?',
subject: 'Picture',
type: Components\MessageType::Sms,
scheduledAt: Utils\Utils::parseDateTime('2020-09-30T07:43:32.000Z'),
webhookUrl: 'https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms',
reference: 'CUST001',
messagingServiceId: '123456',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
serviceId: 'salesforce',
);
$response = $sdk->sms->messages->create(
request: $request
);
if ($response->createMessageResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SmsMessagesAddRequest | ✔️ | The request object to use for the request. |
?Operations\SmsMessagesAddResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
List Messages
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\SmsMessagesAllRequest(
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$responses = $sdk->sms->messages->list(
request: $request
);
foreach ($responses as $response) {
if ($response->httpMeta->response->getStatusCode() === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SmsMessagesAllRequest | ✔️ | The request object to use for the request. |
?Operations\SmsMessagesAllResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Delete Message
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\SmsMessagesDeleteRequest(
id: '<id>',
serviceId: 'salesforce',
);
$response = $sdk->sms->messages->delete(
request: $request
);
if ($response->deleteMessageResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SmsMessagesDeleteRequest | ✔️ | The request object to use for the request. |
?Operations\SmsMessagesDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Get Message
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Operations;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\SmsMessagesOneRequest(
id: '<id>',
serviceId: 'salesforce',
fields: 'id,updated_at',
);
$response = $sdk->sms->messages->get(
request: $request
);
if ($response->getMessageResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SmsMessagesOneRequest | ✔️ | The request object to use for the request. |
?Operations\SmsMessagesOneResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update Message
declare(strict_types=1);
require 'vendor/autoload.php';
use Apideck\Unify;
use Apideck\Unify\Models\Components;
use Apideck\Unify\Models\Operations;
use Apideck\Unify\Utils;
$sdk = Unify\Apideck::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->setConsumerId('test-consumer')
->setAppId('dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX')
->build();
$request = new Operations\SmsMessagesUpdateRequest(
id: '<id>',
message: new Components\MessageInput(
from: '+15017122661',
to: '+15017122662',
body: 'Hi! How are you doing?',
subject: 'Picture',
type: Components\MessageType::Sms,
scheduledAt: Utils\Utils::parseDateTime('2020-09-30T07:43:32.000Z'),
webhookUrl: 'https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms',
reference: 'CUST001',
messagingServiceId: '123456',
passThrough: [
new Components\PassThroughBody(
serviceId: '<id>',
extendPaths: [
new Components\ExtendPaths(
path: '$.nested.property',
value: [
'TaxClassificationRef' => [
'value' => 'EUC-99990201-V1-00020000',
],
],
),
],
),
],
),
serviceId: 'salesforce',
);
$response = $sdk->sms->messages->update(
request: $request
);
if ($response->updateMessageResponse !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\SmsMessagesUpdateRequest | ✔️ | The request object to use for the request. |
?Operations\SmsMessagesUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\BadRequestResponse | 400 | application/json |
Errors\UnauthorizedResponse | 401 | application/json |
Errors\PaymentRequiredResponse | 402 | application/json |
Errors\NotFoundResponse | 404 | application/json |
Errors\UnprocessableResponse | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |