Giter Club home page Giter Club logo

client-php's Introduction

SwaggerClient-php

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 4.0.0
  • Package version: v0.0.1
  • Build date: 2018-05-16T00:56:54.871+01:00
  • Build package: class io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.4.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/smsgatewayme/client-php.git"
    }
  ],
  "require": {
    "smsgatewayme/client": "^0.0.1"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit lib/Tests

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Authorization
SMSGatewayMe\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
// SMSGatewayMe\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'BEARER');

$api_instance = new SMSGatewayMe\Client\Api\CallbackApi();
$callback = new \SMSGatewayMe\Client\Model\CreateCallbackRequest(); // \SMSGatewayMe\Client\Model\CreateCallbackRequest | callback to create

try {
    $result = $api_instance->createCallback($callback);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CallbackApi->createCallback: ', $e->getMessage(), "\n";
}

?>

Documentation for API Endpoints

All URIs are relative to https://smsgateway.me/api/v4

Class Method HTTP request Description
CallbackApi createCallback POST /callback Create Callback
CallbackApi getCallback GET /callback/{id} Get a specific callback
CallbackApi searchCallbacks POST /callback/search Search callbacks
CallbackApi updateCallback PUT /callback/{id} Update callback
ContactApi addPhoneNumber PUT /contact/{id}/phone-number/{phone-number} The phone number to add
ContactApi createContacts POST /contact Create Contacts
ContactApi deletePhoneNumber DELETE /contact/{id}/phone-number/{phone-number} The phone number to delete
ContactApi getContact GET /contact/{id} Get a specific contact
ContactApi searchContacts POST /contact/search Search contacts
ContactApi updateContact PUT /contact/{id} Update contact
DeviceApi getDevice GET /device/{id} Get a specific device
DeviceApi searchDevices POST /device/search Search devices
MessageApi cancelMessages POST /message/cancel Cancel messages
MessageApi getMessage GET /message/{id} Get a specific message
MessageApi searchMessages POST /message/search Search messages
MessageApi sendMessages POST /message/send Send messages

Documentation For Models

Documentation For Authorization

Authorization

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

client-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

client-php's Issues

Exception when calling CallbackApi->createCallback: [400] Error connecting to the API (https://smsgateway.me/api/v4/callback)

[27-Jun-2020 15:22:44 UTC] PHP Fatal error: Uncaught SMSGatewayMe\Client\ApiException: [403] Error connecting to the API (https://smsgateway.me/api/v4/message/send) in /home/smsmarketing/public_html/api/client-php/lib/ApiClient.php:247
Stack trace:
#0 /home/smsmarketing/public_html/api/client-php/lib/Api/MessageApi.php(525): SMSGatewayMe\Client\ApiClient->callApi('/message/send', 'POST', Array, '[{"phone_number...', Array, '\SMSGatewayMe\C...')
#1 /home/smsmarketing/public_html/api/client-php/lib/Api/MessageApi.php(459): SMSGatewayMe\Client\Api\MessageApi->sendMessagesWithHttpInfo(Array)
#2 /home/smsmarketing/public_html/api/client-php/test.php(23): SMSGatewayMe\Client\Api\MessageApi->sendMessages(Array)
#3 {main}
thrown in /home/smsmarketing/public_html/api/client-php/lib/ApiClient.php on line 247

require 'vendor/autoload.php';

use SMSGatewayMe\Client\ApiClient;
use SMSGatewayMe\Client\Configuration;
use SMSGatewayMe\Client\Api\MessageApi;
use SMSGatewayMe\Client\Model\SendMessageRequest;

// Configure API key authorization: Authorization
SMSGatewayMe\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'AAAAAAAAAAAPPPPPIIII');
// Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
// SMSGatewayMe\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'BEARER');

$api_instance = new SMSGatewayMe\Client\Api\CallbackApi();
$callback = new \SMSGatewayMe\Client\Model\CreateCallbackRequest(); // \SMSGatewayMe\Client\Model\CreateCallbackRequest | callback to create

try {
$result = $api_instance->createCallback($callback);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CallbackApi->createCallback: ', $e->getMessage(), "\n";
}

any idea ?

How can i use this api?

i'm trying to send a sms but in the code there's a line where the code says: "your-token-here".
what is that? or what else do i need to do?
can anyone help me?

Callback not working

I've managed to create some callbacks on the website but it doesn't seem to work !
I've tried manually too, the response tell me that my arguments are empty. No matter what I try I can't manage to create or update some callbacks manually.

Have you any idea on how to create a working callback ?

code does not comply with psr-4 autoloading standard laravel 8

it seems while installing the package composer require smsgatewayme/client its does not comply with psr-4 autoloading standard i have included the errors below

Class SMSGatewayMe\Client\Api\CallbackApiTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\CallbackApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\CallbackSearchResultTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\CallbackSearchResultTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\CallbackTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\CallbackTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\CancelMessageRequestTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\CancelMessageRequestTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Api\ContactApiTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\ContactApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\ContactSearchResultTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\ContactSearchResultTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\ContactTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\ContactTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\CreateCallbackRequestTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\CreateCallbackRequestTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\CreateContactRequestTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\CreateContactRequestTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Api\DeviceApiTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\DeviceApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\DeviceAttributesTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\DeviceAttributesTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\DeviceSearchResultTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\DeviceSearchResultTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\DeviceTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\DeviceTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\ErrorResponseTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\ErrorResponseTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\ErrorTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\ErrorTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\FatalResponseTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\FatalResponseTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Api\MessageApiTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\MessageApiTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\MessageLogTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\MessageLogTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\MessageSearchResultTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\MessageSearchResultTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\MessageTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\MessageTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\SearchFilterTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\SearchFilterTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\SearchOrderByTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\SearchOrderByTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\SearchTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\SearchTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\SendMessageRequestTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\SendMessageRequestTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\UpdateCallbackRequestTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\UpdateCallbackRequestTest.php does not comply with psr-4 autoloading standard. Skipping.
Class SMSGatewayMe\Client\Model\UpdateContactRequestTest located in D:/dev/project/xxx/vendor/smsgatewayme/client/lib\Swagger\Client\Tests\UpdateContactRequestTest.php does not comply with psr-4 autoloading standard. Skipping.

Android application crash

Hi
How can i receive from the mobile an email (for example) if application smsgatewayme shut down or crush ?
Thx
Regards Jérome

403 Error

I have followed the example, put my own Key and my cellphone number as the destination. After turning the debug on, I always see a 403.

php74 test.php
[DEBUG] HTTP Request body BEGIN
[{"phone_number":"16138535080","message":"test1","device_id":1}]
END
[DEBUG] HTTP Response body BEGIN
{"status":"fail","message":"Could not process request","data":{"exception":"Access Denied."}}
END

  • About to connect() to smsgateway.me port 443 (#0)
  • Trying 142.93.107.113...
  • Connected to smsgateway.me (142.93.107.113) port 443 (#0)
  • Initializing NSS with certpath: sql:/etc/pki/nssdb
  • skipping SSL peer certificate verification
  • SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  • Server certificate:
  •   subject: CN=smsgateway.me
    
  •   start date: Jul 15 20:09:08 2021 GMT
    
  •   expire date: Oct 13 20:09:06 2021 GMT
    
  •   common name: smsgateway.me
    
  •   issuer: CN=R3,O=Let's Encrypt,C=US
    

POST /api/v4/message/send HTTP/1.1
User-Agent: Swagger-Codegen/v0.0.1/php
Host: smsgateway.me
Accept: application/json
Content-Type: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZG1pbiIsImlhdCI6MTYzMTAzNjgzNCwiZXhwIjo0MTAyNDQ0ODAwLCJ1aWQiOjgwMzY1LCJyb2xlcyI6WyJST0xFX1VTRVIiXX0.SzVDDkiKXchJLKQqWplDvUYRB3s-WiWu9KtLr8bJUJw
Content-Length: 64

  • upload completely sent off: 64 out of 64 bytes
    < HTTP/1.1 403 Forbidden
    < Date: Tue, 07 Sep 2021 17:48:37 GMT
    < Server: Apache/2.4.18 (Ubuntu)
    < Cache-Control: no-cache, private
    < Transfer-Encoding: chunked
    < Content-Type: application/json
    <
  • Connection #0 to host smsgateway.me left intact
    PHP Fatal error: Uncaught SMSGatewayMe\Client\ApiException: [403] Error connecting to the API (https://smsgateway.me/api/v4/message/send) in /var/www/clients/client0/web102/private/smsgateway/vendor/smsgatewayme/client/lib/ApiClient.php:247
    Stack trace:
    #0 /var/www/clients/client0/web102/private/smsgateway/vendor/smsgatewayme/client/lib/Api/MessageApi.php(525): SMSGatewayMe\Client\ApiClient->callApi()
    #1 /var/www/clients/client0/web102/private/smsgateway/vendor/smsgatewayme/client/lib/Api/MessageApi.php(459): SMSGatewayMe\Client\Api\MessageApi->sendMessagesWithHttpInfo()
    #2 /var/www/clients/client0/web102/private/smsgateway/test.php(30): SMSGatewayMe\Client\Api\MessageApi->sendMessages()
    #3 {main}
    thrown in /var/www/clients/client0/web102/private/smsgateway/vendor/smsgatewayme/client/lib/ApiClient.php on line 247

I have already changed my authkey for the sake of my own security.

What am I missing?

Invalid input exception??

I tried with postman your api is working well, but if i tried with PHP scripts return:
{"status":"fail","message":"Could not process request","data":{"exception":"Invalid input"}}

How to purge old devices

Hi
Wonderfull application!
With v4, all old devices come in interface
Do you have an idea (a script) to delete devices no more used ? Example with last seen date < yesterday? Another idea?
Before i could delete them with garbage icon 😊
Thanks a lot
Jérôme

how to make the callback api works?

i am using the version 4, the last one in PHP, and it is sending messages fine, but now i want to get the messages that were sent to me, i can not do it becouse the callback lokks like it does not work. i am using this code:
$createCallbackRequest = new CreateCallbackRequest([
'name' => 'Test Callback',
'event' => 'MESSAGE_RECEIVED',
'deviceId' => 123456,
'filterType' => 'contains',
'filter' => 'hello',
'method' => 'HTTP',
'action' => 'http://mywebsite.com/sms-callback.php',
'secret' => 'SsshhhhNotASecret'
]);

$callback = $callbackClient->createCallback($createCallbackRequest);
print_r($callback);

and in action field, i put my php in the server, that inserts a record in my mysql database just for test, but this callback does not call my php on the server.
any one could make this clalback works? or have other way to get the messages taht came to the phone?

smsGateway.php?????

what a pity, you changed everything and it's impossible to make it work like funcinonava before!

I had a simple schedule like this and now I'm completely lost

Do we need to always check server to send message?

Good day, Thank you for creating this API, it helps a lot! However, i need some help. When i send a request to the API, the message is not sending until i open the android app and check the server. Do we need to always check server on android to send message? Thank you so much.

Can you make

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

Help

Project Abandon?

Is the project already been abandoned? Website is not anymore working when registering and logging in.

How to get a phone number?

Hi everybody,

I use the searchMessages method, the result returns no phone number, so how can I get the phone number from the return value?

Thanks!

Fatal error: Uncaught SMSGatewayMe\Client\ApiException

Hello

When trying to run the sample code from readme.md, it gives the following error, even from this token:

Exception when calling CallbackApi->createCallback: API call to https://smsgateway.me/api/v4/callback timed out: a:26:{s:3:"url";s:37:"https://smsgateway.me/api/v4/callback";s:12:"content_type";N;s:9:"http_code";i:0;s:11:"header_size";i:0;s:12:"request_size";i:0;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:1;s:14:"redirect_count";i:0;s:10:"total_time";d:0.5;s:15:"namelookup_time";d:0.26600000000000001;s:12:"connect_time";d:0.48399999999999999;s:16:"pretransfer_time";d:0;s:11:"size_upload";d:0;s:13:"size_download";d:0;s:14:"speed_download";d:0;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"54.229.39.139";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:15:"186.202.119.229";s:10:"local_port";i:60781;}

And when you try to send an SMS according to documentation, the following error is displayed:

Fatal error: Uncaught SMSGatewayMe\Client\ApiException: API call to https://smsgateway.me/api/v4/message/send timed out: a:26:{s:3:"url";s:41:"https://smsgateway.me/api/v4/message/send";s:12:"content_type";N;s:9:"http_code";i:0;s:11:"header_size";i:0;s:12:"request_size";i:0;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:1;s:14:"redirect_count";i:0;s:10:"total_time";d:0.25;s:15:"namelookup_time";d:9.9999999999999995E-7;s:12:"connect_time";d:0.25;s:16:"pretransfer_time";d:0;s:11:"size_upload";d:0;s:13:"size_download";d:0;s:14:"speed_download";d:0;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"54.229.39.139";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:15:"186.202.119.229";s:10:"local_port";i:60798;} in E:\Vhosts\painell.com\httpdocs\testesmssavio\lib\ApiClient.php:230 Stack trace: #0 E:\Vhosts\painell.com\httpdocs\testesmssavio\lib\Api\MessageApi.php(525) in E:\Vhosts\painell.com\httpdocs\testesmssavio\lib\ApiClient.php on line 230

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.