PHP code example of netgsm / iys

1. Go to this page and download the library: Download netgsm/iys library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netgsm / iys example snippets


	use Netgsm\Iys\iys;
    	$data=array('type'=>'MESAJ','source'=>'HS_WEB','recipient'=>'+90553xxxxxxx','recipientType'=>'BIREYSEL','status'=>'ONAY','consentDate'=>'2020-11-06 09:40:00');
        $islem=new iys;
        $sonuc=$islem->iys($data);
        dd($sonuc);
        die;

Array
(
    [code] => 0
    [error] => false
    [uid] => 59a3ec87-bca0-xxxx-xxxx-xxxxxxx
)


Array
(
    [code] => 70
    [error] => Hatalı JSON formatı.
    [erroritem] => Array
        (
            [0] => stdClass Object
                (
                    [recipient] =>  +90553xxxxxxx
                )

        )


        use  Netgsm\Iys\iys;
    	$data=array('type'=>'MESAJ','recipient'=>'+90553xxxxxxx','recipientType'=>'BIREYSEL');
        $adressorgu=new iys;
        $sonuc=$adressorgu->iysadressorgula($data);
        
        dd($sonuc);
        die;
        
        

Array
(
    [code] => 0
    [error] => false
    [query] => stdClass Object
        (
            [recipientType] => BIREYSEL
            [recipient] => +9055xxxxxxx
            [source] => HS_WEB
            [type] => MESAJ
            [consentDate] => 2023-01-24 09:40:00
            [status] => ONAY
            [creationDate] => 2023-01-26 09:48:54
            [retailerAccessCount] => 0
            [transactionId] => 52402b9a59206462axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        )

)

Array
(
    [code] => 50
    [error] => Kayıt Bulunamadı.
)

{
    "iyscode": 123456,
    "brandcode": 123456,
    "type": "MESAJ",
    "source": "HS_ETKINLIK",
    "status": "ONAY",
    "consentdate": "2010-02-10 13:55:00",
    "recipienttype": "TACIR",
    "retailercode": "987654",
    "retaileraccess": "",
    "submitid": "40e6215d-b5c6-4896-987c-f30f3678f608",
    "recipient": "+90312xxxxxxx",
    "resultstatus": "failure",
    "errcode": "H155",
    "errmsg": "İzin tarihi (consentDate) kabul edilemedi.",
    "creationdate": ""
}

    use Illuminate\Http\Request;
    public function index(Request $request)
    {
        
        $data = json_decode($request->getContent(),false);
        $data->recipienttype;
        $data->retailercode;
    }