smsgatewayme / client-php

PHP Client for smsgateway.me
26 stars 32 forks source link

Can you make #5

Closed emres120 closed 6 years ago

emres120 commented 6 years ago

Hello, Can you make a simple api for smsgateway.me like before. Because this new is not compatible with my code. Thank you

louiedgomez commented 6 years ago

You may need to revise your code now.

sepehrs commented 6 years ago

Hey, I'm working on making the new one client a bit simpler to set up. You will still need to require the library using composer but once you install v0.1.0 you can use the following script to get setup

<?php
    include "vendor/autoload.php";

    use SMSGatewayMe\Client\ClientProvider;
    use SMSGatewayMe\Client\Model\SendMessageRequest;

    $clients = new ClientProvider("your-token-here");

    $sendMessageRequest = new SendMessageRequest([
        'phoneNumber' => '07791064782',
        'message' => 'hello world',
        'deviceId' => 1
    ]);

    $sentMessages = $clients->getMessageClient()->sendMessages([$sendMessageRequest]);
    print_r($sentMessages);

I'll be updating the docs to show this easier method today.