sorbet
signature to fix issue with T.nilable(T.untyped)
. See issue #200 and PR #199. Thanks to @KaanOzkan and @vinistock
#Fixes
Fixing an issue caused by the usage of a non thread safe Dictionary.
type
is now set to unicode
, developers now have the option to set to text
if they wish by using the setType()
method on the SMS or OutboundMessage class.
true
, the from number will be randomly selected from the pool of numbers available to the application making the call.
FromRandomNumber
to true
, to pull a random available to your application. If FromRandomNumber
is set to true, the From
endpoint must not be set.
sub
should now generate properly under newer PHP versions
EntityId
and ContentId
fields to SMS Requests to compile with India's DLT
Detail
field to call status webhooks to provide more granular detail of certain inbound webhooks.
Channels
parameter would serialize to 0 when not initialized in RecordAction
- the parameter is now properly ignored.
New, simplified method for sending SMS messages.
To send an SMS simply use the Sms client's SendAnSms
function
var smsResponse = smsClient.SendAnSms(FROM_NUMBER, TO_NUMBER, TEXT);
New, simplified method for sending SMS messages.
To send an SMS simply use the Sms client's SendAnSms
function
var smsResponse = smsClient.SendAnSms(FROM_NUMBER, TO_NUMBER, TEXT);
voiceName
parameter as deprecated
language
and style
parameters for text-to-speech. E.g.var talkAction = new TalkAction() { Text = "Hei dette er en tekst-til-tale-samtale fra vonage " + extraText, Language="no-NO" };
VoiceName
parameter has been deprecated.
Don't be scared off by this large release! Most of it is under-the-hood syntax cleanup. Thank you to everyone during Hacktoberfest for the cleanup and help with the SDK!
The big addition was we added support for VAPI Language and Style (https://developer.nexmo.com/voice/voice-api/guides/text-to-speech), and fixed a bug when manually setting the Verify code length.
examples/
directory as the code snippets repo is much more up-to-date
Async
to the end of the old method name - e.g. SendAnSmsAsync
CreateCall
has two new overloads which support either two phone numbers (to and from) and an NCCO, or a to endpoint and from number and NCCO
A special thanks to all of the Hacktoberfest contributions. Your work is appreciated!
ocramius/package-versions
for composer/package-versions-deprecated
to work with Composer 2
nexmo-jwt
gem dependency to v0.1.2. Fixes the ACL path parameter formation in JWT creation.
\Vonage\Numbers\Client::searchAvailable()
now correctly handles filters using FilterInterface
This release includes a minimum version bump to PHP 7.2, as 7.1 is nearing full EOL. This also better allows us to support Guzzle 7 out of the box.
This version serves as the change from the Nexmo namespace to the Vonage namespace. The module now resides on NPM as
@vonage/server-sdk
. Prior versions under the Nexmo namespace will remain in maintenance mode for the next 12 months and recieve bug and security fixes. All new functionality will only be added to the @vonage namespace.
nexmo
to @vonage/server-sdk
eventUrl
was being set as a string, changed to single element array of strings
\Vonage\Client\MapFactory::make()
to always instantiate new objects
5.3.0 switches all naming in the SDK from Nexmo -> Vonage. And marks the first release of the new Vonage nuget package.
The Nexmo namespace is preserved but all classes within it are marked as deprecated as they will be removed in the next major release (6.0).
This release contains a major milestone where all the code is now under the \Vonage
namespace! Do not worry though, any existing code using the \Nexmo
namespace will still continue to work thanks to a new vonage/nexmo-bridge
package which will translate between the two namespaces. The next time you update your Nexmo client to this or any subsequent 2.x releases, your code will continue to work with no changes.
It is recommended to start using the \Vonage
namespace in any new code you create, but even new features added (like our PSD2 feature in this release) will work under either namespace. Developers will be able to update at their own pace.
vonage/nexmo-bridge
as a dependency so \Nexmo
namespaced code works with the new \Vonage
namespace\Vonage\Client\APIResource
can now specify headers for individual requests\Nexmo
to \Vonage
for all classes, interfaces, and traits
country
as a search option for Nexmo\Numbers\Client::searchOwned()
target_api_key
parameter for the number.buy()
and number.cancel()
methods.\n
with newlines for easier usage in environment variables.
Adds new utility methods for parsing inbound webhooks from Vonage Fixes bug with parsing multi-input event webhooks.
Minor bugfix release based on feedback:
This release focuses on deprecation of dead and old code, and preps many internal changes in regards to v3.0.0. Where possible upcoming v3.0.0 changes were backported where backward-compatibility could be maintained.
$client->voice()
and $client->sms()
, respectivelyNexmo\Client
"show_deprecations" config option. This can help devs update in preparation in v3.0.0, and will be utilized in the future as things are deprecated.toArray()
serialization method, to discourage direct use of jsonSerialize()
fromArray()
hydration methodNexmo\Client\APIResource
and Nexmo\Entity\IterableAPICollection
Nexmo\Client\Factory\MapFactory
is now PSR-11 compliant, and can use factoriesNexmo\Verify\Request
for starting new Verification requestsFor a detailed list of things that may impact an application, enable the show_deprecations
Nexmo\Client
option to see deprecation notices for specific code flows.
$client->messages($filter)
to search has been deprecated in favor of bespoke search methodsNexmo\Verify\Verification
objects full functionality has been deprecated, and will be used only as a value object for search requests in the futureNexmo\Conversations
and Nexmo\User
have been deprecated and will be removed in the future as the feature is in Beta status and has diverged from this implementationNexmo\Voice\Call
and Nexmo\Voice\Message
have been deprecated and will be removed in the future as the TTS API is deprecatedNexmo\Client\Exception\ThrottleException
and has been implemented in SMS and the Numbers APINexmo\SMS\Client::send()
as it now returns a fully hydrated collection object as a response, however this needs to be updated in Laravel itself via an update to nexmo/laravel
and laravel/nexmo-notification-channel
Nexmo\SMS\Client::send()
as it now returns a fully hydrated collection object that is much more up-front it is not a single objectNexmo\SMS\Webhook\InboundSMS
nexmo-jwt
gem.app_id
in the Numbers API with the SDK.
This new version of the .NET Nexmo SDK Introduces the new PSD2 feature for the Vonage Verify API.
For more details about using this feature see its code snippets. And its API Reference
We've added a few new features to the .NET SDK, here's an enumeration of them.
Older iterations of the SDK didn't feel very ".NET", this release fixes that.
We've abstracted all API Calls behind interfaces allowing easy substitution via dependency injection for your testing. For example, the Legacy SDKs SMS class is replaced by the ISmsClient
interface, which you can speak through or replace on your own.
All of the new structures and APIs are now compliant with .NET naming conventions. Additionally, we've introduced many new enums to remove some open string fields. We preserved the legacy structures but marked them as obsolete as a gentle reminder to update the latest version as this will make upgrading easier.
A new means of logging has been added to the SDK built around Microsoft.Extensions.Logging. Thus you can configure the logging of the SDK to use whatever logging format you want; you can make it as compliant to your own logs as you'd like, and there's no need to log our SDKs outputs to your log files. See my explainer about how this is structured and how you can get up and logging with your own logs!
The SDK now comes with a summary docs file to make it easier for you to determine how to go about building your applications.
All API calls will throw an exception containing a best-effort description of what went wrong if they encounter an error. This includes all 4xx, 5xx responses, and errors from the SMS, Numbers, Number Insight, and Verify APIs that might respond with a 200 OK response and an error code. All of these exceptions will be of the type NexmoException
(SubTypes NexmoSmsResponseException
, NexmoNumberInsightResponseException
, NexmoNumberResponseException
, NexmoVerifyResponseException
) or NexmoHttpRequestException
.
There are similar errors that will be thrown for the legacy APIs as well.
We've also made some significant enhancements under the hood that will be less relevant to interacting with the API but might still be interesting.
We've refactored all of the internal ApiRequest
methods to make them more user friendly and generic. You can have a look here.
Note: These methods are not considered part of the public API of the SDK and are subject to change without notice.
We've added a whole new suite of unit tests to prevent things from breaking on their way out the door. Unit test coverage went from 33% in 4.4.0 to 87% in 5.0. Virtually everything that is not tested is either legacy or a third party file previously incorporated into the SDK.
We've done our best to ensure that the upgrade path to 5.0 will be as seamless as possible. The new structures should not affect current users of the SDK though I would encourage everyone to heed the obsolescence warnings. That said, there are a couple of breaking changes between 4.x and 5.x that you should be aware of.
We've removed LibLog, thus without action on the developer's part logs will cease to be intermingled with developer's logs.
New exceptions will be thrown in the case of any error being encountered on an API call, this includes 200 responses with error codes.
If anyone encounters any issues please open an issue in the Github repo
apiKey
and apiSecret
optional when applicationId
and privateKey
are present in Nexmo constructor.
Adding new Automatic Speech Recognition (ASR) action to NCCO Action set. To start an asr input you will construct a MultiInputAction and return it from your answer webhook:
[HttpGet("/webhooks/answer")]
public string Answer([FromQuery]Answer request)
{
var host = Request.Host.ToString();
//Uncomment the next line if using ngrok with --host-header option
//host = Request.Headers["X-Original-Host"];
var eventUrl = $"{Request.Scheme}://{host}/webhooks/asr";
var speechSettings = new SpeechSettings {Language="en-US", EndOnSilence=1, Uuid = new[] { request.Uuid } };
var inputAction = new MultiInputAction { Speech = speechSettings, EventUrl = new[] { eventUrl } };
var talkAction = new TalkAction { Text = "Please speak now" };
var ncco = new Ncco(talkAction, inputAction);
return ncco.ToString();
}
This will allow a user to perform inputs with speech. After the end conditions are met for the voice input you will then get a webhook returned to you containing an ordered list of guesses for what speech your user said on the EventUrl
that you passed through the MultiInputAction. That can be handled like so:
[HttpPost("/webhooks/asr")]
public string OnInput()
{
MultiInput input;
using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
{
var result = reader.ReadToEndAsync().Result;
input = JsonConvert.DeserializeObject<MultiInput>(result);
}
var talkAction = new TalkAction();
talkAction.Text = input.Speech.SpeechResults[0].Text;
var ncco = new Ncco(talkAction);
return ncco.ToString();
}
headers
type from a string to an object - the string type was injecting escape charecters into the headers object payload.
apiHost
& restHost
Adding workflows 6, SMS, and 7, TTS to the SDK's enumerated values.
applicationId
anymore.
This release contains a few quality of life changes for the SDK. We have added support for sending a Workflow ID to our Verify API, as well as the ability to search your existing numbers for ones that are attached to an application or not, or for all the numbers attached to a specific application.
has_application
and application_id
Added support for verification workflow id add transfer to NCCO support Remove unnecessary declarations of throwing of IOExceptions.
Release 4.1.2 Fixes hash / HMAC signing and validation of signed messages for an example of how to manage signing / validation of signed messages visit https://developer.nexmo.com/concepts/guides/signing-messages/dotnet
This release contains a few under-the-hood changes. The largest is the bump to PHP 7.1, which may affect some customers. If you are on an older version of PHP, you will be limited to SDK v1.8.1 or lower.
We have also renamed this package into nexmo/client-core
and added a new wrapper package to replace nexmo/client
. For most customers this process should be seamless, and composer should automatically handle the change. This change is made to remove a collision between our package and others that may supply Guzzle themselves.
If you use the SDK to search for numbers, please be advised that we did change the response for when no numbers are found. It will now return an empty array instead of throwing an exception. Other searches are not affected and will continue to throw their original exceptions.
Exceptions will now support an additional getEntity()
method that returns additional information about what happened. In many cases this is the response from the server, to make it easier to understand the API error message. Exceptions continue to return error codes and messages like before, but the getEntity()
method can be used for better context during error handling.
Please check the rest of the changelog for a full list of changes.
getEntity()
method to get more information during errorsnexmo/client-core
nexmo/client
v4.1 Fixes the structure of the application update API. This changed structure may require some code changes as the previous implementation created an erroneous structure for performing the update and start request. Use something along the lines of the following to create the request for the update / create:
var request = new AppRequest()
{
Name = name,
Capabilities = new Capabilities()
{
Messages = new MessagesWebhook(
new Webhook() { Address = "https://example.com/webhooks/inbound", HttpMethod = "POST" },
new Webhook() { Address = "https://example.com/webhooks/status", HttpMethod = "POST" }),
Rtc = new RtcWebhook(
new Webhook() { Address = "https://example.com/webhooks/event", HttpMethod = "POST" }),
Voice = new VoiceWebhook(
new Webhook() { Address = "https://example.com/webhooks/answer", HttpMethod = "GET" },
new Webhook() { Address = "https://example.com/webhooks/event", HttpMethod = "POST" }),
Vbc = new VbcWebhook()
}
};
v4.1 Fixes the Redact API, this can be invoked like so:
var result = client.Redact.RedactTransaction(redactRequest: new Redact.RedactRequest(NEXMO_REDACT_ID, NEXMO_REDACT_PRODUCT));
v4.1 Adds support for retrieving voice recordings using the GetRecording API invoke like so:
var response = client.Call.GetRecording(recordingUrl);
Added workflow_id to verify_request
This release contains a few under-the-hood changes. The largest is the bump to PHP 7.1, which may affect some customers. If you are on an older version of PHP, you will be limited to SDK v1.8.1 or lower.
We have also renamed this package into nexmo/client-core
and added a new wrapper package to replace nexmo/client
. For most customers this process should be seamless, and composer should automatically handle the change. This change is made to remove a collision between our package and others that may supply Guzzle themselves.
If you use the SDK to search for numbers, please be advised that we did change the response for when no numbers are found. It will now return an empty array instead of throwing an exception. Other searches are not affected and will continue to throw their original exceptions.
Exceptions will now support an additional getEntity()
method that returns additional information about what happened. In many cases this is the response from the server, to make it easier to understand the API error message. Exceptions continue to return error codes and messages like before, but the getEntity()
method can be used for better context during error handling.
Please check the rest of the changelog for a full list of changes.
getEntity()
method to get more information during errorsnexmo/client-core
nexmo/client
Nexmo.generateSignature
to verify signed messages
async
and callback
on the AdvancedInsightRequest
object.ringback
support to the onAnswer
part of the PhoneEndpoint
.com.nexmo.client.applications
package to com.nexmo.client.application
ApplicationClient
now supports the Applications v2 API. This change has resulted in some backwards incompatibility.NexmoClientException
is now a RuntimeException
. The various sub client methods will still declare that it is being thrown, but it is no longer a requirement to catch the exception. Additionally, the IOException
that was being thrown in each method has been converted to a NexmoResponseParseException
to more accurately reflect when it is thrown. This is also an unchecked exception and catching is no longer required.NexmoUnacceptableAuthException
will now add which parameters are missing instead of which internal auth methods.