https://github.com/moceanapi/mocean-sdk-dotnet
✉📲 SDK Library for dotnet to send SMS for FREE using MoceanAPI sms solution.
https://github.com/moceanapi/mocean-sdk-dotnet
moceanapi sms-api sms-client sms-messages
Last synced: 9 months ago
JSON representation
✉📲 SDK Library for dotnet to send SMS for FREE using MoceanAPI sms solution.
- Host: GitHub
- URL: https://github.com/moceanapi/mocean-sdk-dotnet
- Owner: MoceanAPI
- License: mit
- Created: 2018-06-27T02:52:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-20T05:23:30.000Z (over 4 years ago)
- Last Synced: 2025-03-10T14:18:37.302Z (10 months ago)
- Topics: moceanapi, sms-api, sms-client, sms-messages
- Language: C#
- Homepage: https://moceanapi.com/
- Size: 1.73 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
MoceanAPI Client Library for C#/.NET
============================
[](https://www.nuget.org/packages/Mocean.Csharp.Client/)
[](https://travis-ci.com/MoceanAPI/mocean-sdk-dotnet)
[](https://codecov.io/gh/MoceanAPI/mocean-sdk-dotnet)
[](https://app.codacy.com/project/MoceanAPI/mocean-sdk-dotnet/dashboard)
[](https://packagist.org/packages/mocean/client)
[](https://www.nuget.org/packages/Mocean.Csharp.Client/)
This is the C# client library for use Mocean's API. To use this, you'll need a Mocean account. Sign up [for free at
moceanapi.com][signup].
* [Installation](#installation)
* [Usage](#usage)
* [Example](#example)
## Installation
To use the client library you'll need to have [created a Mocean account][signup].
To install the C# client library using NuGet:
- Run the following command in the Package Manager Console:
```bash
Install-Package Mocean.Csharp.Client
```
## Usage
You need to create a Client object containing your API key and secret to work with all function:
```csharp
using Mocean;
using Mocean.Auth;
var credentials = new Basic("API_KEY_HERE", "API_SECRET_HERE");
var client = new Client(credentials);
```
## Example
To use [Mocean's SMS API][doc_sms] to send an SMS message, call the `client.Sms.Send()` method.
The API can be called directly, using a simple array of parameters, the keys match the [parameters of the API][doc_sms].
```csharp
var res = client.Sms.Send(new Mocean.Message.SmsRequest
{
mocean_to = "60123456789",
mocean_from = "MOCEAN",
mocean_text = "Hello World"
});
Console.WriteLine(res);
```
### Responses
For your convenient, the API response has been parse to specified object.
```csharp
Console.WriteLine(res); //show full response string
Console.WriteLine(res.status); //show response status, "0" in this case
```
## Documentation
Kindly visit [MoceanApi Docs][doc_main] for more usage
## License
This library is released under the [MIT License][license]
[signup]: https://dashboard.moceanapi.com/register?medium=github&campaign=dotnet-sdk
[doc_main]: https://moceanapi.com/docs/?csharp
[doc_sms]: https://moceanapi.com/docs/?csharp#send-sms
[license]: LICENSE.md