smsapi / smsapi-php-client Goto Github PK
View Code? Open in Web Editor NEWSMSAPI PHP client that allows you to send messages, manage Short URLs and administrate your SMSAPI account.
Home Page: https://www.smsapi.pl
License: Other
SMSAPI PHP client that allows you to send messages, manage Short URLs and administrate your SMSAPI account.
Home Page: https://www.smsapi.pl
License: Other
I want to discuss here witch major php versions should be supported by smsapi-php-client:2.0
I would like to discuss here how do we want to document this lib
DateTime::__construct() expects parameter 1 to be string, null given
inside \Smsapi\Client\Feature\Sms\Sendernames\Data\SendernameFactory:18
When $object->created_at
is null, an exception is thrown.
I'm actually using this package as a part of Magento integration module.
An easy fix is to check if created_at
is not empty before using it as argument for DateTime object. I can make PR if you want to fix it that way and not by implementing changes inside Magento integration extension.
I have some changes that I would like to merge, but those changes will break some interfaces. So those changes should be included in another version. In order to share and develop, release branch is required.
Can you create this branch?
Hello
I have a searching phone number like this:
/**
* @param string $phone
* @return array
*/
public function findByPhone(string $phone): array
{
$params = new FindContactsBag();
$params->phoneNumber = $phone;
return $this->getService()->contactsFeature()->findContacts($params);
}
And sometimes this code return error
Argument 2 passed to Smsapi\Client\Feature\Contacts\Data\ContactCustomFieldFactory::create() must be of the type string, int given, called in ...../vendor/smsapi/php-client/src/Feature/Contacts/Data/ContactFactory.php on line 66
Related to #38
Proszę o dodanie możliwości wysyłania wiadomości SMS z wykorzystaniem szablonów zapisanych na koncie SMSAPI.
Currently i tried to send a sms message with UTF-8 characters in polish language. Sms is being sended correctly but it has bushes instead of proper utf-8 characters. There is no place in this library documentation describing how to set it and i am feeling like the only one who is using this API. No one encounter this problem at this version??
There is no action to look up for the prices per sms per country
Please add property timeRestriction to SendSmsBag and SendSmssBag.
psr/http-message: "^1 || ^2"
Version 2 is not to new version, other libraries support version ^1 or ^2,
I had some troubles time ago when my application died after I upgraded smsapi-php-client.
I had to give composer straight version. Reason was that public interface changed.
I would recommend to establish versioning policy.
For those who do not speak polish it is hard to understand what is README.md.
ContactGet::uri() is factory method. Calling withGroups() method changes state of ContactGet object. So we have Painfull Side Effect here.
What is purpose of throwing exception in ContactResponse::getGroups method?
Related to #38
Please add details attribute in SMS interface.
&details=1
Add /.idea
to .gitignore
Hi.
What do you think about replacing explicit Guzzle dependency with HTTPlug?
HTTPlug is an http client abstraction meant especially for libraries, to avoid binding to specific implementation so teams using your library can choose their favorite implementation without risk of getting version conflicts.
So it makes life easier.
I can prepare a PR, but wanted to ask first.
przy instalacji przez composer na symfony2 dostaje
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for webit/smsapi-bundle dev-master -> satisfiable by webit/smsapi-bundle[dev-master].
- webit/smsapi-bundle dev-master requires webit/smsapi dev-master -> no matching package found.
Potential causes:
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Related to #38
I'm getting customerId by actionContactList.
It returns hash, so I think it is correct value.
Later I'm trying to do: actionContactEdit.
I'm using contactId from above and then set other values.
After execute it's throwing Exception.
Please - check it as soon as possible.
As long as I can define new - custom fields for Contact from Smsapi's back office - I should be able to set those via Api. Magic getter/setter should be implemented.
Under docs
directory there is only some auto generated code.
I don't think that someone(except Google ;)) reads it.
I would recommend to move it to some project site hosted on https://pages.github.com/
$mfaBag = new VerificationMfaBag($code, $phoneNumber); // expired code
$mfaResponse = (new SmsapiHttpClient())
->smsapiPlService($apiToken)
->mfaFeature()
->verifyMfa($mfaBag);
output:
2024-01-03 11:01:03 [83.16.11.142][173][34e4df4529f07064a3755c27facf89c1][error][TypeError] TypeError: Smsapi\Client\Infrastructure\ResponseMapper\JsonDecode::decode(): Return value must be of type stdClass, array returned in /vendor/smsapi/php-client/src/Infrastructure/ResponseMapper/JsonDecode.php:28
Stack trace:
#0 /vendor/smsapi/php-client/src/Infrastructure/ResponseMapper/RestResponseMapper.php(44): Smsapi\Client\Infrastructure\ResponseMapper\JsonDecode->decode('[]')
#1 /vendor/smsapi/php-client/src/Infrastructure/RequestExecutor/RestRequestExecutor.php(80): Smsapi\Client\Infrastructure\ResponseMapper\RestResponseMapper->map(Object(GuzzleHttp\Psr7\Response))
#2 /vendor/smsapi/php-client/src/Infrastructure/RequestExecutor/RestRequestExecutor.php(45): Smsapi\Client\Infrastructure\RequestExecutor\RestRequestExecutor->sendRequestAndMapResponse(Object(Smsapi\Client\Infrastructure\Request))
#3 /vendor/smsapi/php-client/src/Feature/Mfa/MfaHttpFeature.php(42): Smsapi\Client\Infrastructure\RequestExecutor\RestRequestExecutor->create('mfa/codes/verif...', Array)
It would be nice to clearly specify how do we want to collaborate on this project.
So I would recommend to prepare some contribution rules.
This document should contain:
Related to #38
While adding or editing contact there is no possibility to add it to more than one group.
I foun that private method SMSApi\Proxy\Http\Native::doSocket cannot be called unless $connGateway is set to SMSApi\Proxy\Http\Native::CONNECT_SOCKET. But private $connGateway property cannot be changed, so doSocket is never called.
I found that Proxy/Uri is used in each action. To create an action you have to pass Proxy Object to Action`s constructor.
When Action::execute() is called proxy is calling Action::uri() to create Proxy/Uri Object. Than proxy uses Uri object to create request to the webservice. So in fact Action knows how its gona be executed.
Action Object should not know nothing about Proxy nor Proxy/Uri nor about anything that is outside Api/Action namespace. Action should be simple container that holds only request parameters.
I`ve prepared some implementaion that partly removes Action knowelege about Proxy namespace.
https://github.com/rollenes/smsapi-php-client/tree/issue/proxy-scope
Please make some code review there, and let me know if I am heading in right direction.
I cannot make pull request because my changes breaks interface. And release branch is required.
See #30.
Hi,
In previous version (1.8) It was possible to set custom encoding via setEncoding()
.
In 2.0 via SendSmsBag
there is no such function. I have problem with Polish characters. I saw only encoding property in SendSmsBag class. What can I do ?
I see many strange pieces of code in v1.*. I think that it is good approach to clear 2.0 branch, and start working on new version from writing RFC.
I have prepared embryo of that document some time ago.
See: https://github.com/rollenes/smsapi-php-client/tree/2.0-proposal
i tried with token and password login - its not working i always get Authorization failed error;
then i tried with the curl version: https://www.smsapi.com/rest
that one is working like it should - couldn't trace the bug any further cause i actually didn't find the error in that package - so i guess its the answer form the server i'm talking to (also tried api2)
Hello, when will php 8 be supported?
When I run whole test suite and something goes wrong points on my SMSAPI account just disappear.
It would be nice to have some webservice that just act as real SMSAPI api.
I recommend to use https://github.com/coduo/TuTu, as nice tool to create such webservice.
Other programmers may use such webservice to run their integration tests.
After change in #18 this test passes for empty template name.
It should be skipped in this situation IMO.
I want to remove multiple vmses in one request. It is not possible when using SMSApi\Api\Action\Vms::filterByIds method, but it seams to be dedicated for this purpose.
The problem is with sch_del parameter separator. It is pipe "|" in actual implementation. It seems like API does not support pipe.
It works with coma ",' as a separator.
Fix in #7 pull request.
Calling SmsHttpFeature->sendSms(...)
triggers following deprecation error:
E_USER_DEPRECATED: The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.
It comes from \GuzzleHttp\Psr7\Uri
. I think changing SmsHttpFeature::makeRequest
to use /sms.do
instead of sms.do
will fix it.
Tested version: 3.0.2 on PHP 7.4. SMSAPI library automatically installed guzzlehttp/psr7
in version 1.7.0.
Hi,
is there any way to manually retrieve SMS status info using its msgId? Unfortunately, the Callback Reports option is not suitable for me, because if the server is unavailable, I have no information about the status of messages that received such a Callback Report.
Add possibility to add/remove contact from specified groupe while editing contact.
Integration tests are executed only with ProxyNative.
In project there is another Proxy - ProxyCurl, and those tests should be run with CurlProxy.
Add information about groups to which contact is assigned while getting information about it.
Hi,
I was trying to pass uri in smsapiPlServiceWithUri() method, and my uri contained port number. I saw that the messages was sent with default port 80. After some digging I saw that prepareRequestHttpClient is just not picking it from uri.
I have already figured it out and this is really small change.
Or perhaps this is not possible due to backward compatibility or some security related stuff?
A couple days ago our sentry logged the following exception:
TypeError
Return value of Smsapi\Client\Infrastructure\ResponseMapper\ApiErrorException::getError() must be of the type string, null returned
The code that produced this exception:
try {
$sms = SendSmsBag::withMessage($params['phone'], $params['message']);
$sms->from = $params['sender'];
$response = $this->smsapiPlService->smsFeature()->sendSms($sms);
$return = $response->status;
} catch (ApiErrorException $e) {
return $e->getError();
}
What can we do to avoid this situation in the future? Isn't this a bug in your library?
In documentation SMS Authenticator have not implemented. Could you tell me, it will be implemented in future?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.