Download the PHP package oxik/one-api-bundle without Composer
On this page you can find all versions of the php package oxik/one-api-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package one-api-bundle
OneApiBundle for Symfony2 0.0.1
What is OneApiBundle?
It's a small symfony bundle that acts like a bridge between infobip OneApi and your symfony project.
Simple wrap the OneApi objects into your services or controllers.
The next documentation is ported from OneApi and adapted to the use in your symfony 2 project.
Installation
Add this to your composer.json
file.
And to AppKernel.php
Add your username and password to `config.yml' file.
Use of static::functions
You still can use the static functions of OneApi, load infobin/class
namespace manually.
Basic messaging example
First include the OneApiBundle Wrapper
service into your code and retrieve a new instance of SmsClient
.
The first argument is the class to initialize from OneApi, the second one are the arguments of the class (if true then username and password will be passed to the function, insert an array instead to set your own custom arguments).
An exception will be thrown if your username and/or password are incorrect.
Prepare the message:
Send the message:
Later you can query for the delivery status of the message:
Possible statuses are: DeliveredToTerminal, DeliveryUncertain, DeliveryImpossible, MessageWaiting and DeliveredToNetwork.
Messaging with notification push example
Same as with the standard messaging example, but when preparing your message:
When the delivery notification is pushed to your server as a HTTP POST request, you must process the body of the message with the following code:
Sending message with special characters example
If you want to send message with special characters, this is how you prepare your message:
Currently supported languages (with their language codes) are: Spanish - "SP"
, Portuguese - "PT"
, Turkish - "TR"
.
Number Context example
Initialize and login the data connection client:
Retrieve the roaming status (Number Context):
Retrieve inbound messages example
With the existing sms client (see the basic messaging example to see how to start it):
Social invites sms example
If you have Social Invites application registered and configured (tutorial), you can send invitations.
First initialize the social invites client using your username and password:
Prepare the social invitation:
Send the message:
Later you can query for the delivery status of the social invite message:
License
This library (and OneApi PHP) is licensed under the Apache License, Version 2.0