Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.1 kB
0
Indexable
Never
<?php

public function bulkSms()
{
    return Http::withHeaders([
        'Content-Type' => 'application/json',
        'X-Requested-With' => 'XMLHttpRequest',
        'X-Authorization' => 'Bearer '.json_decode($this->generateToken())->token,
        'SourceAddress'     => '149.126.75.12'
    ])->post($this->getBaseUrl().'/public/CMS/bulksms', [
        'timeStamp' => $this->generateTimestamp(),
        "dataSet"   => [
            [
                "username"          => "CrownwebbAPI",
                "channel"           => "sms",
                "packageId"         => "4616",
                "oa"                => "SDPTest",
                //"msisdn"          => implode(",", $recipients),
                "msisdn"            => "254722225591,254715871947",
                "message"           => "Testing SDP Bulk SMS",
                "uniqueId"          => "2500688298721",
                "actionResponseURL" => "https://posthere.io/c59f-4786-86ac",
                "SourceAddress"     => "149.126.75.12"
            ]
        ]
    ]);
}